code: def test_inertia_tensor_2d(dtype):
      image = np.zeros((40, 40), dtype=dtype)
      image[
          15:25, 5:35
      ] = 1  # big horizontal rectangle (aligned with axis 1)
      expected_dtype = _supported_float_type(image.dtype)
  
      T = inertia_tensor(image)
      assert T.dtype == expected_dtype
      assert T[0, 0] > T[1, 1]
      np.testing.assert_allclose(T[0, 1], 0)
  
      v0, v1 = inertia_tensor_eigvals(image, T=T)
      assert v0.dtype == expected_dtype
      assert v1.dtype == expected_dtype
      np.testing.assert_allclose(
          np.sqrt(v0 / v1), 3, rtol=0.01, atol=0.05
      )
  
imports: import itertools
  import numpy
  import pytest
  from scipy import ndimage
  from skimage import draw
  from skimage._shared import testing
  from skimage._shared.testing import assert_allclose, assert_almost_equal, assert_equal
  from skimage._shared.utils import _supported_float_type
  from skimage.measure import centroid, inertia_tensor, inertia_tensor_eigvals, moments, moments_central, moments_coords, moments_coords_central, moments_hu, moments_normalized
label_desc: Use image node_id 15 for calling a global function with example usage: test_inertia_tensor_2d(dtype) without return types