code: def _exif_orientation_transform(
      orientation: int, mode: str
  ) -> Callable:
      # get transformation that transforms an image from a
      # given EXIF orientation into the standard orientation
  
      # -1 if the mode has color channel, 0 otherwise
      axis = -2 if Image.getmodebands(mode) > 1 else -1
  
      EXIF_ORIENTATION = {
          1: lambda x: x,
          2: lambda x: np.flip(x, axis=axis),
          3: lambda x: np.rot90(x, k=2),
          4: lambda x: np.flip(x, axis=axis - 1),
          5: lambda x: np.flip(np.rot90(x, k=3), axis=axis),
          6: lambda x: np.rot90(x, k=3),
          7: lambda x: np.flip(np.rot90(x, k=1), axis=axis),
          8: lambda x: np.rot90(x, k=1),
      }
  
      return EXIF_ORIENTATION[orientation]
  
imports: import sys
  import warnings
  from io import BytesIO
  from typing import Any, Callable, Dict, Iterator, List, Optional, Tuple, Union, cast
  import numpy
  from PIL import ExifTags, GifImagePlugin, Image, ImageSequence, UnidentifiedImageError
  from PIL import __version__
  from ..core.request import URI_BYTES, InitializationError, IOMode, Request
  from ..core.v3_plugin_api import ImageProperties, PluginV3
  from ..typing import ArrayLike
label_desc: Use image node_id 2 for calling a global function with example usage: _exif_orientation_transform(orientation, mode) and returns: EXIF_ORIENTATION