import yaml


def _parse_yaml_file(path):
    """Load and parse local YAML file

    Args:
        path: either a local file system path or a GCS path

    Returns:
        a Python object representing the parsed YAML data
    """

    with open(path, 'r') as stream:
        try:
            return yaml.safe_load(stream)
        except yaml.YAMLError as ex:
            print(ex)