code: def test_empty2(self):
      # but it's sometimes ok with some non-zero dimensions
      def empty_to_1(x):
          assert len(x) == 0
          return 1
  
      for xp in [numpy, cupy]:
          shape = [10, 10]
          shape[self.axis] = 0
          shape = tuple(shape)
          a = xp.empty(shape)
          if self.axis == 0:
              other_axis = 1
          else:
              other_axis = 0
          with pytest.raises(ValueError):
              xp.apply_along_axis(empty_to_1, other_axis, a)
  
          # okay to call along the shape 0 axis
          testing.assert_array_equal(
              xp.apply_along_axis(empty_to_1, self.axis, a),
              xp.ones((10,)),
          )
  
file_path: cupy/tests/cupy_tests/lib_tests/test_shape_base.py
imports: import unittest
  import numpy
  import pytest
  import cupy
  from cupy import testing
label_desc: Use image node_id 7 for calling the TestApplyAlongAxis obj's underlying member method code with example usage: obj.test_empty2() and returns: int