mirror of
https://github.com/danswer-ai/danswer.git
synced 2025-03-27 02:02:18 +01:00
12 lines
200 B
Python
12 lines
200 B
Python
from typing import TypeVar
|
|
|
|
|
|
T = TypeVar("T")
|
|
|
|
|
|
def batch_list(
|
|
lst: list[T],
|
|
batch_size: int,
|
|
) -> list[list[T]]:
|
|
return [lst[i : i + batch_size] for i in range(0, len(lst), batch_size)]
|