code: def findHierarchy(self, max_subs=10):
          
          hierarchy = []
          defaults = TOC.default_hierarchy + tuple(
              '%ssection' % ('sub'*i) for i in range(2, max_subs))
          for level in defaults:
              if getattr(self.source, level, False):
                  hierarchy.append(level)
          return tuple(hierarchy)
docs: Find hierarchy for the LaTeX source.
  
          >>> TOC.fromLatex(r'\subsection{yo}\section{hello}').findHierarchy()
          ('section', 'subsection')
          >>> TOC.fromLatex(
          ... r'\subsubsubsection{huh}\subsubsection{hah}').findHierarchy()
          ('subsubsection', 'subsubsubsection')
          >>> TOC.fromLatex('\section{h1}\subsection{subh1}\section{h2}\
          ... \subsection{subh2}').findHierarchy()
          ('section', 'subsection')