def CheckPropertyValue(name, value, max_length, meaning):
  """Check if this property value can be stored.

  Args:
    name: name of the property
    value: entity_pb.PropertyValue
    max_length: maximum length for string values
    meaning: meaning of the property

  Raises:
    apiproxy_errors.ApplicationError: if the property is invalid
  """
  num_values = (value.has_int64value() +
                value.has_stringvalue() +
                value.has_booleanvalue() +
                value.has_doublevalue() +
                value.has_pointvalue() +
                value.has_uservalue() +
                value.has_referencevalue())
  Check(num_values <= 1, 'PropertyValue for ' + name +
        ' has multiple value fields set')

  if value.has_stringvalue():
    s = value.stringvalue()
    if isinstance(s, unicode):
      s = s.encode('utf-8')
    Check(len(s) <= max_length,
          'Property %s is too long. Maximum length is %d.' % (name, max_length))
    if (_BLOB_MEANINGS not in meaning and
        meaning != entity_pb.Property.BYTESTRING):
      CheckValidUTF8(value.stringvalue(), 'String property "%s" value' % name)
dataset/ETHPy150Open GoogleCloudPlatform/python-compat-runtime/appengine-compat/exported_appengine_sdk/google/appengine/datastore/datastore_stub_util.py/CheckPropertyValue/swapped operands of `not in`