text: from abc import ABC
  
  
  class Singleton(object):
      _instance = None
  
      def __new__(cls, *args, **kwargs):
          if not isinstance(cls._instance, cls):
              cls._instance = object.__new__(cls, *args, **kwargs)
          return cls._instance
  
  
  def singleton(real_cls):
      class SingletonFactory(ABC):
          instance = None
  
          def __new__(cls, *args, **kwargs):
              if not cls.instance:
                  cls.instance = real_cls(*args, **kwargs)
              return cls.instance
  
          @classmethod
          def register(cls, real_cls):
              pass
  
      SingletonFactory.register(real_cls)
      return SingletonFactory
  
  