code: def test_multi_slice():
      for _, d in slice_generator(DATA, axis=[0, 1]):
          assert d.shape == (30,)
      for _, d in slice_generator(DATA, axis=[2, 1]):
          assert d.shape == (10,)
      slice_defs = list(slice_generator(DATA, axis=[0, 1]))
      assert len(slice_defs) == 10 * 20
      assert slice_defs[0][0] == (0, 0, slice(0, 30, None))
      assert slice_defs[1][0] == (1, 0, slice(0, 30, None))
      assert slice_defs[198][0] == (8, 19, slice(0, 30, None))
      assert slice_defs[199][0] == (9, 19, slice(0, 30, None))
      slice_defs = list(slice_generator(DATA, axis=[2, 1]))
      assert len(slice_defs) == 20 * 30
      assert slice_defs[0][0] == (slice(0, 10, None), 0, 0)
      assert slice_defs[1][0] == (slice(0, 10, None), 0, 1)
      assert slice_defs[598][0] == (slice(0, 10, None), 19, 28)
      assert slice_defs[599][0] == (slice(0, 10, None), 19, 29)
  
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 3 for calling a global function with example usage: test_multi_slice() without return types