code: def pad(image, width: int, height: int, cval: int = 255):
      """Pad an image to a desired size. Raises an exception if image
      is larger than desired size.
  
      Args:
          image: The input image
          width: The output width
          height: The output height
          cval: The value to use for filling the image.
      """
      output_shape: typing.Union[
          typing.Tuple[int, int, int], typing.Tuple[int, int]
      ]
      if len(image.shape) == 3:
          output_shape = (height, width, image.shape[-1])
      else:
          output_shape = (height, width)
      assert (
          height >= output_shape[0]
      ), "Input height must be less than output height."
      assert (
          width >= output_shape[1]
      ), "Input width must be less than output width."
      padded = np.zeros(output_shape, dtype=image.dtype) + cval
      padded[: image.shape[0], : image.shape[1]] = image
      return padded
  
imports: import os
  import io
  import typing
  import hashlib
  import urllib.request
  import urllib.parse
  import cv2
  import imgaug
  import numpy
  import validators
  import typing_extensions
  import matplotlib.pyplot
  from shapely import geometry
  from scipy import spatial
label_desc: Use image node_id 10 for calling a global function with example usage: pad(image, width, height, cval) and returns: padded