def in_list(list_possible_values):
 def validate(key, data, errors, context):
  if (not (data[key] in list_possible_values())):
   raise Invalid('"{0}" is not a valid parameter'.format(data[key]))
 return validate

def in_list ( list_possible_values ) : def validate ( key , data , errors , context ) : if ( not ( data [ key ] in list_possible_values ( ) ) ) : raise Invalid ( '"{0}" is not a valid parameter' . format ( data [ key ] ) ) return validate
validator that checks that the input value is one of the given possible values .