code: def refine(self, pivot):
          
          has_split = []                        # remember which classes split
          for i in pivot:
              if 0 <= i < len(self.items):      # ignore if outside of domain
                  x = self.items[i]
                  c = x.theclass                # c = class of x
                  if not c.split:               # possibly create new split class
                      c.split = PartitionClass(c)
                      if self.classes is c:
                          self.classes = c.split   # always make self.classes point to the first class
                      has_split.append(c)
                  x.remove()                    # remove from its class
                  x.theclass = c.split
                  c.split.append(x)             # append to the split class
          for c in has_split:                   # clean information about split classes
              c.split = None
              if not c.items:                   # delete class if it became empty
                  c.remove()
                  del c
docs: Split every class C in the partition into C intersection pivot and C setminus pivot
          complexity: linear in size of pivot