code: def _check_example(example, n_fg_class):
      assert len(example) >= 3, (
          "Each example must have at least four elements:"
          "img, mask and label."
      )
  
      img, mask, label = example[:3]
  
      assert_is_image(img, color=True)
      _, H, W = img.shape
      R = mask.shape[0]
  
      assert isinstance(
          mask, np.ndarray
      ), "mask must be a numpy.ndarray."
      assert isinstance(
          label, np.ndarray
      ), "label must be a numpy.ndarray."
      assert mask.dtype == np.bool, "The type of mask must be bool"
      assert (
          label.dtype == np.int32
      ), "The type of label must be numpy.int32."
      assert mask.shape == (
          R,
          H,
          W,
      ), "The shape of mask must be (R, H, W)."
      assert label.shape == (R,), "The shape of label must be (R, )."
      if len(label) > 0:
          assert (
              label.min() >= 0 and label.max() < n_fg_class
          ), "The value of label must be in [0, n_fg_class - 1]."
  
imports: import numpy
  import six
  from chainercv.utils.testing.assertions.assert_is_image import assert_is_image
label_desc: Use image node_id 2 for calling a global function with example usage: _check_example(example, n_fg_class) without return types