def _check_parser(parser):
from pandas.core.computation.expr import _parsers<EOL>if parser not in _parsers:<EOL><INDENT>raise KeyError('<STR_LIT>'<EOL>'<STR_LIT>'.format(parser=parser, valid=_parsers.keys()))<EOL><DEDENT>
Make sure a valid parser is passed.

    Parameters
    ----------
    parser : str

    Raises
    ------
    KeyError
      * If an invalid parser is passed