<commit_before># -*- coding: utf-8 -*-
"""Parse yaml config files, to construct sector models
"""
from ruamel.yaml import YAML


def load(file_path):
    """Parse yaml config file into plain data (lists, dicts and simple values)

    Parameters
    ----------
    file_path : str
        The path of the configuration file to parse
    """
    with open(file_path, 'r') as file_handle:
        return YAML().load(file_handle)


def dump(data, file_path):
    """Write plain data to a file as yaml

    Parameters
    ----------
    file_path : str
        The path of the configuration file to write
    data
        Data to write (should be lists, dicts and simple values)
    """
    with open(file_path, 'w') as file_handle:
        return YAML().dump(data, file_handle)<commit_msg>Take over pyyaml configurations<commit_after># -*- coding: utf-8 -*-
"""Parse yaml config files, to construct sector models
"""
from ruamel.yaml import YAML


def load(file_path):
    """Parse yaml config file into plain data (lists, dicts and simple values)

    Parameters
    ----------
    file_path : str
        The path of the configuration file to parse
    """
    with open(file_path, 'r') as file_handle:
        return YAML().load(file_handle)


def dump(data, file_path):
    """Write plain data to a file as yaml

    Parameters
    ----------
    file_path : str
        The path of the configuration file to write
    data
        Data to write (should be lists, dicts and simple values)
    """
    with open(file_path, 'w') as file_handle:
        yaml = YAML()
        yaml.default_flow_style=False
        yaml.allow_unicode=True
        return yaml.dump(data, file_handle)
{'fraction_non_alphanumeric': 0.1102502979737783, 'fraction_numerical': 0.0011918951132300357, 'mean_word_length': 2.5052192066805845, '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': '7529128', 'n_tokens_mistral': 496, 'n_tokens_neox': 467, 'n_words': 182}