code: def test_leaves():
      """Test leaves"""
      hroi = make_hroi()
      size = hroi.get_size()[1:].copy()
      lroi = hroi.copy()
      lroi.reduce_to_leaves()
      assert lroi.k == 8
      assert_array_equal(lroi.get_size(), size)
      assert_array_equal(lroi.get_leaves_id(), np.arange(1, 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 13 for calling a global function with example usage: test_leaves() without return types