MCPcopy
hub / github.com/microsoft/qlib / get

Method get

qlib/rl/utils/data_queue.py:113–126  ·  view source on GitHub ↗
(self, block: bool = True)

Source from the content-addressed store, hash-verified

111 _logger.debug(f"Remaining items in queue collection done. Empty: {self._queue.empty()}")
112
113 def get(self, block: bool = True) -> Any:
114 if not hasattr(self, "_first_get"):
115 self._first_get = True
116 if self._first_get:
117 timeout = 5.0
118 self._first_get = False
119 else:
120 timeout = 0.5
121 while True:
122 try:
123 return self._queue.get(block=block, timeout=timeout)
124 except Empty:
125 if self._done.value:
126 raise StopIteration # pylint: disable=raise-missing-from
127
128 def put(self, obj: Any, block: bool = True, timeout: int | None = None) -> None:
129 self._queue.put(obj, block=block, timeout=timeout)

Callers 15

_consumerMethod · 0.95
indicator_analysisFunction · 0.45
backtest_dailyFunction · 0.45
__init__Method · 0.45
__init__Method · 0.45
__init__Method · 0.45
__init__Method · 0.45
setup_spaceMethod · 0.45
__init__Method · 0.45

Calls

no outgoing calls

Tested by 1