code: 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()))
docs: Make sure a valid parser is passed.
  
      Parameters
      ----------
      parser : str
  
      Raises
      ------
      KeyError
        * If an invalid parser is passed