code: def parallel_map(
      f, iterable, max_threads=None, show_pbar=False, **kwargs
  ):
      """Parallel version of map()."""
      with futures.ThreadPoolExecutor(max_threads) as executor:
          if show_pbar:
              results = tqdm.tqdm(
                  executor.map(f, iterable, **kwargs),
                  total=len(iterable),
              )
          else:
              results = executor.map(f, iterable, **kwargs)
          return list(results)
  
imports: import collections
  from concurrent import futures
  import contextlib
  import functools
  import time
  from typing import List, Union
  import jax
  from jax import tree_util
  import jax.numpy
  import numpy
  from scipy import interpolate
  from scipy.spatial import transform
  import tqdm
label_desc: Use image node_id 25 for calling a global function with example usage: parallel_map(f, iterable, max_threads, show_pbar) and returns: list