def _unpickle_context(cls, ctx_id, now, node_states, shift_sets):
    node = cython.declare(MDFNode)
    node_state = cython.declare(NodeState)

    root = cls(now)

    # mapping of old ctx ids to new ids
    ctx_id_fixup = {ctx_id : root.get_id()}
    all_ctxs = {ctx_id : root}

    for shifted_ctx_id, shift_set in shift_sets:
        shifted_ctx = root.shift(shift_set)
        ctx_id_fixup[shifted_ctx_id] = shifted_ctx.get_id()
        all_ctxs[shifted_ctx_id] = shifted_ctx

    # get the node states and fixup the ctx id references
    for ctx_id, node, wrapper in node_states:
        node_state = wrapper.node_state
        node_state.ctx_id = ctx_id_fixup[node_state.ctx_id]

        if wrapper.alt_context_id in all_ctxs:
            node_state.alt_context = all_ctxs[wrapper.alt_context_id]

        if wrapper.prev_alt_context_id in all_ctxs:
            node_state.prev_alt_context = all_ctxs[wrapper.prev_alt_context_id]

        node_state_callers = node_state.callers
        node_state.callers = {}
        for caller_ctx_id, callers in node_state_callers.iteritems():
            new_caller_ctx_id = ctx_id_fixup[caller_ctx_id]
            node_state.callers[new_caller_ctx_id] = callers

        node_state_callees = node_state.callees
        node_state.callees = {}
        for callee_ctx_id, callees in node_state_callees.iteritems():
            new_callee_ctx_id = ctx_id_fixup[callee_ctx_id]
            node_state.callees[new_callee_ctx_id] = callees

        new_ctx_id = ctx_id_fixup[ctx_id]
        node._states[new_ctx_id] = node_state

    return root
Requests the next 'page' of results in the feed.
dataset/ETHPy150Open manahl/mdf/mdf/ctx_pickle.py/_unpickle_context--crossover with--dataset/ETHPy150Open acil-bwh/SlicerCIP/Scripted/attic/PicasaSnap/gdata/service.py/GDataService.GetNext