code: def chunks(
      lst, n, progress_bar=None, progress_text="Batch computing"
  ):
      for i in tqdm(range(0, len(lst), n)):
          if progress_bar is not None:
              progress_bar.progress(i / len(lst), text=progress_text)
          yield lst[i : i + n]
  
file_path: interpret-text/python/interpret_text/generative/model_lib/hf_tooling.py
imports: import torch
  import numpy
  from tqdm import tqdm
  import torch.nn.functional
  from scipy.special import log_softmax, logsumexp
label_desc: Use image node_id 1 for calling a global function with example usage: chunks(lst, n, progress_bar, progress_text) without return types