code: def find_extremes(cluster_list, dataset, jaccard_threshold):
      """Call the _find_cluster_extremes_shared function in a parallel fashion.
  
      Args:
          cluster_list (List[List[Dict]]):
              each cluster is a list of dicts with the key base_index,
              referring to the index of the base code in the dataset.
          dataset (Type[Dataset]):
              dataset is used to access the content of the code snippets,
              using the base_index from the cluster_list.
              dataset is shared between all the processes using a glabal variable (any other way to share the dataset?),
              otherwise the multi processing is not speeded up.
          jaccard_threshold (float):
              the threshold for the jaccard similarity. The default value is 0.85
  
      Returns:
          extremes_list (List[Dict]):
              Each cluster is reduced to extremes.
              See _find_cluster_extremes_shared for the definition of extremes.
      """
      global _shared_dataset
      _shared_dataset = dataset
      extremes_list = []
      f = partial(
          _find_cluster_extremes_shared,
          jaccard_threshold=jaccard_threshold,
      )
      with mp.Pool() as pool:
          for extremes in tqdm(
              pool.imap_unordered(
                  f,
                  cluster_list,
              ),
              total=len(cluster_list),
          ):
              extremes_list.append(extremes)
      return extremes_list
  
imports: import json
  import multiprocessing
  import re
  from collections import defaultdict
  from functools import partial
  from typing import Dict, List, Optional, Set, Tuple, Type
  from datasets import Dataset
  from tqdm import tqdm
  from datasketch import MinHash, MinHashLSH
  from dpu_utils.utils.iterators import ThreadedIterator
label_desc: Use image node_id 8 for calling a global function with example usage: find_extremes(cluster_list, dataset, jaccard_threshold) and returns: extremes_list