code: def test_sd_representative():
      """Test the computation of representative features"""
      hroi = make_hroi()
      hroi.parents = np.arange(9)
      hroi.parents[2] = 1
      data = [[k] * hroi.get_size(k) for k in hroi.get_id()]
      hroi.set_feature("data", data)
      sums = hroi.representative_feature("data")
      for k in hroi.get_id():
          assert sums[hroi.select_id(k)] == k
      sums2 = hroi.representative_feature("data", ignore_children=False)
      for k in hroi.get_id():
          if k != 1:
              assert sums2[hroi.select_id(k)] == k
          else:
              assert sums2[1] == 17.0 / 9
  
imports: import numpy
  from numpy.testing import assert_array_equal
  from ..discrete_domain import domain_from_binary_array
  from ..hroi import HROI_as_discrete_domain_blobs, make_hroi_from_subdomain
  from ..mroi import subdomain_from_array
label_desc: Use image node_id 16 for calling a global function with example usage: test_sd_representative() without return types