class_docstr: Main Classifier object, used to classify things into similar sets.
docstr: Add a set to the classifier.  Any iterable is accepted.
code: def add(self, set_of_things):
      """
      Add a set to the classifier.  Any iterable is accepted.
      """
      if not set_of_things:
          return
  
      self._dirty = True
  
      things, sets, mapping = self._things, self._sets, self._mapping
  
      s = set(set_of_things)
      intersection = s.intersection(things)  # existing things
      s.difference_update(intersection)  # new things
      difference = s
      del s
  
      # Add new class for new things
      if difference:
          things.update(difference)
          sets.append(difference)
          for thing in difference:
              mapping[thing] = difference
      del difference
  
      while intersection:
          # Take one item and process the old class it belongs to
          old_class = mapping[next(iter(intersection))]
          old_class_intersection = old_class.intersection(intersection)
  
          # Update old class to remove items from new set
          old_class.difference_update(old_class_intersection)
  
          # Remove processed items from todo list
          intersection.difference_update(old_class_intersection)
  
          # Add new class for the intersection with old class
          sets.append(old_class_intersection)
          for thing in old_class_intersection:
              mapping[thing] = old_class_intersection
          del old_class_intersection
  
file_path: catboost/contrib/python/fonttools/fontTools/misc/classifyTools.py
label_desc: Use image node_id 2 for calling the Classifier obj's underlying member method code with example usage: obj.add(set_of_things) without return types