code: def calculate_start_end(total_chunks, total_shards, shard_id):
      shard_size = total_chunks // total_shards
      splits = list(range(0, total_chunks, shard_size))
      if shard_id < total_shards - 1:
          start = splits[shard_id]
          total_chunks = splits[shard_id + 1]
      elif shard_id == total_shards - 1:
          start = splits[shard_id]
          total_chunks = total_chunks
      else:
          raise ValueError(f"{shard_id} bigger than {total_shards}")
      return start, total_chunks
  
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 5 for calling a global function with example usage: calculate_start_end(total_chunks, total_shards, shard_id) and returns: start,  total_chunks