<commit_before>import os

from enthought.resource.resource_path import resource_path
from enthought.pyface.image_resource import ImageResource

def image_resource(path):
    return ImageResource(path, search_path=[search_path])

def get_data_dir():
    return data_path

def _find_data_path():
    p = os.path.join(core_path, "..", "..", "data")
    if os.path.exists(p):
        return p
    p = os.path.join(core_path, "..", "..", "..", "..",
        "share", "hermesgui", "data")
    if os.path.exists(p):
        return p
    raise Exception("Can't find the data directory")

core_path = resource_path()
data_path = _find_data_path()
search_path = os.path.join(core_path, "images")

<commit_msg>Data files search algorithm improved<commit_after>import os

from enthought.resource.resource_path import resource_path
from enthought.pyface.image_resource import ImageResource

def image_resource(path):
    return ImageResource(path, search_path=[search_path])

def get_data_dir():
    return data_path

def _find_data_path():
    p = os.path.join(core_path, "..", "..", "data")
    if os.path.exists(p):
        return p
    p = os.path.join(core_path, "..", "..", "..", "..",
        "share", "hermesgui", "data")
    if os.path.exists(p):
        return p
    p = os.path.join(core_path, "..", "..", "..", "..", "..",
        "share", "hermesgui", "data")
    if os.path.exists(p):
        return p
    raise Exception("Can't find the data directory")

core_path = resource_path()
data_path = _find_data_path()
search_path = os.path.join(core_path, "images")


{'fraction_non_alphanumeric': 0.159846547314578, 'fraction_numerical': 0.0, 'mean_word_length': 3.4971264367816093, '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': '6402060', 'n_tokens_mistral': 538, 'n_tokens_neox': 517, 'n_words': 113}