<commit_before>import json


class WeatherJson(object):

    def fix_json_string(self, json_string):
        """ Response from server is a dict and cache is a string """

        if type(json_string) is dict:
            json_string = json.dumps(json_string)

        weather = json_string.replace("'", '"')
        weather = json.loads(weather)

        return weather<commit_msg>PEP8 update<commit_after>import json


class WeatherJson(object):

    def fix_json_string(self, json_string):
        """ Response from server is a dict and cache is a string """

        if isinstance(json_string, dict):
            json_string = json.dumps(json_string)

        weather = json_string.replace("'", '"')
        weather = json.loads(weather)

        return weather
{'fraction_non_alphanumeric': 0.10078534031413612, 'fraction_numerical': 0.0013089005235602095, 'mean_word_length': 2.8059701492537314, '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': '4472127', 'n_tokens_mistral': 221, 'n_tokens_neox': 210, 'n_words': 59}