code: def extract_ngrams(sentence, process_func, ngram_len=4):
      leaf_words = [x for x in process_func(sentence)]
      leaf_words = ["l'" if x == "l" else x for x in leaf_words]
      if len(leaf_words) <= ngram_len:
          return [tuple(leaf_words)]
      its = [
          leaf_words[i : i + len(leaf_words) - ngram_len + 1]
          for i in range(ngram_len)
      ]
      return [words for words in itertools.zip_longest(*its)]
  
imports: from collections import defaultdict, deque, namedtuple
  import itertools
  import os
  import re
  import sys
  from tqdm import tqdm
  from stanza.models.constituency.tree_reader import read_trees, UnclosedTreeError, ExtraCloseTreeError
  from stanza.server import tsurgeon
  from stanza.utils.conll import CoNLL
  from stanza.utils.datasets.constituency.utils import SHARDS, write_dataset
  import stanza.utils.default_paths
label_desc: Use image node_id 4 for calling a global function with example usage: extract_ngrams(sentence, process_func, ngram_len) and returns: unknown, list