stages.text.io.writer.utils#

Module Contents#

Functions#

batched

Batch an iterable into lists of size n.

get_deterministic_hash

Create a deterministic hash from inputs.

API#

stages.text.io.writer.utils.batched(
iterable: collections.abc.Iterable[Any],
n: int,
) collections.abc.Iterator[tuple[Any, ...]]#

Batch an iterable into lists of size n.

Args: iterable (Iterable[Any]): The iterable to batch n (int): The size of the batch

Returns: Iterator[tuple[…]]: An iterator of tuples, each containing n elements from the iterable

stages.text.io.writer.utils.get_deterministic_hash(inputs: list[str], seed: str = '') str#

Create a deterministic hash from inputs.