code: def _get_name(fn):
      return getattr(fn, "__name__", type(fn).__name__)
  
imports: import contextlib
  import functools
  import inspect
  import weakref
  from collections import OrderedDict
  from funsor.registry import PartialDispatcher
  from funsor.util import methodof
label_desc: Use image node_id 2 for calling a global function with example usage: _get_name(fn) and returns: getattr