class_docstr: Step through document and build TOC. 
class_docstr_tok: ["Step","through","document","and","build","TOC","."]
docstr: Adjust header level according to base level. 
docstr_tok: ["Adjust","header","level","according","to","base","level","."]
code: def set_level(self, elem: etree.Element) -> None:
      """Adjust header level according to base level."""
      level = int(elem.tag[-1]) + self.base_level
      if level > 6:
          level = 6
      elem.tag = "h%d" % level
  
imports: from __future__ import annotations
  from .None import Extension
  from ..treeprocessors import Treeprocessor
  from ..util import code_escape, parseBoolValue, AMP_SUBSTITUTE, HTML_PLACEHOLDER_RE, AtomicString
  from ..treeprocessors import UnescapeTreeprocessor
  import re
  import html
  import unicodedata
  import xml.etree.ElementTree
  from typing import TYPE_CHECKING, Any, Iterator, MutableSet
label_desc: Use image node_id 4 for calling the TocTreeprocessor obj's underlying member method code with example usage: obj.set_level(elem) without return types