code: def adjust_saturation_torchvision(img, factor, gamma=0):
      if factor == 1:
          return img
  
      if is_grayscale_image(img):
          gray = img
          return gray
      else:
          gray = cv2.cvtColor(img, cv2.COLOR_RGB2GRAY)
          gray = cv2.cvtColor(gray, cv2.COLOR_GRAY2RGB)
  
      if factor == 0:
          return gray
  
      result = cv2.addWeighted(
          img, factor, gray, 1 - factor, gamma=gamma
      )
      if img.dtype == np.uint8:
          return result
  
      # OpenCV does not clip values for float dtype
      return clip(result, img.dtype, MAX_VALUES_BY_DTYPE[img.dtype])
  
imports: from __future__ import division
  from typing import Optional, Sequence, Union
  from warnings import warn
  import cv2
  import numpy
  import skimage
  from albumentations import random_utils
  from albumentations.augmentations.utils import MAX_VALUES_BY_DTYPE, _maybe_process_in_chunks, clip, clipped, ensure_contiguous, is_grayscale_image, is_rgb_image, non_rgb_warning, preserve_channel_dim, preserve_shape
label_desc: Use image node_id 53 for calling a global function with example usage: adjust_saturation_torchvision(img, factor, gamma) and returns: clip, img, gray, gray, result