class_docstr: Convenient base class for a singleton.
  
  It saves having to implement __eq__ and __hash__.
class_docstr_tok: ["Convenient","base","class","for","a","singleton",".","It","saves","having","to","implement","__eq__","and","__hash__","."]
code: def __new__(cls):
      # If sub-subclass of SingletonType don't redeclare __instance
      # when we look for it, we will find it in the subclass.  We
      # don't want that, so we check the class.  When we add one, we
      # add one only to the current class, so all is working
      # correctly.
      if cls.__instance is None or not isinstance(cls.__instance, cls):
          cls.__instance = super().__new__(cls)
      return cls.__instance
  
imports: import hashlib
  import logging
  import os
  import struct
  import subprocess
  import sys
  from collections import OrderedDict
  from collections.abc import Callable
  from functools import partial
label_desc: Use image node_id 1 for calling the Singleton obj's underlying member method code with example usage: obj.__new__(cls) and returns: cls