class_docstr: Mapping bytecode to ast-node based on the source positions, which where introduced in pyhon 3.11.
  In general every ast-node can be exactly referenced by its begin/end line/col_offset, which is stored in the bytecode.
  There are only some exceptions for methods and attributes.
code: def test_for_decorator(self, node: EnhancedAST, index: int) -> None:
      if (
          isinstance(node.parent, (ast.ClassDef, function_node_types))
          and node in node.parent.decorator_list  # type: ignore[attr-defined]
      ):
          node_func = node.parent
  
          while True:
              # the generated bytecode looks like follow:
  
              # index    opname
              # ------------------
              # index-4  PRECALL     (only in 3.11)
              # index-2  CACHE
              # index    CALL        <- the call instruction
              # ...      CACHE       some CACHE instructions
  
              # maybe multiple other bytecode blocks for other decorators
              # index-4  PRECALL     (only in 3.11)
              # index-2  CACHE
              # index    CALL        <- index of the next loop
              # ...      CACHE       some CACHE instructions
  
              # index+x  STORE_*     the ast-node of this instruction points to the decorated thing
  
              if not (
                  (
                      self.opname(index - 4) == "PRECALL"
                      or sys.version_info >= (3, 12)
                  )
                  and self.opname(index) == "CALL"
              ):  # pragma: no mutate
                  break  # pragma: no mutate
  
              index += 2
  
              while self.opname(index) in ("CACHE", "EXTENDED_ARG"):
                  index += 2
  
              if (
                  self.opname(index).startswith("STORE_")
                  and self.find_node(index) == node_func
              ):
                  self.result = node_func
                  self.decorator = node
                  return
  
              if sys.version_info < (3, 12):
                  index += 4
  
imports: import ast
  import sys
  import dis
  from types import CodeType, FrameType
  from typing import Any, Callable, Iterator, Optional, Sequence, Set, Tuple, Type, Union, cast
  from .executing import EnhancedAST, NotOneValueFound, Source, only, function_node_types, assert_
  from ._exceptions import KnownIssue, VerifierFailure
  from functools import lru_cache
label_desc: Use image node_id 2 for calling the PositionNodeFinder obj's underlying member method code with example usage: obj.test_for_decorator(node, index) without return types