stages.text.io.writer.utils#
Module Contents#
Functions#
Batch an iterable into lists of size n. |
|
Create a deterministic hash from inputs. |
API#
- stages.text.io.writer.utils.batched(
- iterable: collections.abc.Iterable[Any],
- n: int,
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.