code: def test_4d():
      np.random.seed(324)
      for _ in range(16):
          binim = np.random.random((4, 8, 4, 6)) > 0.5
          dist = distance(binim)
          assert dist.shape == binim.shape
          assert np.all(dist[~binim] == 0)
          assert np.all(dist == _slow_dist4d(binim, "euclidean2"))
  
file_path: mahotas/mahotas/tests/test_distance.py
imports: from mahotas import distance
  import numpy
label_desc: Use image node_id 6 for calling a global function with example usage: test_4d() without return types