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

Function peek_at

xarray/core/utils.py:282–288  ·  view source on GitHub ↗

Returns the first value from iterable, as well as a new iterator with the same content as the original iterable

(iterable: Iterable[T])

Source from the content-addressed store, hash-verified

280
281
282def peek_at(iterable: Iterable[T]) -> tuple[T, Iterator[T]]:
283 """Returns the first value from iterable, as well as a new iterator with
284 the same content as the original iterable
285 """
286 gen = iter(iterable)
287 peek = next(gen)
288 return peek, itertools.chain([peek], gen)
289
290
291def update_safety_check(

Callers 3

_combineMethod · 0.90
_combineMethod · 0.90
apply_groupby_funcFunction · 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…