import yaml


def parse_yaml(path):
    """ Parse a YAML config file to a dictionary.
    """
    with open(path, 'r') as stream:
        try:
            config = yaml.safe_load(stream)
            return config
        except yaml.YAMLError as exc:
            raise (exc)