MCPcopy Create free account
hub / github.com/Project-MONAI/MONAI / __iter__

Method __iter__

monai/utils/profiling.py:340–354  ·  view source on GitHub ↗
(_self)

Source from the content-addressed store, hash-verified

338 class _Iterable:
339
340 def __iter__(_self): # noqa: N805 pylint: disable=E0213
341 do_iter = True
342 orig_iter = iter(iterable)
343 caller = getframeinfo(stack()[1][0])
344
345 while do_iter:
346 try:
347 start = perf_counter_ns()
348 item = next(orig_iter)
349 diff = perf_counter_ns() - start
350 # don't put result when StopIteration is hit
351 self._put_result(name, diff, caller.filename, caller.lineno)
352 yield item
353 except StopIteration:
354 do_iter = False
355
356 return _Iterable()
357

Callers

nothing calls this directly

Calls 2

stackFunction · 0.85
_put_resultMethod · 0.80

Tested by

no test coverage detected