code: def generate_ngrams(tokens, n=1):
      """Generate ngrams for particular 'n' from a list of tokens
  
      Args:
          tokens (List[str]): List of tokens for which the ngram are to be generated
          n (int, optional): n for which ngrams are to be generated. Defaults to 1.
  
      Returns:
          List[str]: List of ngrams generated.
      """
      shifted_tokens = (tokens[i:] for i in range(n))
      tuple_ngrams = zip(*shifted_tokens)
      return (" ".join(i) for i in tuple_ngrams)
  
imports: import os
  import re
  from collections import Counter
  from itertools import chain
  import torch
  from mmf.common.registry import registry
  from mmf.utils.file_io import PathManager
  from mmf.utils.general import get_absolute_path
label_desc: Use image node_id 1 for calling a global function with example usage: generate_ngrams(tokens, n) and returns: unknown