mirror of
https://github.com/agentscope-ai/ReMe.git
synced 2026-09-06 08:16:00 +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
|