import yaml


def parse_yaml_to_dict(contents):
    """
    Parses YAML to a dict.

    Parameters
    ----------
    contents : str
        The contents of a file with user-defined
        configuration settings.

    Returns
    -------
    dict
       Configuration settings (one key-value
       pair per setting) or an empty dict.
    """

    if contents:
        return yaml.safe_load(contents)
    else:
        return dict()