def ValidateProperty(name, values, read_only=False):
 ValidateString(name, 'property name', datastore_errors.BadPropertyError)
 values_type = type(values)
 if (values_type is tuple):
  raise datastore_errors.BadValueError(('May not use tuple property value; property %s is %s.' % (name, repr(values))))
 if (values_type is not list):
  values = [values]
 if (not values):
  raise datastore_errors.BadValueError(('May not use the empty list as a property value; property %s is %s.' % (name, repr(values))))
 try:
  for v in values:
   prop_validator = _VALIDATE_PROPERTY_VALUES.get(v.__class__)
   if (prop_validator is None):
    raise datastore_errors.BadValueError(('Unsupported type for property %s: %s' % (name, v.__class__)))
   prop_validator(name, v)
 except (KeyError, ValueError, TypeError, IndexError, AttributeError) as msg:
  raise datastore_errors.BadValueError(('Error type checking values for property %s: %s' % (name, msg)))

def ValidateProperty ( name , values , read_only = False ) : ValidateString ( name , 'property name' , datastore_errors . BadPropertyError ) values_type = type ( values ) if ( values_type is tuple ) : raise datastore_errors . BadValueError ( ( 'May not use tuple property value; property %s is %s.' % ( name , repr ( values ) ) ) ) if ( values_type is not list ) : values = [ values ] if ( not values ) : raise datastore_errors . BadValueError ( ( 'May not use the empty list as a property value; property %s is %s.' % ( name , repr ( values ) ) ) ) try : for v in values : prop_validator = _VALIDATE_PROPERTY_VALUES . get ( v . __class__ ) if ( prop_validator is None ) : raise datastore_errors . BadValueError ( ( 'Unsupported type for property %s: %s' % ( name , v . __class__ ) ) ) prop_validator ( name , v ) except ( KeyError , ValueError , TypeError , IndexError , AttributeError ) as msg : raise datastore_errors . BadValueError ( ( 'Error type checking values for property %s: %s' % ( name , msg ) ) )
helper function for validating property values .