parameters: (obj, oname='')
docstring: Wrapper around inspect.getsource.
  
      This can be modified by other projects to provide customized source
      extraction.
  
      Parameters
      ----------
      obj : object
          an object whose source code we will attempt to extract
      oname : str
          (optional) a name under which the object is known
  
      Returns
      -------
      src : unicode or None
docstring_summary: Wrapper around inspect.getsource.
docstring_tokens: Wrapper around inspect . getsource .
function: def getsource(obj, oname='') -> Union[str,None]:
      """Wrapper around inspect.getsource.
  
      This can be modified by other projects to provide customized source
      extraction.
  
      Parameters
      ----------
      obj : object
          an object whose source code we will attempt to extract
      oname : str
          (optional) a name under which the object is known
  
      Returns
      -------
      src : unicode or None
  
      """
  
      if isinstance(obj, property):
          sources = []
          for attrname in ['fget', 'fset', 'fdel']:
              fn = getattr(obj, attrname)
              if fn is not None:
                  encoding = get_encoding(fn)
                  oname_prefix = ('%s.' % oname) if oname else ''
                  sources.append(''.join(('# ', oname_prefix, attrname)))
                  if inspect.isfunction(fn):
                      sources.append(dedent(getsource(fn)))
                  else:
                      # Default str/repr only prints function name,
                      # pretty.pretty prints module name too.
                      sources.append(
                          '%s%s = %s\n' % (oname_prefix, attrname, pretty(fn))
                      )
          if sources:
              return '\n'.join(sources)
          else:
              return None
  
      else:
          # Get source for non-property objects.
  
          obj = _get_wrapped(obj)
  
          try:
              src = inspect.getsource(obj)
          except TypeError:
              # The object itself provided no meaningful source, try looking for
              # its class definition instead.
              try:
                  src = inspect.getsource(obj.__class__)
              except (OSError, TypeError):
                  return None
          except OSError:
              return None
  
          return src
function_tokens: def getsource ( obj , oname = '' ) -> Union [ str , None ] : if isinstance ( obj , property ) : sources = [ ] for attrname in [ 'fget' , 'fset' , 'fdel' ] : fn = getattr ( obj , attrname ) if fn is not None : encoding = get_encoding ( fn ) oname_prefix = ( '%s.' % oname ) if oname else '' sources . append ( '' . join ( ( '# ' , oname_prefix , attrname ) ) ) if inspect . isfunction ( fn ) : sources . append ( dedent ( getsource ( fn ) ) ) else : # Default str/repr only prints function name, # pretty.pretty prints module name too. sources . append ( '%s%s = %s\n' % ( oname_prefix , attrname , pretty ( fn ) ) ) if sources : return '\n' . join ( sources ) else : return None else : # Get source for non-property objects. obj = _get_wrapped ( obj ) try : src = inspect . getsource ( obj ) except TypeError : # The object itself provided no meaningful source, try looking for # its class definition instead. try : src = inspect . getsource ( obj . __class__ ) except ( OSError , TypeError ) : return None except OSError : return None return src