import yaml


def yaml2dict(yaml_path: str):
    """
    Read yaml file as python dictionary
    """
    assert yaml_path.endswith('.yml') or yaml_path.endswith('.yaml')

    with open(yaml_path) as f:
        doc = yaml.full_load(f)
    return doc