async def run_taskgroup_batched(*async_tasks: Awaitable[Any], batch_size: int) -> list[Any]:
    """Run a list of coroutines concurrently in batches.

    Args:
        *async_tasks: The list of coroutines to run.
        batch_size: The size of each batch.

    Returns:
        The results of the coroutines.
    """
    results: list[Any] = []

    for i in range(0, len(async_tasks), batch_size):
        batch = async_tasks[i : i + batch_size]
        results.extend(await run_taskgroup(*batch))

    return results
Run a list of coroutines concurrently in batches.

    Args:
        *async_tasks: The list of coroutines to run.
        batch_size: The size of each batch.

    Returns:
        The results of the coroutines.
    
kreuzberg/_utils/_sync.py