code: def bgr2ycbcr(img, only_y=True):
      """bgr version of rgb2ycbcr
      only_y: only return Y channel
      Input:
          uint8, [0, 255]
          float, [0, 1]
      """
      in_img_type = img.dtype
      img.astype(np.float32)
      if in_img_type != np.uint8:
          img *= 255.0
      # convert
      if only_y:
          rlt = np.dot(img, [24.966, 128.553, 65.481]) / 255.0 + 16.0
      else:
          rlt = np.matmul(
              img,
              [
                  [24.966, 112.0, -18.214],
                  [128.553, -74.203, -93.786],
                  [65.481, -37.797, 112.0],
              ],
          ) / 255.0 + [16, 128, 128]
      if in_img_type == np.uint8:
          rlt = rlt.round()
      else:
          rlt /= 255.0
      return rlt.astype(in_img_type)
  
imports: import os
  import math
  import random
  import numpy
  import torch
  import cv2
  from torchvision.utils import make_grid
  from datetime import datetime
label_desc: Use image node_id 41 for calling a global function with example usage: bgr2ycbcr(img, only_y) and returns: rlt