<commit_before>'''
'''
from ast import literal_eval
import logging
from pprint import pformat


log = logging.getLogger(__name__)

def try_eval(value):
    "Try and evaluate a literal value, if it fails, return a string"
    try:
        return literal_eval(value)
    except:
        return value


def set_nested_key(dct, key, value):
    """
    Set a nested key in a dictionary
    """

    keys = key.split('.')
    next_key = keys.pop(0)

    while keys:
        dct = dct.setdefault(next_key, {})
        next_key = keys.pop(0)<commit_msg>change literal_eval to yaml.safe_load<commit_after>'''
'''
from yaml import safe_load
import logging
from pprint import pformat


log = logging.getLogger(__name__)

def try_eval(value):
    "Try and evaluate a literal value, if it fails, return a string"
    try:
        return safe_load(value)
    except:
        return value

def set_nested_key(dct, key, value):
    """
    Set a nested key in a dictionary
    """

    keys = key.split('.')
    next_key = keys.pop(0)

    while keys:
        dct = dct.setdefault(next_key, {})
        next_key = keys.pop(0)
{'fraction_non_alphanumeric': 0.10540540540540541, 'fraction_numerical': 0.0036036036036036037, 'mean_word_length': 2.831034482758621, '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': '4522420', 'n_tokens_mistral': 363, 'n_tokens_neox': 356, 'n_words': 110}