code: def grayscale(image):
      """
      Convert the image to gray scale.
      Args:
          image (tensor): image to convert to gray scale. Dimension is
              `channel` x `height` x `width`.
      Returns:
          img_gray (tensor): image in gray scale.
      """
      # R -> 0.299, G -> 0.587, B -> 0.114.
      img_gray = np.copy(image)
      gray_channel = (
          0.299 * image[2] + 0.587 * image[1] + 0.114 * image[0]
      )
      img_gray[0] = gray_channel
      img_gray[1] = gray_channel
      img_gray[2] = gray_channel
      return img_gray
  
imports: import math
  import numpy
  import cv2
label_desc: Use image node_id 24 for calling a global function with example usage: grayscale(image) and returns: img_gray