code: def test_maximal_independent_set(self):
      # prefer to remove nodes with higher index
      t = hl.utils.range_table(10)
      graph = t.select(
          i=hl.int64(t.idx),
          j=hl.int64(t.idx + 10),
          bad_type=hl.float32(t.idx),
      )
  
      mis_table = hl.maximal_independent_set(
          graph.i, graph.j, True, lambda l, r: l - r
      )
      mis = [row["node"] for row in mis_table.collect()]
      self.assertEqual(sorted(mis), list(range(0, 10)))
      self.assertEqual(mis_table.row.dtype, hl.tstruct(node=hl.tint64))
      self.assertEqual(mis_table.key.dtype, hl.tstruct(node=hl.tint64))
  
      self.assertRaises(
          ValueError,
          lambda: hl.maximal_independent_set(
              graph.i, graph.bad_type, True
          ),
      )
      self.assertRaises(
          ValueError,
          lambda: hl.maximal_independent_set(
              graph.i, hl.utils.range_table(10).idx, True
          ),
      )
      self.assertRaises(
          ValueError,
          lambda: hl.maximal_independent_set(
              hl.literal(1), hl.literal(2), True
          ),
      )
  
imports: import unittest
  import hail
  from ..helpers import *
label_desc: Use image node_id 5 for calling the Tests obj's underlying member method code with example usage: obj.test_maximal_independent_set() without return types