code: def clean_astext(node: Element) -> str:
      """Like node.astext(), but ignore images."""
      node = node.deepcopy()
      for img in node.findall(nodes.image):
          img["alt"] = ""
      for raw in list(node.findall(nodes.raw)):
          raw.parent.remove(raw)
      return node.astext()
  
imports: from __future__ import annotations
  import contextlib
  import re
  import unicodedata
  from typing import TYPE_CHECKING, Any, Callable
  from docutils import nodes
  from sphinx import addnodes
  from sphinx.locale import __
  from sphinx.util import logging
label_desc: Use image node_id 12 for calling a global function with example usage: clean_astext(node) and returns: node