from typing import List
from typing import Any


def to_batches(lst: List[Any], batch_size: int) -> List[List[Any]]:
    """
    Split a given list into sublists with a given maximum number of items.
    :param lst: a list.
    :param batch_size: the maximum number of items in the sublists.
    :return: a list of lists, splitting the original list into batches.
    """
    return [lst[x:x + batch_size] for x in range(0, len(lst), batch_size)]