code: def test_density_non_uniform_2d(self):
      # Defines the following grid:
      #
      #    0 2     8
      #   0+-+-----+
      #    + |     +
      #    + |     +
      #   6+-+-----+
      #   8+-+-----+
      x_edges = np.array([0, 2, 8])
      y_edges = np.array([0, 6, 8])
      relative_areas = np.array([[3, 9], [1, 3]])
  
      # ensure the number of points in each region is proportional to its area
      x = np.array([1] + [1] * 3 + [7] * 3 + [7] * 9)
      y = np.array([7] + [1] * 3 + [7] * 3 + [1] * 9)
  
      # sanity check that the above worked as intended
      hist, edges = histogramdd((y, x), bins=(y_edges, x_edges))
      assert_equal(hist, relative_areas)
  
      # resulting histogram should be uniform, since counts and areas are proportional
      hist, edges = histogramdd(
          (y, x), bins=(y_edges, x_edges), density=True
      )
      assert_equal(hist, 1 / (8 * 8))
  
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 14 for calling the TestHistogramdd obj's underlying member method code with example usage: obj.test_density_non_uniform_2d() without return types