code: def test_progressbar_parallel_more(capsys):
      """Test ProgressBar with parallel computing, advanced version."""
      assert capsys.readouterr().out == ""
      # This must be "1" because "capsys" won't get stdout properly otherwise
      parallel, p_fun, _ = parallel_func(
          _identity_block_wide, n_jobs=1, verbose=False
      )
      arr = np.arange(10)
      with use_log_level(True):
          with ProgressBar(len(arr) * 2) as pb:
              out = parallel(
                  p_fun(x, pb.subset(pb_idx))
                  for pb_idx, x in array_split_idx(
                      arr, 2, n_per_split=2
                  )
              )
              idxs = np.concatenate([o[1] for o in out])
              assert_array_equal(idxs, np.arange(len(arr) * 2))
              out = np.concatenate([o[0] for o in out])
              assert Path(pb._mmap_fname).is_file()
              sum_ = np.memmap(
                  pb._mmap_fname,
                  dtype="bool",
                  mode="r",
                  shape=len(arr) * 2,
              ).sum()
              assert sum_ == len(arr) * 2
      assert not Path(pb._mmap_fname).is_file(), "__exit__ not called?"
      cap = capsys.readouterr()
      out = cap.err
      assert "100%" in out
  
file_path: mne-python/mne/utils/tests/test_progressbar.py
imports: from pathlib import Path
  import numpy
  import pytest
  from numpy.testing import assert_array_equal
  from mne.parallel import parallel_func
  from mne.utils import ProgressBar, array_split_idx, catch_logging, use_log_level
label_desc: Use image node_id 7 for calling a global function with example usage: test_progressbar_parallel_more(capsys) without return types