code: def _get_name(func: Callable):
      if hasattr(func, "__name__"):
          return func.__name__
  
      # Not all callables have __name__, in fact, only static functions/methods do.
      # A callable created via functools.partial or an nn.Module, to name some
      # examples, don't have a __name__.
      return repr(func)
  
file_path: pytorch/torch/_vmap_internals.py
imports: import functools
  import warnings
  from typing import Any, Callable, List, Optional, Tuple, Union
  import torch
  from torch import Tensor
  from torch.utils._pytree import _broadcast_to_and_flatten, tree_flatten, tree_unflatten
label_desc: Use image node_id 8 for calling a global function with example usage: _get_name(func) and returns: repr, func