code: def populate_grams(
      els,
      els_index,
      n_ngrams: int,
      ngram_size: int,
      ngram_id: int,
      c,  # : ForwardIter ,  # Map
  ):
      for _ngrams in range(n_ngrams, 0, -1):
          n = 1
          m = c
          while els_index < len(els):
              p = m.emplace(els[els_index], NgramPart(0))
              if n == ngram_size:
                  p.id_ = ngram_id
                  ngram_id += 1
                  els_index += 1
                  break
              if p.empty():
                  p.init()
              m = p.leafs_
              n += 1
              els_index += 1
      return ngram_id
  
imports: from enum import IntEnum
  from typing import List
  import numpy
  from onnx.reference.op_run import OpRun
label_desc: Use image node_id 1 for calling a global function with example usage: populate_grams(els, els_index, n_ngrams, ngram_size, ngram_id, c) and returns: ngram_id