code: def _rand_image(size: Tuple[int, int]):
      data = (
          build_checkboard(*size)
          .astype(np.uint8)[..., None]
          .repeat(3, -1)
      )
      return Image.fromarray(data)
  
imports: import os
  from pathlib import Path
  from typing import Callable, Dict, List, Tuple
  import numpy
  import pytest
  import torch
  from flash import Trainer
  from flash.core.data.io.input import DataKeys
  from flash.core.data.io.input_transform import InputTransform
  from flash.core.data.transforms import ApplyToKeys
  from flash.core.utilities.imports import _FIFTYONE_AVAILABLE, _MATPLOTLIB_AVAILABLE, _PIL_AVAILABLE, _SEGMENTATION_MODELS_AVAILABLE, _TOPIC_IMAGE_AVAILABLE
  from flash.image import SemanticSegmentation, SemanticSegmentationData
label_desc: Use image node_id 2 for calling a global function with example usage: _rand_image(size) and returns: Image