code: def test_write_slices():
      tmp = np.zeros(DATA.shape)
      write_data(tmp, slice_generator(DATA))
      assert_almost_equal(tmp, np.asarray(DATA))
      tmp = np.zeros(DATA.shape)
      write_data(tmp, slice_generator(DATA, axis=1))
      assert_almost_equal(tmp, np.asarray(DATA))
      tmp = np.zeros(DATA.shape)
      write_data(tmp, slice_generator(DATA, axis=2))
      assert_almost_equal(tmp, np.asarray(DATA))
  
file_path: nipy/nipy/core/utils/tests/test_generators.py
imports: import numpy
  import pytest
  from numpy.testing import assert_almost_equal, assert_array_equal
  from ...api import slice_generator, write_data
  from ..None import generators
label_desc: Use image node_id 2 for calling a global function with example usage: test_write_slices() without return types