code: def parallelise(
      function: Callable, data: List, verbose: bool, num_workers: int
  ) -> List:
      num_workers = (
          1 if num_workers < 1 else num_workers
      )  # Pool needs to have at least 1 worker.
      pool = Pool(processes=num_workers)
      results = list(
          tqdm.tqdm(
              pool.imap(function, data, 100),
              total=len(data),
              disable=not verbose,
          )
      )
      pool.close()
      pool.join()
      return results
  
file_path: imagededup/imagededup/utils/general_utils.py
imports: import json
  from multiprocessing import Pool
  from pathlib import Path, PurePath
  from typing import Callable, Dict, List, Union
  import tqdm
  from imagededup.utils.logger import return_logger
label_desc: Use image node_id 3 for calling a global function with example usage: parallelise(function, data, verbose, num_workers) and returns: results