code: def singleton(cls):
      """Decorate a class as singleton.
  
      Inspired by: https://wiki.python.org/moin/PythonDecoratorLibrary#Singleton
      """
  
      cls.__new_original__ = cls.__new__
  
      @wraps(cls.__new__)
      def singleton_new(cls, *args, **kw):
          it = cls.__dict__.get("__it__")
          if it is not None:
              return it
  
          cls.__it__ = it = cls.__new_original__(cls, *args, **kw)
          it.__init_original__(*args, **kw)
          return it
  
      cls.__new__ = staticmethod(singleton_new)
      cls.__init_original__ = cls.__init__
      cls.__init__ = object.__init__
  
      return cls
  
label_desc: Use image node_id 1 for calling a global function with example usage: singleton(cls) and returns: cls, it, it