def _EncodeCompiledCursor(self, last_result, compiled_cursor):
    """Converts the current state of the cursor into a compiled_cursor.

    Args:
      last_result: the last result returned by this query.
      compiled_cursor: an empty datstore_pb.CompiledCursor.
    """
    if last_result is not None:


      position = compiled_cursor.mutable_postfix_position()


      if '__key__' in self.__cursor_properties:
        position.mutable_key().MergeFrom(last_result.key())
      for prop in last_result.property_list():
        if prop.name() in self.__cursor_properties:
          index_value = position.add_index_value()
          index_value.set_property_name(prop.name())
          index_value.mutable_value().CopyFrom(prop.value())
      position.set_before(False)
      _SetBeforeAscending(position, self.__first_sort_order)
dataset/ETHPy150Open GoogleCloudPlatform/python-compat-runtime/appengine-compat/exported_appengine_sdk/google/appengine/datastore/datastore_stub_util.py/BaseCursor._EncodeCompiledCursor/original