class_docstr: Trim doctest flags like ``# doctest: +FLAG`` from python code-blocks.
  
  see :confval:`trim_doctest_flags` for more information.
code: def is_pyconsole(node: nodes.literal_block) -> bool:
      if node.rawsource != node.astext():
          return False  # skip parsed-literal node
  
      language = node.get("language")
      if language in {"pycon", "pycon3"}:
          return True
      elif language in {"py", "python", "py3", "python3", "default"}:
          return node.rawsource.startswith(">>>")
      elif language == "guess":
          try:
              lexer = guess_lexer(node.rawsource)
              return isinstance(lexer, PythonConsoleLexer)
          except Exception:
              pass
  
      return False
  
imports: from __future__ import annotations
  import sys
  from typing import TYPE_CHECKING, Any, NamedTuple
  from docutils import nodes
  from pygments.lexers import PythonConsoleLexer, guess_lexer
  from sphinx import addnodes
  from sphinx.ext import doctest
  from sphinx.transforms import SphinxTransform
label_desc: Use image node_id 3 for calling the TrimDoctestFlagsTransform obj's underlying member method code with example usage: obj.is_pyconsole(node) and returns: False, False, True, node, isinstance