code: def cosine_similarity_chunk(t: Tuple) -> np.ndarray:
      return cosine_similarity(t[0][t[1][0] : t[1][1]], t[0]).astype(
          "float16"
      )
  
imports: from multiprocessing import cpu_count
  import sys
  from typing import Callable, Dict, Union, Tuple
  import numpy
  from sklearn.metrics.pairwise import cosine_similarity
  from tqdm import tqdm
  from imagededup.handlers.search.bktree import BKTree
  from imagededup.handlers.search.brute_force import BruteForce
  from imagededup.handlers.search.brute_force_cython import BruteForceCython
  from imagededup.utils.general_utils import parallelise
  from imagededup.utils.logger import return_logger
label_desc: Use image node_id 1 for calling a global function with example usage: cosine_similarity_chunk(t) and returns: cosine_similarity