code: def affine(
      img: Image.Image,
      matrix: List[float],
      interpolation: int = Image.NEAREST,
      fill: Optional[
          Union[int, float, Sequence[int], Sequence[float]]
      ] = None,
  ) -> Image.Image:
      if not _is_pil_image(img):
          raise TypeError(f"img should be PIL Image. Got {type(img)}")
  
      output_size = img.size
      opts = _parse_fill(fill, img)
      return img.transform(
          output_size, Image.AFFINE, matrix, interpolation, **opts
      )
  
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 16 for calling a global function with example usage: affine(img, matrix, interpolation, fill) and returns: img