from typing import List


def ngrams(tokens: List, n: int):
    """

    Args:
        tokens: List of elements
        n: N-gram size

    Returns:
        List of ngrams
    """
    return [tokens[i : i + n] for i in range(len(tokens) - n + 1)]