mirror of
https://github.com/agentscope-ai/ReMe.git
synced 2026-08-28 05:25:04 +00:00
9 lines
213 B
Python
9 lines
213 B
Python
def singleton(cls):
|
|
_instance = {}
|
|
|
|
def _singleton(*args, **kwargs):
|
|
if cls not in _instance:
|
|
_instance[cls] = cls(*args, **kwargs)
|
|
return _instance[cls]
|
|
|
|
return _singleton
|