code: def draw_image(
      image: np.ndarray,
      label,
      task_type: TaskType,
      label_map: LabelMap,
      thumbnail_size: t.Tuple[int, int] = (200, 200),
      draw_label: bool = True,
  ) -> str:
      """Return an image to show as output of the display.
  
      Parameters
      ----------
      image : np.ndarray
          The image to draw, must be a [H, W, C] 3D numpy array.
      label :
          2-dim labels tensor for the image to draw on top of the image, shape depends on task type.
      task_type : TaskType
          The task type associated with the label.
      label_map: LabelMap
          Map of class id to label
      thumbnail_size: t.Tuple[int,int]
          The required size of the image for display.
      draw_label : bool, default: True
          Whether to draw the label on the image or not.
      Returns
      -------
      str
          The image in the provided thumbnail size with the label drawn on top of it for relevant tasks as html.
      """
      if label is not None and image is not None and draw_label:
          if task_type == TaskType.OBJECT_DETECTION:
              image = draw_bboxes(
                  image,
                  np.asarray(label),
                  copy_image=False,
                  border_width=5,
                  label_map=label_map,
              )
          elif task_type == TaskType.SEMANTIC_SEGMENTATION:
              image = draw_masks(image, label, copy_image=False)
      if image is not None:
          return prepare_thumbnail(
              image=image, size=thumbnail_size, copy_image=False
          )
      else:
          return "Image unavailable"
  
imports: import io
  import typing
  from numbers import Number
  from pathlib import Path
  import cv2
  import numpy
  import PIL.Image
  import PIL.ImageDraw
  import PIL.ImageOps
  import plotly.graph_objects
  from PIL import ImageColor, ImageFont
  from deepchecks.core.errors import DeepchecksValueError
  from deepchecks.utils.html import imagetag
  from deepchecks.vision.vision_data import TaskType
  from deepchecks.vision.vision_data.utils import LabelMap
  from .detection_formatters import convert_bbox
label_desc: Use image node_id 1 for calling a global function with example usage: draw_image(image, label, task_type, label_map, thumbnail_size, draw_label) and returns: prepare_thumbnail, str