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

Function singleton

embedding/embeddingHelper.py:40–48  ·  view source on GitHub ↗
(cls)

Source from the content-addressed store, hash-verified

38
39
40def singleton(cls):
41 instances = {}
42
43 def wrapper(*args, **kwargs):
44 if cls not in instances:
45 instances[cls] = cls(*args, **kwargs)
46 return instances[cls]
47
48 return wrapper
49
50
51class Singleton(type):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected