class_docstr: Standalone class that applies Instruction rewrite/filtering rules.
  
  This significantly simplifies subsequent parsing by injecting
  synthetic POLARS_EXPRESSION ops into the Instruction stream for
  easy identification/translation and separates the parsing logic
  from the identification of expression translation opportunities.
class_docstr_tok: ["Standalone","class","that","applies","Instruction","rewrite\/filtering","rules",".","This","significantly","simplifies","subsequent","parsing","by","injecting","synthetic","POLARS_EXPRESSION","ops","into","the","Instruction","stream","for","easy","identification\/translation","and","separates","the","parsing","logic","from","the","identification","of","expression","translation","opportunities","."]
docstr: Check if a sequence of Instructions matches the specified ops/argvals.
  
  Parameters
  ----------
  idx
      The index of the first instruction to check.
  opnames
      The full opname sequence that defines a match.
  argvals
      Associated argvals that must also match (in same position as opnames).
code: def _matches(
      self,
      idx: int,
      *,
      opnames: list[AbstractSet[str]],
      argvals: list[AbstractSet[Any] | dict[Any, Any]] | None,
  ) -> list[Instruction]:
      """
      Check if a sequence of Instructions matches the specified ops/argvals.
  
      Parameters
      ----------
      idx
          The index of the first instruction to check.
      opnames
          The full opname sequence that defines a match.
      argvals
          Associated argvals that must also match (in same position as opnames).
      """
      n_required_ops, argvals = len(opnames), argvals or []
      instructions = self._instructions[idx : idx + n_required_ops]
      if len(instructions) == n_required_ops and all(
          inst.opname in match_opnames
          and (match_argval is None or inst.argval in match_argval)
          for inst, match_opnames, match_argval in zip_longest(
              instructions, opnames, argvals
          )
      ):
          return instructions
      return []
  
imports: from __future__ import annotations
  import datetime
  import dis
  import inspect
  import re
  import sys
  import warnings
  from bisect import bisect_left
  from collections import defaultdict
  from dis import get_instructions
  from inspect import signature
  from itertools import count, zip_longest
  from pathlib import Path
  from typing import TYPE_CHECKING, AbstractSet, Any, Callable, ClassVar, Iterator, Literal, NamedTuple, Union
label_desc: Use image node_id 5 for calling the RewrittenInstructions obj's underlying member method code with example usage: obj._matches(idx) and returns: list, instructions