MCPcopy Create free account
hub / github.com/InternScience/SciReason / acquire

Method acquire

opencompass/models/base_api.py:89–98  ·  view source on GitHub ↗

Acquire concurrent resources if exists. This behavior will fall back to wait with query_per_second if there are no concurrent resources.

(self)

Source from the content-addressed store, hash-verified

87 sys.stderr.flush()
88
89 def acquire(self):
90 """Acquire concurrent resources if exists.
91
92 This behavior will fall back to wait with query_per_second if there are
93 no concurrent resources.
94 """
95 if hasattr(self, 'tokens'):
96 self.tokens.acquire()
97 else:
98 self.wait()
99
100 def release(self):
101 """Release concurrent resources if acquired.

Callers 15

submitMethod · 0.80
_generateMethod · 0.80
_generateMethod · 0.80
_generateMethod · 0.80
_generateMethod · 0.80
_generateMethod · 0.80
_generateMethod · 0.80
get_tokenMethod · 0.80
_generateMethod · 0.80
_generateMethod · 0.80
_generateMethod · 0.80
_generateMethod · 0.80

Calls 1

waitMethod · 0.95

Tested by

no test coverage detected