parameters: (self, func, *args, **kwargs)
return_statement: return newfunc
docstring: Decorator call.  Refer to ``decorate``.
docstring_summary: Decorator call.  Refer to ``decorate``.
docstring_tokens: Decorator call . Refer to decorate .
function: def __call__(self, func, *args, **kwargs):
          """
          Decorator call.  Refer to ``decorate``.
  
          """
          old_name = self.old_name
          new_name = self.new_name
          message = self.message
  
          if old_name is None:
              try:
                  old_name = func.__name__
              except AttributeError:
                  old_name = func.__name__
          if new_name is None:
              depdoc = "`%s` is deprecated!" % old_name
          else:
              depdoc = "`%s` is deprecated, use `%s` instead!" % \
                       (old_name, new_name)
  
          if message is not None:
              depdoc += "\n" + message
  
          def newfunc(*args,**kwds):
              """`arrayrange` is deprecated, use `arange` instead!"""
              warnings.warn(depdoc, DeprecationWarning, stacklevel=2)
              return func(*args, **kwds)
  
          newfunc = _set_function_name(newfunc, old_name)
          doc = func.__doc__
          if doc is None:
              doc = depdoc
          else:
              lines = doc.expandtabs().split('\n')
              indent = _get_indent(lines[1:])
              if lines[0].lstrip():
                  # Indent the original first line to let inspect.cleandoc()
                  # dedent the docstring despite the deprecation notice.
                  doc = indent * ' ' + doc
              else:
                  # Remove the same leading blank lines as cleandoc() would.
                  skip = len(lines[0]) + 1
                  for line in lines[1:]:
                      if len(line) > indent:
                          break
                      skip += len(line) + 1
                  doc = doc[skip:]
              depdoc = textwrap.indent(depdoc, ' ' * indent)
              doc = '\n\n'.join([depdoc, doc])
          newfunc.__doc__ = doc
          try:
              d = func.__dict__
          except AttributeError:
              pass
          else:
              newfunc.__dict__.update(d)
          return newfunc
function_tokens: def __call__ ( self , func , * args , * * kwargs ) : old_name = self . old_name new_name = self . new_name message = self . message if old_name is None : try : old_name = func . __name__ except AttributeError : old_name = func . __name__ if new_name is None : depdoc = "`%s` is deprecated!" % old_name else : depdoc = "`%s` is deprecated, use `%s` instead!" % ( old_name , new_name ) if message is not None : depdoc += "\n" + message def newfunc ( * args , * * kwds ) : """`arrayrange` is deprecated, use `arange` instead!""" warnings . warn ( depdoc , DeprecationWarning , stacklevel = 2 ) return func ( * args , * * kwds ) newfunc = _set_function_name ( newfunc , old_name ) doc = func . __doc__ if doc is None : doc = depdoc else : lines = doc . expandtabs ( ) . split ( '\n' ) indent = _get_indent ( lines [ 1 : ] ) if lines [ 0 ] . lstrip ( ) : # Indent the original first line to let inspect.cleandoc() # dedent the docstring despite the deprecation notice. doc = indent * ' ' + doc else : # Remove the same leading blank lines as cleandoc() would. skip = len ( lines [ 0 ] ) + 1 for line in lines [ 1 : ] : if len ( line ) > indent : break skip += len ( line ) + 1 doc = doc [ skip : ] depdoc = textwrap . indent ( depdoc , ' ' * indent ) doc = '\n\n' . join ( [ depdoc , doc ] ) newfunc . __doc__ = doc try : d = func . __dict__ except AttributeError : pass else : newfunc . __dict__ . update ( d ) return newfunc