hashiruAI / src /manager /utils /singleton.py
helloparthshah's picture
refactor
2f85c93
raw
history blame contribute delete
182 Bytes
def singleton(cls):
instances = {}
def getinstance():
if cls not in instances:
instances[cls] = cls()
return instances[cls]
return getinstance