def _FromStorageEntity(entity):
  """Converts a stored entity protobuf to an EntityRecord (with metadata).

  This function is only provided as convenience for storage implementations that
  wish to store metadata directly on EntityProto.

  Args:
    entity: An Entity protobuf.

  Returns:
    The EntityRecord including the EntityMetadata protobuf that was stored as a
    property on the Entity protobuf or an empty EntityMetadata if that Entity
    has no metadata property.
  """
  clone = entity_pb.EntityProto()
  clone.CopyFrom(entity)
  metadata = entity_pb.EntityMetadata()
  for i in xrange(1 - clone.property_size(), -1, -1):
    property = clone.property(i)
    if _METADATA_PROPERTY_NAME == property.name():
      del clone.property_list()[i]
      metadata = entity_pb.EntityMetadata(property.value().stringvalue())
  return EntityRecord(clone, metadata)
dataset/ETHPy150Open GoogleCloudPlatform/python-compat-runtime/appengine-compat/exported_appengine_sdk/google/appengine/datastore/datastore_stub_util.py/_FromStorageEntity/swapped operands of `-`