def CmpProperties(self, that):

      if not self.__entity:
        return cmp(self.__entity, that.__entity)


      for (identifier, order) in self.__orderings:

        value1 = self.__GetValueForId(self, identifier, order)
        value2 = self.__GetValueForId(that, identifier, order)

        result = cmp(value1, value2)
        if order == Query.DESCENDING:
          result = -result
        if result:
          return result
      return 0
Compare two entities and return their relative order.
dataset/ETHPy150Open AppScale/appscale/AppServer/google/appengine/api/datastore.py/MultiQuery.SortOrderEntity.CmpProperties