from typing import Union
import yaml


def read_yaml(path: str) -> Union[dict, list]:
    """Loads yaml at given path

    Args:
        path (str): path to yaml file

    Returns:
        Union[dict, list]: dictionary or list loaded from yaml depending on the yaml
    """
    with open(path, encoding="UTF-8") as yaml_file:
        return yaml.safe_load(yaml_file)