def strict_parse_args(parser, raw_args):
 args = parser.parse_args()
 unexpected_params = (set(raw_args) - {allowed_arg.name for allowed_arg in parser.args})
 if unexpected_params:
  raise InputError('Unexpected query parameters {}'.format(unexpected_params))
 return args

def strict_parse_args ( parser , raw_args ) : args = parser . parse_args ( ) unexpected_params = ( set ( raw_args ) - { allowed_arg . name for allowed_arg in parser . args } ) if unexpected_params : raise InputError ( 'Unexpected query parameters {}' . format ( unexpected_params ) ) return args
wrapper around parser .