from typing import Dict
from typing import Any


def load_python_plugin(path: str) -> Dict[Any, Any]:
    """Load a python plugin from a file

    Args:
        path (str): Path

    Returns:
        Dict[Any, Any]: Namespace of the evaluated python file
    """
    namespace = {}
    with open(path) as file:
        code = compile(file.read(), str(path), "exec")
        # Eval is required to make a dynamic plugin
        # pylint: disable=eval-used
        eval(code, namespace, namespace)
    return namespace