def run_cmd(cmd_str, prev_sp=None):
  """
  This function runs the linux command cmr_str as a subprocess after waiting
  for prev_sp subprocess to finish
  """
  if prev_sp is not None:
    prev_sp.wait()
  return subprocess.Popen(cmd_str, shell=True)#, stdout=open(os.devnull, 'w'), stderr=open(os.devnull, 'w'))

  This function runs the linux command cmr_str as a subprocess after waiting
  for prev_sp subprocess to finish
  
training/data_efficiency/vit_finetuning/utils/utils.py