'Gets the cursor that points just after the result at index - 1.
The index is relative to first result in .results. Since start_cursor
points to the position before the first skipped result, the range of
indexes this function supports is limited to
[-skipped_results, len(results)].
For example, using start_cursor=batch.cursor(i) and
end_cursor=batch.cursor(j) will return the results found in
batch.results[i:j]. Note that any result added in the range (i-1, j]
will appear in the new query\'s results.
Warning: Any index in the range (-skipped_results, 0) may cause
continuation to miss or duplicate results if outside a transaction.
Args:
index: An int, the index relative to the first result before which the
cursor should point.
Returns:
A Cursor that points to a position just after the result index - 1,
which if used as a start_cursor will cause the first result to be
batch.result[index].'

def cursor(self, index):

    if (not isinstance(index, (int, long))):
        raise datastore_errors.BadArgumentError(('index    argument    should    be    entity_pb.Reference    (%r)' % (index,)))
    if (not ((- self._skipped_results) <= index <= len(self.__results))):
        raise datastore_errors.BadArgumentError(('index    argument    must    be    in    the    inclusive    range    [%d,    %d]' % ((- self._skipped_results), len(self.__results))))
    if (index == (- self._skipped_results)):
        return self.__start_cursor
    elif ((index == 0) and self.__skipped_cursor):
        return self.__skipped_cursor
    elif ((index > 0) and self.__result_cursors):
        return self.__result_cursors[(index - 1)]
    elif (index == len(self.__results)):
        return self.__end_cursor
    else:
        return self.__start_cursor.advance((index + self._skipped_results), self._batch_shared.query, self._batch_shared.conn)
