code: def get_default_args(func):
      """
      returns a dictionary of arg_name:default_values for the input function
      """
      if not callable(func):
          raise TypeError("%s is not callable" % type(func))
      if inspect.isfunction(func):
          print("a")
          spec = inspect.getargspec(func)
      elif hasattr(func, "im_func"):
          print("b")
          spec = inspect.getargspec(func.im_func)
          print(spec)
      elif inspect.isclass(func):
          print("c")
          return get_default_args(func.__init__)
      elif isinstance(func, object):
          print("d")
          # We already know the instance is callable,
          # so it must have a __call__ method defined.
          # Return the arguments it expects.
          return get_default_args(func.__call__)
  
      try:
          return dict(zip(reversed(spec.args), reversed(spec.defaults)))
      except TypeError:
          # list of defaults and/or args are empty
          return {}
  
imports: import collections
  import itertools
  import inspect
label_desc: Use image node_id 3 for calling a global function with example usage: get_default_args(func) and returns: dict, dict, get_default_args, get_default_args