def n_grams(tokens: list, n: int) -> list:
    """
    takes tokens of text, returns a list of n-grams

    :param tokens: list
    :param n: int
    :return: list
    """
    return [list(tokens[i:i + n]) for i in range(len(tokens) - n + 1)]