class_docstr: A threadsafe singleton meta-class.
code: def __call__(cls, *args, **kwargs):
      with Singleton._singleton_lock:
          if cls not in cls._instances:
              cls._instances[cls] = super(Singleton, cls).__call__(
                  *args, **kwargs
              )
          return cls._instances[cls]
  
file_path: magenta/magenta/common/concurrency.py
imports: import functools
  import threading
  import time
label_desc: Use image node_id 1 for calling the Singleton obj's underlying member method code with example usage: obj.__call__(cls) and returns: cls