from pathlib import Path
from typing import Any
import yaml


def load(configpath: Path) -> Any:
    """Loads a given configuration of yamlizable instances from the given configpath.

    The configuration may be a single yamlizable or a sequence (list) or mapping (dict)
    of objects that are either registered with yamlizer or natively recognized as safe
    by PyYAML.

    Args:
        configpath (Path): Path to the yaml file to load the yamlizable instances from.

    Returns:
        Any: Configuration of yamlizable instances.
    """
    with open(configpath, mode="r") as configfile:
        return yaml.safe_load(configfile)