'Rebuild a nested tuple structure.'

def unflatten(self, flatiter):

    vals = deque(flatiter)
    res = []
    cur = res
    stack = []
    for op in self._code:
        if (op is _PUSH_LIST):
            stack.append(cur)
            cur.append([])
            cur = cur[(-1)]
        elif (op is _APPEND_NEXT_VALUE):
            cur.append(vals.popleft())
        elif (op is _APPEND_EMPTY_TUPLE):
            cur.append(())
        elif (op is _POP):
            cur = stack.pop()
    assert (not stack), stack
    assert (not vals), vals
    return res
