def METHOD_NAME(f: Callable, x: Union[dict, list]):
    if isinstance(x, dict):
        return {k: METHOD_NAME(f, v) for k, v in x.items()}
    elif isinstance(x, list):
        return [METHOD_NAME(f, v) for v in x]
    else:
        return f(x)