code: def register(self, cls, instance):
          
          if not issubclass(cls, DropletInterface):
              raise TypeError('Given class is not a NAZInterface subclass: %s'
                              % cls)
  
          if not isinstance(instance, cls):
              raise TypeError('Given instance does not implement the class: %s'
                              % instance)
  
          if instance.name in self.INSTANCES_BY_NAME:
              if self.INSTANCES_BY_NAME[instance.name] != instance:
                  raise ValueError('Given name is registered '
                                   'by other instance: %s' % instance.name)
  
          self.INSTANCES_BY_INTERFACE[cls].add(instance)
          self.INSTANCES_BY_NAME[instance.name] = instance
docs: Register the given instance as implementation for a class interface