code: def map_functionalize(ctx, f, xs, pos_args):
      unwrapped_xs = ctx.unwrap_tensors(xs)
      unwrapped_args = ctx.unwrap_tensors(pos_args)
      wrapped_fn = ctx.functionalize(f)
  
      with ctx.redispatch_to_next():
          with disable_proxy_modes_tracing():
              example_inputs = (
                  *_unstack_pytree(unwrapped_xs)[0],
                  *unwrapped_args,
              )
          if _has_potential_branch_input_mutation(f, example_inputs):
              raise UnsupportedAliasMutationException(
                  "torch.map is mutating the input!"
              )
  
          if _has_potential_branch_input_alias(f, example_inputs):
              raise UnsupportedAliasMutationException(
                  "torch.map is aliasing the input!"
              )
  
          map_return = map_impl(
              wrapped_fn, unwrapped_xs, unwrapped_args
          )
          return ctx.wrap_tensors(map_return)
  
imports: from contextlib import nullcontext
  import torch
  import torch.utils._pytree
  from torch._C import DispatchKey
  from torch._dispatch.python import suspend_functionalization
  from torch._functorch.aot_autograd import AOTConfig, create_joint, from_fun
  from torch._higher_order_ops.cond import _has_potential_branch_input_alias, _has_potential_branch_input_mutation, UnsupportedAliasMutationException
  from torch._ops import HigherOrderOperator
  from torch._subclasses.fake_tensor import FakeTensorMode
  from torch._subclasses.functional_tensor import FunctionalTensor, FunctionalTensorMode, unset_functional_temporarily
  from torch.fx.experimental.proxy_tensor import disable_proxy_modes_tracing, make_fx, ProxyTorchDispatchMode, track_tensor_tree
  from torch.multiprocessing.reductions import StorageWeakRef
label_desc: Use image node_id 10 for calling a global function with example usage: map_functionalize(ctx, f, xs, pos_args) and returns: ctx