code: def _check_out_arg(func):
      
      if sys.version_info.major > 2:
          spec = inspect.getfullargspec(func)
          kw_only = spec.kwonlyargs
      else:
          spec = inspect.getargspec(func)
          kw_only = ()
  
      if spec.varargs is not None:
          raise TypeError('*args not allowed in function signature')
  
      pos_args = spec.args
      pos_defaults = () if spec.defaults is None else spec.defaults
  
      has_out = 'out' in pos_args or 'out' in kw_only
      if 'out' in pos_args:
          has_out = True
          out_is_optional = (
              pos_args.index('out') >= len(pos_args) - len(pos_defaults))
      elif 'out' in kw_only:
          has_out = out_is_optional = True
      else:
          has_out = out_is_optional = False
  
      return has_out, out_is_optional
docs: Check if ``func`` has an (optional) ``out`` argument.
  
      Also verify that the signature of ``func`` has no ``*args`` since
      they make argument propagation a hassle.
  
      Parameters
      ----------
      func : callable
          Object that should be inspected.
  
      Returns
      -------
      has_out : bool
          ``True`` if the signature has an ``out`` argument, ``False``
          otherwise.
      out_is_optional : bool
          ``True`` if ``out`` is present and optional in the signature,
          ``False`` otherwise.
  
      Raises
      ------
      TypeError
          If ``func``'s signature has ``*args``.