code: def parallel(func: Callable, args_list, mode: str = "args"):
      """
      Routine for parallel processing
      """
      from popmon.config import parallel_args
  
      if parallel_args["n_jobs"] == 1:
          results = [
              func(*args) if mode == "args" else func(**args)
              for args in args_list
          ]
      else:
          results = Parallel(**parallel_args)(
              delayed(func)(*args)
              if mode == "args"
              else delayed(func)(**args)
              for args in args_list
          )
      return results
  
file_path: popmon/popmon/utils.py
imports: from __future__ import annotations
  import fnmatch
  from textwrap import shorten
  from typing import Callable
  import pandas
  from joblib import Parallel, delayed
label_desc: Use image node_id 3 for calling a global function with example usage: parallel(func, args_list, mode) and returns: results