code: def sets(self):
          
          sets = {}
          for x in self._parents:
              sets.setdefault(self[x], set()).add(x)
          return frozenset(frozenset(v) for v in six.viewvalues(sets))
docs: Returns the equivalence classes as a set of sets.