code: def adjust_hue(img: Image.Image, hue_factor: float) -> Image.Image:
      if not (-0.5 <= hue_factor <= 0.5):
          raise ValueError(
              f"hue_factor ({hue_factor}) is not in [-0.5, 0.5]."
          )
  
      if not _is_pil_image(img):
          raise TypeError(f"img should be PIL Image. Got {type(img)}")
  
      input_mode = img.mode
      if input_mode in {"L", "1", "I", "F"}:
          return img
  
      h, s, v = img.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")
  
      img = Image.merge("HSV", (h, s, v)).convert(input_mode)
      return img
  
imports: import numbers
  from typing import Any, Dict, List, Literal, Optional, Sequence, Tuple, Union
  import numpy
  import torch
  from PIL import Image, ImageEnhance, ImageOps
label_desc: Use image node_id 10 for calling a global function with example usage: adjust_hue(img, hue_factor) and returns: img, img