def _validate(self, value):
    if not isinstance(value, str):
      raise datastore_errors.BadValueError('Expected str, got %r' %
                                           (value,))
    if (self._indexed or
        not isinstance(self, TextProperty) and
        len(value) > _MAX_STRING_LENGTH):
      raise datastore_errors.BadValueError(
          'Indexed value %s must be at most %d bytes' %
          (self._name, _MAX_STRING_LENGTH))
dataset/ETHPy150Open GoogleCloudPlatform/datastore-ndb-python/ndb/model.py/BlobProperty._validate/operator `and` -> `or`