def METHOD_NAME(project_file: Path) -> Dict[str, Any]:
    """Process yaml data from file into a dictionary.
    :param project_file: Path to project.
    :raises SnapcraftError: if the project yaml file cannot be loaded.
    :return: The processed YAML data.
    """
    try:
        with open(project_file, encoding="utf-8") as yaml_file:
            yaml_data = load(yaml_file)
    except OSError as err:
        msg = err.strerror
        if err.filename:
            msg = f"{msg}: {err.filename!r}."
        raise errors.SnapcraftError(msg) from err
    return yaml_data