def get_all_combinations(node_lists):
    """
    Generate a list of all possible combinations of items in the list of
    lists `node_lists`. Each combination takes one item from each list
    contained within `node_lists`. The order of items in the returned lists
    reflects the order of lists in `node_lists`. For example, if `node_lists` was
    [[A, B, C], [N], [X, Y]], the returned combinations would be
    [[A, N, X], [A, N, Y], [B, N, X], [B, N, Y], [C, N, X], [C, N, Y]].
    """

    items = [[]]
    for node_list in node_lists:
        items = [item + [node] for node in node_list for item in items]

    return items