MCPcopy
hub / github.com/httpie/cli / split_iterable

Function split_iterable

httpie/utils.py:248–255  ·  view source on GitHub ↗
(iterable: Iterable[T], key: Callable[[T], bool])

Source from the content-addressed store, hash-verified

246
247
248def split_iterable(iterable: Iterable[T], key: Callable[[T], bool]) -> Tuple[List[T], List[T]]:
249 left, right = [], []
250 for item in iterable:
251 if key(item):
252 left.append(item)
253 else:
254 right.append(item)
255 return left, right
256
257
258def unwrap_context(exc: Exception) -> Optional[Exception]:

Callers 1

from_argsMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected