Module rpu.async_.iterables

Functions

async def chunk(iterable: AsyncIterable[~T], max_size: int) ‑> AsyncIterable[list[~T]]

|async-iterable|

Chunks the given iterable into chunks of the given size

Parameters

iterable : typing.AsyncIterable
The iterable you want to chunk
max_size : int
the max size of the chunks

Notes

If the given iterable is sync, use <code><a title="rpu.iterables.chunk" href="../iterables.html#rpu.iterables.chunk">chunk()</a></code> instead
async def get(iterable: AsyncIterable[~T], /, **attrs: Any) ‑> Optional[~T]

|coro|

Gets an item from the given iterable with sertain attributes

Parameters

iterable : typing.AsyncIterable
The item you want to be iterated through
**attrs : typing.Any
The attribute(s) to check for

Notes

If the given iterable is sync, use <code><a title="rpu.iterables.get" href="../iterables.html#rpu.iterables.get">get()</a></code> instead