<commit_before># -*- coding: utf-8; -*-
#
# This file is part of Superdesk.
#
# Copyright 2013, 2014 Sourcefabric z.u. and contributors.
#
# For the full copyright and license information, please see the
# AUTHORS and LICENSE files distributed with this source code, or
# at https://www.sourcefabric.org/superdesk/license

import json
import os


def _load_json(file_path):
    """
    Reads JSON string from the file located in file_path.

    :param file_path: path of the file having JSON string.
    :return: JSON Object
    """
    with open(file_path, 'r') as f:
        return json.load(f)


_dir_name = os.path.dirname(os.path.realpath(__file__))
_locators_file_path = os.path.join(_dir_name, 'data', 'locators.json')
locators = _load_json(_locators_file_path)
<commit_msg>Fix locators reading on ubuntu<commit_after># -*- coding: utf-8; -*-
#
# This file is part of Superdesk.
#
# Copyright 2013, 2014 Sourcefabric z.u. and contributors.
#
# For the full copyright and license information, please see the
# AUTHORS and LICENSE files distributed with this source code, or
# at https://www.sourcefabric.org/superdesk/license

import json
import os


def _load_json(file_path):
    """
    Reads JSON string from the file located in file_path.

    :param file_path: path of the file having JSON string.
    :return: JSON Object
    """
    with open(file_path, 'r', encoding='utf-8') as f:
        return json.load(f)


_dir_name = os.path.dirname(os.path.realpath(__file__))
_locators_file_path = os.path.join(_dir_name, 'data', 'locators.json')
locators = _load_json(_locators_file_path)

{'fraction_non_alphanumeric': 0.10707576706324358, 'fraction_numerical': 0.011897307451471509, 'mean_word_length': 3.9473684210526314, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 2, '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': '2122457', 'n_tokens_mistral': 536, 'n_tokens_neox': 507, 'n_words': 165}