code: def crop_image(img: np.ndarray, x, y, w, h) -> np.ndarray:
      """Return the cropped numpy array image by x, y, w, h coordinates (top left corner, width and height."""
      # Convert x, y, w, h to integers if not integers already:
      x, y, w, h = [round(n) for n in [x, y, w, h]]
  
      # Make sure w, h don't extend the bounding box outside of image dimensions:
      h = min(h, img.shape[0] - y - 1)
      w = min(w, img.shape[1] - x - 1)
  
      return img[y : y + h, x : x + w]
  
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 9 for calling a global function with example usage: crop_image(img, x, y, w, h) and returns: img