<commit_before>import datetime
import os
import time
import json
import tempfile
from collections import namedtuple
import subprocess

from django.test import TestCase
from django.utils import unittest

from pombola.hansard.models import Source, SourceUrlCouldNotBeRetrieved


class FakeHttp(object):

    def __init__(self, status_code=200):
        self.status_code = status_code

    def request(self, _):
        FakeResponse = namedtuple('FakeResponse', ['status'])
        # With the tests as they are at the moment, the response could
        # actually be any data, but might as well make it HTML:
        return FakeResponse(self.status_code), """<!doctype html><commit_msg>Remove unused imports from test_source.py<commit_after>import datetime
import os
from collections import namedtuple

from django.test import TestCase

from pombola.hansard.models import Source, SourceUrlCouldNotBeRetrieved


class FakeHttp(object):

    def __init__(self, status_code=200):
        self.status_code = status_code

    def request(self, _):
        FakeResponse = namedtuple('FakeResponse', ['status'])
        # With the tests as they are at the moment, the response could
        # actually be any data, but might as well make it HTML:
        return FakeResponse(self.status_code), """<!doctype html>
{'fraction_non_alphanumeric': 0.07219662058371736, 'fraction_numerical': 0.004608294930875576, 'mean_word_length': 4.070038910505836, 'pattern_counts': {'":': 0, '<': 5, '<?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': '7303292', 'n_tokens_mistral': 364, 'n_tokens_neox': 345, 'n_words': 127}