MCPcopy
hub / github.com/pydata/xarray / _is_last

Function _is_last

xarray/core/datatree_render.py:302–317  ·  view source on GitHub ↗
(iterable: Iterable)

Source from the content-addressed store, hash-verified

300
301
302def _is_last(iterable: Iterable) -> Iterator[tuple[DataTree, bool]]:
303 iter_ = iter(iterable)
304 try:
305 nextitem = next(iter_)
306 except StopIteration:
307 pass
308 else:
309 item = nextitem
310 while True:
311 try:
312 nextitem = next(iter_)
313 yield item, False
314 except StopIteration:
315 yield nextitem, True
316 break
317 item = nextitem

Callers 1

__nextMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…