from typing import Sequence


def divide_sequence_into_chunks(seq: Sequence, chunk_size: int) -> Sequence[Sequence]:
    """
    Returns a sequence which has sequences of the elements in the input sequence
    and each sequence's length is equal to chunk_size.
    If the length of input sequence cannot be divided by chunk_size,
    the last element of return value contains less than chunk_size elements

    >>> divide_sequence_into_chunks([0, 1, 2, 3], chunk_size=2)
    [[0, 1], [2, 3]]

    >>> divide_sequence_into_chunks([0, 1, 2, 3, 4], chunk_size=2)
    [[0, 1], [2, 3], [4]]

    :param seq:
    :param chunk_size:
    :return:
    """
    return [seq[x:x + chunk_size] for x in range(0, len(seq), chunk_size)]