<commit_before>import json

from django.test import TestCase, Client


class JsonClient(Client):

    def generic(self, method, path, data='', *args, **kwargs):
        if 'json' in kwargs:
            if data:
                raise ValueError("Must specify at most ond of 'data' and 'json'.")
            data = json.dumps(kwargs.pop('json'))
            kwargs.setdefault('content_type', 'text/json')
        return super(Client, self).generic(method, path, data, *args, **kwargs)


class ApiTestCase(TestCase):

    def assertResponseCode(self, url, status_code, method='get', **kwargs):
        result = self.client.generic(method, **kwargs)
        self.assertEqual(result.status_code, status_code)
        return result<commit_msg>Fixed typo<commit_after>import json

from django.test import TestCase, Client


class JsonClient(Client):

    def generic(self, method, path, data='', *args, **kwargs):
        if 'json' in kwargs:
            if data:
                raise ValueError("Must specify at most one of 'data' and 'json'.")
            data = json.dumps(kwargs.pop('json'))
            kwargs.setdefault('content_type', 'text/json')
        return super(Client, self).generic(method, path, data, *args, **kwargs)


class ApiTestCase(TestCase):

    def assertResponseCode(self, url, status_code, method='get', **kwargs):
        result = self.client.generic(method, **kwargs)
        self.assertEqual(result.status_code, status_code)
        return result
{'fraction_non_alphanumeric': 0.12780421481985044, 'fraction_numerical': 0.0, 'mean_word_length': 3.134831460674157, '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': '4287373', 'n_tokens_mistral': 416, 'n_tokens_neox': 411, 'n_words': 116}