code: def test_hash_on_axis():
      hash_from_buffer = lambda x: mmh3_hash_from_buffer(memoryview(x))
  
      a = np.random.rand(10)
  
      result = hash_on_axis(a, 0, 3)
      expected = np.array(
          [mmh3_hash_from_buffer(element) % 3 for element in a]
      )
  
      np.testing.assert_array_equal(result, expected)
  
      result = hash_on_axis(a, 0, 1)
      expected = np.array([0 for _ in a])
  
      np.testing.assert_array_equal(result, expected)
  
      a = np.random.rand(10, 5)
  
      result = hash_on_axis(a, 0, 3)
      expected = np.array(
          [hash_from_buffer(a[i, :]) % 3 for i in range(a.shape[0])]
      )
  
      np.testing.assert_array_equal(result, expected)
  
      result = hash_on_axis(a, 1, 3)
      expected = np.array(
          [hash_from_buffer(a[:, i]) % 3 for i in range(a.shape[1])]
      )
  
      np.testing.assert_array_equal(result, expected)
  
      a = np.random.rand(10, 5, 4)
  
      result = hash_on_axis(a, 2, 3)
      expected = np.array(
          [hash_from_buffer(a[:, :, i]) % 3 for i in range(a.shape[2])]
      )
  
      np.testing.assert_array_equal(result, expected)
  
file_path: mars/mars/tensor/tests/test_utils.py
imports: import numpy
  import pytest
  from ...None import tensor
  from ...lib.mmh3 import hash_from_buffer
  from ..utils import hash_on_axis, normalize_axis_tuple, fetch_corner_data
label_desc: Use image node_id 1 for calling a global function with example usage: test_hash_on_axis() without return types