from typing import Mapping
from typing import Callable
from typing import Any
from typing import Dict


def translate_dict_func(d: Mapping[str, Callable[..., Any]]) -> Callable[..., Dict[str, Any]]:
    """
    Overview:
        Transform dict with funcs to function generating dict.
    Arguments:
        - d (:obj:`Mapping[str, Callable[..., Any]]`): Dict with funcs
    Returns:
        - func (:obj:`Callable[..., Dict[str, Any]]`): Function generating dict
    Example:
        >>> f1 = lambda x, y: x + y
        >>> f2 = lambda x, y: x - y
        >>> f3 = lambda x, y: x * y
        >>> fx = translate_dict_func({'a': f1, 'b': f2, 'c': f3})
        >>> fx(2, 3)  # {'a': 5, 'b': -1, 'c': 6}
        >>> fx(5, 11)  # ('a': 16, 'b': -6, 'c': 55}
    """

    def _func(*args, **kwargs) -> Dict[str, Any]:
        return {k: f(*args, **kwargs) for k, f in d.items()}

    return _func