MCPcopy Create free account
hub / github.com/CL-lau/SQL-GPT / singleton

Function singleton

sql/SQLOperator.py:18–26  ·  view source on GitHub ↗
(cls)

Source from the content-addressed store, hash-verified

16
17
18def singleton(cls):
19 instances = {}
20
21 def wrapper(*args, **kwargs):
22 if cls not in instances:
23 instances[cls] = cls(*args, **kwargs)
24 return instances[cls]
25
26 return wrapper
27
28
29@singleton

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected