code: def test_slice2outax():
      # Test function giving output axes from input ndims and slice
      sn = slice(None)
      assert slice2outax(1, (sn,)) == (0,)
      assert slice2outax(1, (1,)) == (None,)
      assert slice2outax(1, (None,)) == (1,)
      assert slice2outax(1, (None, 1)) == (None,)
      assert slice2outax(1, (None, 1, None)) == (None,)
      assert slice2outax(1, (None, sn)) == (1,)
      assert slice2outax(2, (sn,)) == (0, 1)
      assert slice2outax(2, (sn, sn)) == (0, 1)
      assert slice2outax(2, (1,)) == (None, 0)
      assert slice2outax(2, (sn, 1)) == (0, None)
      assert slice2outax(2, (None,)) == (1, 2)
      assert slice2outax(2, (None, 1)) == (None, 1)
      assert slice2outax(2, (None, 1, None)) == (None, 2)
      assert slice2outax(2, (None, 1, None, 2)) == (None, None)
      assert slice2outax(2, (None, sn, None, 1)) == (1, None)
      assert slice2outax(3, (sn,)) == (0, 1, 2)
      assert slice2outax(3, (sn, sn)) == (0, 1, 2)
      assert slice2outax(3, (sn, None, sn)) == (0, 2, 3)
      assert slice2outax(3, (sn, None, sn, None, sn)) == (0, 2, 4)
      assert slice2outax(3, (1,)) == (None, 0, 1)
      assert slice2outax(3, (None, sn, None, 1)) == (1, None, 3)
  
imports: import time
  from functools import partial
  from io import BytesIO
  from itertools import product
  from threading import Lock, Thread
  import numpy
  import pytest
  from numpy.testing import assert_array_equal
  from ..fileslice import _positive_slice, _simple_fileslice, calc_slicedefs, canonical_slicers, fileslice, fill_slicer, is_fancy, optimize_read_slicers, optimize_slicer, predict_shape, read_segments, slice2len, slice2outax, slicers2segments, strided_scalar, threshold_heuristic
label_desc: Use image node_id 4 for calling a global function with example usage: test_slice2outax() without return types