code: def test_parcel_analysis_write_mode():
      # find a subdirectory name that doesn't exist to check that
      # attempts to write in a non-existing directory do not raise
      # errors
      con_imgs, parcel_img = make_fake_data()
      subdirs = [o for o in os.listdir(".") if os.path.isdir(o)]
      res_path = "a"
      while res_path in subdirs:
          res_path += "a"
      p = ParcelAnalysis(
          con_imgs,
          parcel_img,
          res_path=res_path,
          write_smoothed_images=True,
      )
      pytest.raises(IOError, p.dump_results)
      _ = p.t_map()
      _ = p.parcel_maps()
  
file_path: nipy/nipy/algorithms/group/tests/test_parcel_analysis.py
imports: import os
  import numpy
  import pytest
  from numpy.testing import assert_array_equal
  from ....core.image.image_spaces import make_xyz_image, xyz_affine
  from ..parcel_analysis import ParcelAnalysis, _smooth_image_pair, parcel_analysis
label_desc: Use image node_id 10 for calling a global function with example usage: test_parcel_analysis_write_mode() without return types