def validate_choice(value, choices):
 if ((choices is not None) and (value not in choices)):
  names = u', '.join((repr(c) for c in choices))
  raise ValueError((u'must be one of %s, not %s.' % (names, value)))

def validate_choice ( value , choices ) : if ( ( choices is not None ) and ( value not in choices ) ) : names = u', ' . join ( ( repr ( c ) for c in choices ) ) raise ValueError ( ( u'must be one of %s, not %s.' % ( names , value ) ) )
validate that value is one of the choices normally called in :meth:~mopidy .