code: def _check_parser(parser: str) -> None:
      """
      Make sure a valid parser is passed.
  
      Parameters
      ----------
      parser : str
  
      Raises
      ------
      KeyError
        * If an invalid parser is passed
      """
      if parser not in PARSERS:
          raise KeyError(
              f"Invalid parser '{parser}' passed, valid parsers are {PARSERS.keys()}"
          )
  
file_path: pandas/pandas/core/computation/eval.py
imports: from __future__ import annotations
  import tokenize
  from typing import TYPE_CHECKING, Any
  import warnings
  from pandas.util._exceptions import find_stack_level
  from pandas.util._validators import validate_bool_kwarg
  from pandas.core.dtypes.common import is_extension_array_dtype
  from pandas.core.computation.engines import ENGINES
  from pandas.core.computation.expr import PARSERS, Expr
  from pandas.core.computation.parsing import tokenize_string
  from pandas.core.computation.scope import ensure_scope
  from pandas.core.generic import NDFrame
  from pandas.io.formats.printing import pprint_thing
label_desc: Use image node_id 2 for calling a global function with example usage: _check_parser(parser) without return types