code: def extends_doc(extended_func):
      
  
      def decorator(func):
          if not (extended_func.__doc__ is None or func.__doc__ is None):
              func.__doc__ = '\n\n'.join([extended_func.__doc__.rstrip('\n'),
                                          func.__doc__.lstrip('\n')])
          return func
  
      return decorator
docs: A function decorator for use when wrapping an existing function but adding
      additional functionality.  This copies the docstring from the original
      function, and appends to it (along with a newline) the docstring of the
      wrapper function.
  
      Examples
      --------
  
          >>> def foo():
          ...     '''Hello.'''
          ...
          >>> @extends_doc(foo)
          ... def bar():
          ...     '''Goodbye.'''
          ...
          >>> print(bar.__doc__)
          Hello.
  
          Goodbye.