code: def test_ratio_mask():
      mask = torch.tensor(
          [True, True, True, True, False, False, False, False]
      )
      out = MaskLabel.ratio_mask(mask, 0.5)
      assert out[:4].sum() <= 4 and out[4:].sum() == 0
  
label_desc: Use image node_id 2 for calling a global function with example usage: test_ratio_mask() without return types