code: def calculate_embedding(pool, batch_size):
      while True:
          sentences, slice_id = get_sentence_chunks()
          if sentences is None:
              break
          beg = time.time()
          emb = model.encode_multi_process(
              sentences=sentences, pool=pool, batch_size=batch_size
          )
          end = time.time()
          logging.info(
              f"one embedding {len(emb)} batch size takes {end-beg}"
          )
          emb_queue.put((emb, slice_id))
      emb_queue.put((None, None))
  
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 8 for calling a global function with example usage: calculate_embedding(pool, batch_size) without return types