def validate_read_preference(dummy, value):
 if (not isinstance(value, _ServerMode)):
  raise TypeError(('%r is not a read preference.' % (value,)))
 return value

def validate_read_preference ( dummy , value ) : if ( not isinstance ( value , _ServerMode ) ) : raise TypeError ( ( '%r is not a read preference.' % ( value , ) ) ) return value
validate a read preference .