code: def adjust_contrast_linear(arr, alpha):
      """Adjust contrast by scaling each pixel to ``127 + alpha*(v-127)``.
  
      **Supported dtypes**:
  
          * ``uint8``: yes; fully tested (1) (2)
          * ``uint16``: yes; tested (2)
          * ``uint32``: yes; tested (2)
          * ``uint64``: no (3)
          * ``int8``: yes; tested (2)
          * ``int16``: yes; tested (2)
          * ``int32``: yes; tested (2)
          * ``int64``: no (2)
          * ``float16``: yes; tested (2)
          * ``float32``: yes; tested (2)
          * ``float64``: yes; tested (2)
          * ``float128``: no (2)
          * ``bool``: no (4)
  
          - (1) Handled by ``cv2``. Other dtypes are handled by raw ``numpy``.
          - (2) Only tested for reasonable alphas with up to a value of
                around ``100``.
          - (3) Conversion to ``float64`` is done during augmentation, hence
                ``uint64``, ``int64``, and ``float128`` support cannot be
                guaranteed.
          - (4) Does not make sense for contrast adjustments.
  
      Parameters
      ----------
      arr : numpy.ndarray
          Array for which to adjust the contrast. Dtype ``uint8`` is fastest.
  
      alpha : number
          Multiplier to linearly pronounce (``>1.0``), dampen (``0.0`` to
          ``1.0``) or invert (``<0.0``) the difference between each pixel value
          and the dtype's center value, e.g. ``127`` for ``uint8``.
  
      Returns
      -------
      numpy.ndarray
          Array with adjusted contrast.
  
      """
      # pylint: disable=no-else-return
      if arr.size == 0:
          return np.copy(arr)
  
      # int8 is also possible according to docs
      # https://docs.opencv.org/3.0-beta/modules/core/doc/operations_on_arrays.html#cv2.LUT ,
      # but here it seemed like `d` was 0 for CV_8S, causing that to fail
      if arr.dtype == iadt._UINT8_DTYPE:
          (
              min_value,
              center_value,
              max_value,
          ) = iadt.get_value_range_of_dtype(arr.dtype)
          # TODO get rid of this int(...)
          center_value = int(center_value)
  
          value_range = np.arange(0, 256, dtype=np.float32)
  
          # 127 + alpha*(I_ij-127)
          # using np.float32(.) here still works when the input is a numpy array
          # of size 1
          alpha = np.float32(alpha)
          table = center_value + alpha * (value_range - center_value)
          table = np.clip(table, min_value, max_value).astype(arr.dtype)
          arr_aug = ia.apply_lut(arr, table)
          return arr_aug
      else:
          input_dtype = arr.dtype
          (
              _min_value,
              center_value,
              _max_value,
          ) = iadt.get_value_range_of_dtype(input_dtype)
          # TODO get rid of this int(...)
          if input_dtype.kind in ["u", "i"]:
              center_value = int(center_value)
          image_aug = center_value + alpha * (
              arr.astype(np.float64) - center_value
          )
          image_aug = iadt.restore_dtypes_(image_aug, input_dtype)
          return image_aug
  
imports: from __future__ import print_function, division, absolute_import
  import numpy
  import six.moves
  import skimage.exposure
  import cv2
  import imgaug
  from imgaug.imgaug import _normalize_cv2_input_arr_
  from .None import meta
  from .None import color
  from ..None import parameters
  from ..None import dtypes
  from ..augmentables.batches import _BatchInAugmentation
label_desc: Use image node_id 4 for calling a global function with example usage: adjust_contrast_linear(arr, alpha) and returns: np, arr_aug, image_aug