<commit_before>"""Library of useful functions that apply to many modules."""

from os import getcwd, path
import logging.handlers

try:
    import yaml
except ImportError as err:
    import sys
    sys.stderr.write("ERROR: {}. Try installing python-yaml.\n".format(err))
    raise


# Global objects
_config = None
_loaded_config_file = None
_logger = None
default_config = "config.yaml"


# Types
class Enum(tuple):
    """Simple enumeration type based on tuple with integer values."""

    __getattr__ = tuple.index

    fromString = tuple.index

    def toString(self, value):
        return self[value]<commit_msg>Minor bugfix for sys import<commit_after>"""Library of useful functions that apply to many modules."""

from os import getcwd, path
import logging.handlers
import sys

try:
    import yaml
except ImportError as err:
    sys.stderr.write("ERROR: {}. Try installing python-yaml.\n".format(err))
    raise


# Global objects
_config = None
_loaded_config_file = None
_logger = None
default_config = "config.yaml"


# Types
class Enum(tuple):
    """Simple enumeration type based on tuple with integer values."""

    __getattr__ = tuple.index

    fromString = tuple.index

    def toString(self, value):
        return self[value]
{'fraction_non_alphanumeric': 0.09470304975922954, 'fraction_numerical': 0.0, 'mean_word_length': 3.741444866920152, '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': '174063', 'n_tokens_mistral': 365, 'n_tokens_neox': 350, 'n_words': 125}