code: def test_representative():
      """test representative computation"""
      toto = np.random.rand(*shape)
      ddom = domain_from_binary_array(toto)
      ddom.set_feature("data", np.ravel(toto))
      dmean = toto.mean()
      dmin = toto.min()
      dmax = toto.max()
      dmed = np.median(toto)
      assert_almost_equal(
          ddom.representative_feature("data", "mean"), dmean
      )
      assert_almost_equal(
          ddom.representative_feature("data", "min"), dmin
      )
      assert_almost_equal(
          ddom.representative_feature("data", "max"), dmax
      )
      assert_almost_equal(
          ddom.representative_feature("data", "median"), dmed
      )
  
imports: import nibabel.gifti
  import numpy
  from nibabel import Nifti1Image
  from numpy.testing import assert_almost_equal, assert_array_equal
  from ..discrete_domain import domain_from_binary_array, domain_from_image, domain_from_mesh, grid_domain_from_binary_array, grid_domain_from_image, grid_domain_from_shape, smatrix_from_3d_array, smatrix_from_nd_array, smatrix_from_nd_idx
label_desc: Use image node_id 21 for calling a global function with example usage: test_representative() without return types