<commit_before># -*- coding: utf-8 -*-

from infcommon.factory import Factory
from infcommon.yaml_reader.yaml_reader import YamlReader


def yaml_reader(path=None):
    return Factory.instance('yaml_reader', lambda: YamlReader(path))<commit_msg>[FEATURE] Use environment variable with deafult path when no path given<commit_after># -*- coding: utf-8 -*-

import os

from infcommon.factory import Factory
from infcommon.yaml_reader.yaml_reader import YamlReader


DEFAULT_PATH_ENVIRONMENT_VARIABLE_NAME = 'CONF_FILE'


def yaml_reader(path=None):
    path = path or os.environ[DEFAULT_PATH_ENVIRONMENT_VARIABLE_NAME]
    return Factory.instance('yaml_reader',
                            lambda: YamlReader(path))
{'fraction_non_alphanumeric': 0.09129213483146068, 'fraction_numerical': 0.0028089887640449437, 'mean_word_length': 4.704, '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': '2247570', 'n_tokens_mistral': 216, 'n_tokens_neox': 210, 'n_words': 51}