code: def adjust_hue(tens: Tensor, hue_factor: float) -> Tensor:
      r"""
          Adjust hue of an image.
  
          The image hue is adjusted by converting the image to HSV and cyclically shifting the intensities in the hue channel (H). The image is then converted back to original image mode.
  
          See `Hue`_ for more details.
          .. _Hue: https://en.wikipedia.org/wiki/Hue
  
      Args:
          tens (Tensor): Any valid ``caer.Tensor``.
          hue_factor (float):  How much to shift the hue channel. Should be in the range [-0.5, 0.5].
              0.5 and -0.5 give complete reversal of hue channel in HSV space in positive and negative direction respectively.
              0 means no shift. Therefore, both -0.5 and 0.5 will give an image with complementary colors while 0 gives the original image.
  
      Returns:
          Hue adjusted image.
  
      Examples::
  
          >> tens = caer.data.sunrise(rgb=True)
          >> filtered = caer.transforms.adjust_hue(tens, hue_factor=1, rgb=True)
          >> filtered
          (427, 640, 3)
  
      """
      tens = to_tensor(tens, enforce_tensor=True)
      cspace = tens.cspace
  
      if not (-0.5 <= hue_factor <= 0.5):
          raise ValueError("`hue_factor` is not in [-0.5, 0.5].")
  
      try:
          from PIL import Image
      except ImportError:
          raise ImportError(
              "Pillow must be installed to use this ``caer.color.adjust_hue()``."
          )
  
      tens = Image.fromarray(tens)
      input_mode = tens.mode
      if input_mode in {"L", "1", "I", "F"}:
          return np.array(tens)
  
      h, s, v = tens.convert("HSV").split()
  
      np_h = np.array(h, dtype=np.uint8)
  
      # uint8 addition take cares of rotation across boundaries
      with np.errstate(over="ignore"):
          np_h += np.uint8(hue_factor * 255)
      h = Image.fromarray(np_h, "L")
  
      tens = Image.merge("HSV", (h, s, v)).convert(input_mode)
  
      return to_tensor(tens, cspace=cspace)
  
file_path: caer/caer/transforms/color.py
imports: import numpy
  import random
  import cv2
  import math
  from ..coreten import Tensor, to_tensor
  from ..annotations import Union, List, Tuple
  from .functional import is_list, _hls, _exposure_process
label_desc: Use image node_id 7 for calling a global function with example usage: adjust_hue(tens, hue_factor) and returns: to_tensor, np