def _check_valid(key, val, valid):
 if (val not in valid):
  raise ValueError(('%s must be one of %s, not "%s"' % (key, valid, val)))

def _check_valid ( key , val , valid ) : if ( val not in valid ) : raise ValueError ( ( '%s must be one of %s, not "%s"' % ( key , valid , val ) ) )
helper to check valid options .