code: def tqdm_joblib(tqdm_object):
      """Patch joblib to report into tqdm progress bar given as argument.
  
      Reference:
          https://stackoverflow.com/questions/24983493
  
      """
  
      class TqdmBatchCompletionCallback(
          parallel.BatchCompletionCallBack
      ):
          def __call__(self, *args, **kwargs):
              tqdm_object.update(n=self.batch_size)
              return super().__call__(*args, **kwargs)
  
      old_batch_callback = parallel.BatchCompletionCallBack
      parallel.BatchCompletionCallBack = TqdmBatchCompletionCallback
      try:
          yield tqdm_object
      finally:
          parallel.BatchCompletionCallBack = old_batch_callback
          tqdm_object.close()
  
file_path: espnet/egs2/TEMPLATE/diar1/pyscripts/utils/convert_text_to_phn.py
imports: import argparse
  import codecs
  import contextlib
  from joblib import Parallel, delayed, parallel
  from tqdm import tqdm
  from espnet2.text.cleaner import TextCleaner
  from espnet2.text.phoneme_tokenizer import PhonemeTokenizer
label_desc: Use image node_id 2 for calling a global function with example usage: tqdm_joblib(tqdm_object) and returns: super