import yaml


def read_yaml(filename):
    """Load yaml file as a dictionary item

    Args:
        filename (str): .yaml file path

    Returns:
        cfg (dict): configuration
    """

    if filename is not None:
        with open(filename, 'r') as f:
            return yaml.load(f, Loader=yaml.FullLoader)
    else:
        return {}