code: def has_kwargs(function):
      r'''Determine whether a function has \*\*kwargs.
  
      Parameters
      ----------
      function : callable
          The function to test
  
      Returns
      -------
      True if function accepts arbitrary keyword arguments.
      False otherwise.
      '''
  
      if six.PY2:
          return inspect.getargspec(function).keywords is not None
      else:
          sig = inspect.signature(function)
  
          for param in sig.parameters.values():
              if param.kind == param.VAR_KEYWORD:
                  return True
  
          return Falsf has_kwargs(function):
      r'''Determine whether a function has \*\*kwargs.
  
      Parameters
      ----------
      function : callable
          The function to test
  
      Returns
      -------
      True if function accepts arbitrary keyword arguments.
      False otherwise.
      '''
  
      if six.PY2:
          return inspect.getargspec(function).keywords is not None
      else:
          sig = inspect.signature(function)
  
          for param in sig.parameters.values():
              if param.kind == param.VAR_KEYWORD:
                  return True
  
          return False
docs: r'''Determine whether a function has \*\*kwargs.
  
      Parameters
      ----------
      function : callable
          The function to test
  
      Returns
      -------
      True if function accepts arbitrary keyword arguments.
      False otherwise.