code: def test_simple(self):
      x = np.array(
          [
              [-0.5, 0.5, 1.5],
              [-0.5, 1.5, 2.5],
              [-0.5, 2.5, 0.5],
              [0.5, 0.5, 1.5],
              [0.5, 1.5, 2.5],
              [0.5, 2.5, 2.5],
          ]
      )
      H, edges = histogramdd(
          x, (2, 3, 3), range=[[-1, 1], [0, 3], [0, 3]]
      )
      answer = np.array(
          [
              [[0, 1, 0], [0, 0, 1], [1, 0, 0]],
              [[0, 1, 0], [0, 0, 1], [0, 0, 1]],
          ]
      )
      assert_array_equal(H, answer)
  
      # Check normalization
      ed = [[-2, 0, 2], [0, 1, 2, 3], [0, 1, 2, 3]]
      H, edges = histogramdd(x, bins=ed, density=True)
      assert_(np.all(H == answer / 12.0))
  
      # Check that H has the correct shape.
      H, edges = histogramdd(
          x, (2, 3, 4), range=[[-1, 1], [0, 3], [0, 4]], density=True
      )
      answer = np.array(
          [
              [[0, 1, 0, 0], [0, 0, 1, 0], [1, 0, 0, 0]],
              [[0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 1, 0]],
          ]
      )
      assert_array_almost_equal(H, answer / 6.0, 4)
      # Check that a sequence of arrays is accepted and H has the correct
      # shape.
      z = [np.squeeze(y) for y in np.split(x, 3, axis=1)]
      H, edges = histogramdd(
          z, bins=(4, 3, 2), range=[[-2, 2], [0, 3], [0, 2]]
      )
      answer = np.array(
          [
              [[0, 0], [0, 0], [0, 0]],
              [[0, 1], [0, 0], [1, 0]],
              [[0, 1], [0, 0], [0, 0]],
              [[0, 0], [0, 0], [0, 0]],
          ]
      )
      assert_array_equal(H, answer)
  
      Z = np.zeros((5, 5, 5))
      Z[list(range(5)), list(range(5)), list(range(5))] = 1.0
      H, edges = histogramdd(
          [np.arange(5), np.arange(5), np.arange(5)], 5
      )
      assert_array_equal(H, Z)
  
imports: import numpy
  from numpy import histogram, histogramdd, histogram_bin_edges
  from numpy.testing import assert_, assert_equal, assert_array_equal, assert_almost_equal, assert_array_almost_equal, assert_raises, assert_allclose, assert_array_max_ulp, assert_raises_regex, suppress_warnings
  from numpy.testing._private.utils import requires_memory
  import pytest
label_desc: Use image node_id 1 for calling the TestHistogramdd obj's underlying member method code with example usage: obj.test_simple() without return types