<commit_before>class SchemaAPI(object):
    def __init__(self, client):
        self.client = client

    def create(self, name, fields=None):
        payload = {
            'name': name,
            'fields': fields or []
        }
        return self.client.request('schemas', method='post', json=payload)

    def list(self, **kwargs):
        return self.client.request('schemas', params=kwargs)

    def get(self, schema):
        return self.client.request('schemas/{0}'.format(schema))

    def update(self, schema, name=None, fields=None):
        payload = {}
        if name:
            payload['name'] = name
        if fields:
            payload['fields'] = fields

        if payload:
            return self.client.request('schemas/{0}'.format(schema),
                method='patch', json=payload)

    def remove(self, schema):
        return self.client.request('schemas/{0}'.format(schema), method='delete')<commit_msg>refactor(schema): rename remove() to delete(); deprecate remove()<commit_after>import warnings


class SchemaAPI(object):
    def __init__(self, client):
        self.client = client

    def create(self, name, fields=None):
        payload = {
            'name': name,
            'fields': fields or []
        }
        return self.client.request('schemas', method='post', json=payload)

    def list(self, **kwargs):
        return self.client.request('schemas', params=kwargs)

    def get(self, schema):
        return self.client.request('schemas/{0}'.format(schema))

    def update(self, schema, name=None, fields=None):
        payload = {}
        if name:
            payload['name'] = name
        if fields:
            payload['fields'] = fields

        if payload:
            return self.client.request('schemas/{0}'.format(schema),
                method='patch', json=payload)

    def delete(self, schema):
        return self.client.request('schemas/{0}'.format(schema), method='delete')

    def remove(self, schema):
        warnings.warn('The function remove() is deprecated, use delete().',
        DeprecationWarning, stacklevel=2)
        return self.delete(schema)
{'fraction_non_alphanumeric': 0.1401124648547329, 'fraction_numerical': 0.0032802249297094657, 'mean_word_length': 2.4942716857610474, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3355121', 'n_tokens_mistral': 595, 'n_tokens_neox': 566, 'n_words': 137}