def _check_parser(parser):
 if (parser not in _parsers):
  raise KeyError('Invalid parser {0!r} passed, valid parsers are {1}'.format(parser, _parsers.keys()))

def _check_parser ( parser ) : if ( parser not in _parsers ) : raise KeyError ( 'Invalid parser {0!r} passed, valid parsers are {1}' . format ( parser , _parsers . keys ( ) ) )
make sure a valid parser is passed .