code: def test_CalculateMedian(create_analyze_pair_file_in_directory):
      mean = misc.CalculateMedian()
  
      with pytest.raises(TypeError):
          mean.run()
  
      mean.inputs.in_files = example_data("ds003_sub-01_mc.nii.gz")
      eg = mean.run()
  
      assert os.path.exists(eg.outputs.median_files)
      assert nb.load(eg.outputs.median_files)
  
file_path: nipype/nipype/algorithms/tests/test_misc.py
imports: import pytest
  import os
  import nibabel
  from nipype.algorithms import misc
  from nipype.utils.filemanip import fname_presuffix
  from nipype.testing.fixtures import create_analyze_pair_file_in_directory
  from nipype.testing import example_data
label_desc: Use image node_id 2 for calling a global function with example usage: test_CalculateMedian(create_analyze_pair_file_in_directory) without return types