<commit_before>import yaml

def read_yaml(filename, defaults=None):
    
    """
    Name:
        read_yaml
    Purpose:
        Read in a YAML file with key/value pairs and put into dict
    Calling Sequence:
        outdict = read_simpleconf(filename, defaults=None)
    Inputs:
        filename: configuration file
    Optional Inputs:
        defaults: Dictionary of required/default fields/values. All fields in 
                  defaults are required to be specified. If they are set to 
                  None, they must be specified by filename.
    """
	
    outdict = defaults if defaults is not None else {}
    
    with open(filename) as f: yaml_data = yaml.load(f)
    for tag in outdict:
        if outdict[tag] is None:
            raise ValueError('A value for the required tag \"' 
                                + tag + '\" must be specified.')
    
    for tag in yaml_data: outdict[tag] = yaml_data[tag]
    
    return outdict<commit_msg>Wrote docstring for read_config.<commit_after>import yaml

def read_yaml(filename, defaults=None):
    
    """
    Name:
        read_yaml
    Purpose:
        Read in a YAML file with key/value pairs and put into dict.
    Calling Sequence:
        outdict = read_simpleconf(filename, defaults=None)
    Inputs:
        filename: YAML file
    Optional Inputs:
        defaults: Dictionary of required/default fields/values. All fields in 
                  defaults are required to be specified. If they are set to 
                  None, they must be specified by filename.
    """
	
    outdict = defaults if defaults is not None else {}
    
    with open(filename) as f: yaml_data = yaml.load(f)
    for tag in outdict:
        if outdict[tag] is None:
            raise ValueError('A value for the required tag \"' 
                                + tag + '\" must be specified.')
    
    for tag in yaml_data: outdict[tag] = yaml_data[tag]
    
    return outdict

def read_config(filename):

    """
    Name:
        read_config
    Purpose:
        Read a RedMaPPer config file in YAML format and put into dict.
    Calling Sequence:

    Inputs:
        filename: configuration file
    """

    pass
{'fraction_non_alphanumeric': 0.06841138659320478, 'fraction_numerical': 0.0, 'mean_word_length': 1.989026063100137, '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': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3481647', 'n_tokens_mistral': 618, 'n_tokens_neox': 583, 'n_words': 222}