return list(set(newIntersections))

def all_intersections(lists):
    sets = allIntersections([frozenset(s) for s in lists])
return [list(s) for s in sets]
How to get all intersections of sets in python fast