MCPcopy Create free account
hub / github.com/catboost/catboost / __call__

Method __call__

library/python/func/__init__.py:161–171  ·  view source on GitHub ↗
(cls, *args, **kwargs)

Source from the content-addressed store, hash-verified

159 self.lock = lock
160
161 def __call__(cls, *args, **kwargs):
162 if cls not in cls.__instances:
163 with cls.__lock:
164 if cls not in cls.__instances:
165 cls.__instances[cls] = cls._LockedObj(None, threading.Lock())
166
167 if not cls.__instances[cls].obj:
168 with cls.__instances[cls].lock:
169 if not cls.__instances[cls].obj:
170 cls.__instances[cls].obj = super(Singleton, cls).__call__(*args, **kwargs)
171 return cls.__instances[cls].obj
172
173
174def stable_uniq(it):

Callers

nothing calls this directly

Calls 1

LockMethod · 0.45

Tested by

no test coverage detected