def _check_parser(parser):
    """Make sure a valid parser is passed.

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

    Raises
    ------
    KeyError
      * If an invalid parser is passed
    """
    from pandas.core.computation.expr import _parsers

    if parser not in _parsers:
        raise KeyError('Invalid parser {parser!r} passed, valid parsers are'
                       ' {valid}'.format(parser=parser, valid=_parsers.keys()))
def _check_parser ( parser ) : from pandas . core . computation . expr import _parsers if parser not in _parsers : raise KeyError ( 'Invalid parser {parser!r} passed, valid parsers are' ' {valid}' . format ( parser = parser , valid = _parsers . keys ( ) ) )
Make sure a valid parser is passed.

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

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