<commit_before>import json

from lml.plugin import PluginInfo

from moban import constants


@PluginInfo(constants.DATA_LOADER_EXTENSION, tags=["json"])
def open_json(file_name):
    """
    returns json contents as string
    """
    with open(file_name, "r") as json_data:
        data = json.loads(json_data.read())
        return data<commit_msg>:microscope: fix unit test failure on python 2<commit_after>import json

from lml.plugin import PluginInfo

from moban import constants


@PluginInfo(constants.DATA_LOADER_EXTENSION, tags=["json"])
def open_json(file_name):
    """
    returns json contents as string
    """
    with open(file_name, "r") as json_data:
        data = json.load(json_data)
        return data
{'fraction_non_alphanumeric': 0.09793103448275862, 'fraction_numerical': 0.001379310344827586, 'mean_word_length': 3.938775510204082, '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': '6313772', 'n_tokens_mistral': 228, 'n_tokens_neox': 224, 'n_words': 62}