parameters: (self, py_class, parser_config)
docstring: Collects information necessary specifically for a class's doc page.
  
      Mainly, this is details about the class's members.
  
      Args:
        py_class: The class object being documented
        parser_config: An instance of ParserConfig.
docstring_summary: Collects information necessary specifically for a class's doc page.
docstring_tokens: Collects information necessary specifically for a class s doc page .
function: def collect_docs_for_class(self, py_class, parser_config):
      """Collects information necessary specifically for a class's doc page.
  
      Mainly, this is details about the class's members.
  
      Args:
        py_class: The class object being documented
        parser_config: An instance of ParserConfig.
      """
      self.set_namedtuplefields(py_class)
      doc_path = documentation_path(self.full_name)
      relative_path = os.path.relpath(
          path='.', start=os.path.dirname(doc_path) or '.')
  
      self._set_bases(relative_path, parser_config)
  
      for short_name in parser_config.tree[self.full_name]:
        # Remove builtin members that we never want to document.
        if short_name in [
            '__class__', '__base__', '__weakref__', '__doc__', '__module__',
            '__dict__', '__abstractmethods__', '__slots__', '__getnewargs__',
            '__str__', '__repr__', '__hash__', '__reduce__'
        ]:
          continue
  
        child_name = '.'.join([self.full_name, short_name])
        child = parser_config.py_name_to_object(child_name)
  
        # Don't document anything that is defined in object or by protobuf.
        defining_class = _get_defining_class(py_class, short_name)
        if defining_class in [object, type, tuple, BaseException, Exception]:
          continue
  
        # The following condition excludes most protobuf-defined symbols.
        if (defining_class and
            defining_class.__name__ in ['CMessage', 'Message', 'MessageMeta']):
          continue
        # TODO(markdaoust): Add a note in child docs showing the defining class.
  
        if doc_controls.should_skip_class_attr(py_class, short_name):
          continue
  
        child_doc = _parse_md_docstring(child, relative_path,
                                        parser_config.reference_resolver)
  
        if isinstance(child, property):
          self._add_property(short_name, child_name, child, child_doc)
  
        elif tf_inspect.isclass(child):
          if defining_class is None:
            continue
          url = parser_config.reference_resolver.reference_to_url(
              child_name, relative_path)
          self._add_class(short_name, child_name, child, child_doc, url)
  
        elif (tf_inspect.ismethod(child) or tf_inspect.isfunction(child) or
              tf_inspect.isroutine(child)):
          if defining_class is None:
            continue
  
          # Omit methods defined by namedtuple.
          original_method = defining_class.__dict__[short_name]
          if (hasattr(original_method, '__module__') and
              (original_method.__module__ or '').startswith('namedtuple')):
            continue
  
          # Some methods are often overridden without documentation. Because it's
          # obvious what they do, don't include them in the docs if there's no
          # docstring.
          if not child_doc.brief.strip() and short_name in [
              '__del__', '__copy__'
          ]:
            continue
  
          try:
            child_signature = _generate_signature(child,
                                                  parser_config.reverse_index)
          except TypeError:
            # If this is a (dynamically created) slot wrapper, tf_inspect will
            # raise typeerror when trying to get to the code. Ignore such
            # functions.
            continue
  
          child_decorators = []
          try:
            if isinstance(py_class.__dict__[short_name], classmethod):
              child_decorators.append('classmethod')
          except KeyError:
            pass
  
          try:
            if isinstance(py_class.__dict__[short_name], staticmethod):
              child_decorators.append('staticmethod')
          except KeyError:
            pass
  
          self._add_method(short_name, child_name, child, child_doc,
                           child_signature, child_decorators)
        else:
          # Exclude members defined by protobuf that are useless
          if issubclass(py_class, ProtoMessage):
            if (short_name.endswith('_FIELD_NUMBER') or
                short_name in ['__slots__', 'DESCRIPTOR']):
              continue
  
          # TODO(wicke): We may want to also remember the object itself.
          self._add_other_member(short_name, child_name, child, child_doc)
function_tokens: def collect_docs_for_class ( self , py_class , parser_config ) : self . set_namedtuplefields ( py_class ) doc_path = documentation_path ( self . full_name ) relative_path = os . path . relpath ( path = '.' , start = os . path . dirname ( doc_path ) or '.' ) self . _set_bases ( relative_path , parser_config ) for short_name in parser_config . tree [ self . full_name ] : # Remove builtin members that we never want to document. if short_name in [ '__class__' , '__base__' , '__weakref__' , '__doc__' , '__module__' , '__dict__' , '__abstractmethods__' , '__slots__' , '__getnewargs__' , '__str__' , '__repr__' , '__hash__' , '__reduce__' ] : continue child_name = '.' . join ( [ self . full_name , short_name ] ) child = parser_config . py_name_to_object ( child_name ) # Don't document anything that is defined in object or by protobuf. defining_class = _get_defining_class ( py_class , short_name ) if defining_class in [ object , type , tuple , BaseException , Exception ] : continue # The following condition excludes most protobuf-defined symbols. if ( defining_class and defining_class . __name__ in [ 'CMessage' , 'Message' , 'MessageMeta' ] ) : continue # TODO(markdaoust): Add a note in child docs showing the defining class. if doc_controls . should_skip_class_attr ( py_class , short_name ) : continue child_doc = _parse_md_docstring ( child , relative_path , parser_config . reference_resolver ) if isinstance ( child , property ) : self . _add_property ( short_name , child_name , child , child_doc ) elif tf_inspect . isclass ( child ) : if defining_class is None : continue url = parser_config . reference_resolver . reference_to_url ( child_name , relative_path ) self . _add_class ( short_name , child_name , child , child_doc , url ) elif ( tf_inspect . ismethod ( child ) or tf_inspect . isfunction ( child ) or tf_inspect . isroutine ( child ) ) : if defining_class is None : continue # Omit methods defined by namedtuple. original_method = defining_class . __dict__ [ short_name ] if ( hasattr ( original_method , '__module__' ) and ( original_method . __module__ or '' ) . startswith ( 'namedtuple' ) ) : continue # Some methods are often overridden without documentation. Because it's # obvious what they do, don't include them in the docs if there's no # docstring. if not child_doc . brief . strip ( ) and short_name in [ '__del__' , '__copy__' ] : continue try : child_signature = _generate_signature ( child , parser_config . reverse_index ) except TypeError : # If this is a (dynamically created) slot wrapper, tf_inspect will # raise typeerror when trying to get to the code. Ignore such # functions. continue child_decorators = [ ] try : if isinstance ( py_class . __dict__ [ short_name ] , classmethod ) : child_decorators . append ( 'classmethod' ) except KeyError : pass try : if isinstance ( py_class . __dict__ [ short_name ] , staticmethod ) : child_decorators . append ( 'staticmethod' ) except KeyError : pass self . _add_method ( short_name , child_name , child , child_doc , child_signature , child_decorators ) else : # Exclude members defined by protobuf that are useless if issubclass ( py_class , ProtoMessage ) : if ( short_name . endswith ( '_FIELD_NUMBER' ) or short_name in [ '__slots__' , 'DESCRIPTOR' ] ) : continue # TODO(wicke): We may want to also remember the object itself. self . _add_other_member ( short_name , child_name , child , child_doc )