def get_window_context(idx, tree, size):
    """Return a list of words within a 2*size window around the idx position."""
    return [node.token for node in
            tree[max(0, idx-size) : idx] + tree[idx+1 : idx+size+1]]