import itertools


def is_it_a_partition(all_nodes, partitions):
    """ test if partitions is a partition of all_nodes.
    
    Parameters
    ----------
    * all_nodes : list of nodes
    * partitions : list of list of nodes
    
    Returns
    -------
    True if 'partitions' is a partitions of all_nodes, False otherwise
    """

    for nodes_subset in partitions:
        for node in nodes_subset:
            if node not in all_nodes:
                return False

    for nodes_subset1, nodes_subset2 in itertools.combinations(partitions, 2):
        if len(set.intersection(set(nodes_subset1), set(nodes_subset2))) > 0:
            return False

    s = set()
    for nodes_subset in partitions:
        s = set.union(s, set(nodes_subset))

    if s != set(all_nodes):
        return False

    return True