import yaml


def read_yaml(infile, log=None) -> dict:
    """
    Read YAML file and return a python dictionary

    Args:
        infile: path to the json file; can be hdfs path

    Returns:
        python dictionary
    """
    if infile.startswith("hdfs"):
        raise NotImplementedError
    else:
        return yaml.safe_load(open(infile, "r"))