code: def getname(f):
      """Get the name of an object.
  
      For use in case of callables that are not functions, and
      thus may not have __name__ defined.
  
      Order: f.__name__ >  f.name > str(f)
      """
      try:
          return f.__name__
      except:
          pass
      try:
          return f.name
      except:
          pass
  
      return str(f)
  
file_path: ipyparallel/ipyparallel/client/remotefunction.py
imports: import sys
  import warnings
  from inspect import signature
  from decorator import decorator
  from ..serialize import PrePickled
  from .None import map
  from .asyncresult import AsyncMapResult
label_desc: Use image node_id 3 for calling a global function with example usage: getname(f) and returns: str, f, f