code: def register(cls, subclass):
          
          if not isinstance(cls, type):
              raise TypeError("Can only register classes")
          if issubclass(subclass, cls):
              return  # Already a subclass
          # Subtle: test for cycles *after* testing for "already a subclass";
          # this means we allow X.register(X) and interpret it as a no-op.
          if issubclass(cls, subclass):
              # This would create a cycle, which is bad for the algorithm below
              raise RuntimeError("Refusing to create an inheritance cycle")
          cls._abc_registry.add(subclass)
          ABCMeta._abc_invalidation_counter += 1
docs: Register a virtual subclass of an ABC.