code: def get_default_arguments(func):
      # Retrieves the defaults arguments (names and values) of a function.
      if six.PY2:
          # Python 2
          spec = inspect.getargspec(func)
          if spec.defaults is not None:
              n = len(spec.defaults)
              for name, default_value in zip(
                  spec.args[-n:], spec.defaults
              ):
                  yield name, default_value
      else:
          # Python 3
          signature = inspect.signature(func)
          for name, param in signature.parameters.items():
              if param.default is not inspect.Parameter.empty:
                  yield name, param.default
  
file_path: chainer/tests/chainer_tests/test_chainer_objects.py
imports: import importlib
  import inspect
  import pkgutil
  import types
  import unittest
  import six
  import chainer
  from chainer import testing
label_desc: Use image node_id 4 for calling a global function with example usage: get_default_arguments(func) without return types