<commit_before>class MinifyMiddleware:
    def process_response(self, request, response):
        # Yes, this function is not very pretty ;)
        if response['content-type'].startswith('text/html'):
            new_content = ''
            in_pre = False
            for char in response.content:
                if new_content.endswith('<pre'):
                    in_pre = True
                elif new_content.endswith('</pre>'):
                    in_pre = False
                if char in '\n\t' and not in_pre:
                    continue
                if char not in ' ' or new_content[-1] not in ' ' or in_pre:
                    new_content += char
            response.content = new_content
        elif response['content-type'].startswith('text/css'):
            response.content = response.content.replace('\n', '').replace('  ', ' ').replace(' } ', '}').replace(' { ', '{').replace(';}', '}').replace(': ', ':').replace('; ', ';')
            new_content = ''
            in_comment = False
            last_char = ''
            for char in response.content:<commit_msg>Phone: little optimization<commit_after>class MinifyMiddleware:
    def process_response(self, request, response):
        # Yes, this function is not very pretty ;)
        if response['content-type'].startswith('text/html'):
            new_content = ''
            in_pre = False
            for char in response.content:
                if new_content.endswith('<pre'):
                    in_pre = True
                elif new_content.endswith('</pre>'):
                    in_pre = False
                if char in '\n\t' and not in_pre:
                    continue
                if char != ' ' or new_content[-1] != ' ' or in_pre:
                    new_content += char
            response.content = new_content
        elif response['content-type'].startswith('text/css'):
            response.content = response.content.replace('\n', '').replace('  ', ' ').replace(' } ', '}').replace(' { ', '{').replace(';}', '}').replace(': ', ':').replace('; ', ';')
            new_content = ''
            in_comment = False
            last_char = ''
            for char in response.content:
{'fraction_non_alphanumeric': 0.14650844363304427, 'fraction_numerical': 0.0009128251939753537, 'mean_word_length': 1.7162329615861214, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 5, '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': '5790373', 'n_tokens_mistral': 586, 'n_tokens_neox': 565, 'n_words': 137}