code: def build_map(chunk_start, result, total_chunks, start_id, end_id):
      """
      Build the map from chunk_id to a range of chunk ids that are from the same document.
      The chunk_id is in range [start_id, end_id)
      """
      size = len(chunk_start)
      for i in prange(size):
          beg = chunk_start[i]
          end = chunk_start[i + 1] if i < size - 1 else total_chunks
          if (
              start_id < end and beg < end_id
          ):  # [beg, end) intersect  [start_id, end_id)
              result[max(beg - start_id, 0) : (end - start_id), 0] = beg
              result[max(beg - start_id, 0) : (end - start_id), 1] = end
  
imports: import argparse
  import multiprocessing
  import pathlib
  import sys
  import time
  from multiprocessing import Pool
  import faiss
  import numpy
  import torch
  from numba import njit, prange
  from sentence_transformers import SentenceTransformer
  from nemo.collections.nlp.data.language_modeling.megatron.indexed_retrieval_dataset import KNNIndex, MMapRetrievalIndexedDataset, merge_knn_files
  from nemo.collections.nlp.modules.common.tokenizer_utils import get_nmt_tokenizer
  from nemo.utils import logging
label_desc: Use image node_id 1 for calling a global function with example usage: build_map(chunk_start, result, total_chunks, start_id, end_id) without return types