code: def run(self, root: etree.Element) -> etree.Element:
      for el in root:
          if el.tag == "h1":
              # Drop anchorlink from the element, if present.
              if (
                  len(el) > 0
                  and el[-1].tag == "a"
                  and not (el[-1].tail or "").strip()
              ):
                  el = copy.copy(el)
                  del el[-1]
              # Extract the text only, recursively.
              title = "".join(el.itertext())
              # Unescape per Markdown implementation details.
              for pp in self.postprocessors:
                  title = pp.run(title)
              self.title = title
          break
      return root
  
imports: from __future__ import annotations
  import copy
  import enum
  import logging
  import posixpath
  import warnings
  from typing import TYPE_CHECKING, Any, Callable, Iterator, MutableMapping, Sequence
  from urllib.parse import unquote
  from urllib.parse import urljoin, urlsplit, urlunsplit
  import markdown
  import markdown.htmlparser
  import markdown.postprocessors
  import markdown.treeprocessors
  from markdown.util import AMP_SUBSTITUTE
  from mkdocs import utils
  from mkdocs.structure import StructureItem
  from mkdocs.structure.toc import get_toc
  from mkdocs.utils import _removesuffix, get_build_date, get_markdown_title, meta, weak_property
label_desc: Use image node_id 1 for calling the _ExtractTitleTreeprocessor obj's underlying member method code with example usage: obj.run(root) and returns: root