code: def adapt_pixel_distribution(
      img: np.ndarray,
      ref: np.ndarray,
      transform_type: str = "pca",
      weight: float = 0.5,
  ) -> np.ndarray:
      initial_type = img.dtype
      transformer = {
          "pca": PCA,
          "standard": StandardScaler,
          "minmax": MinMaxScaler,
      }[transform_type]()
      adapter = DomainAdapter(transformer=transformer, ref_img=ref)
      result = adapter(img).astype("float32")
      blended = (
          img.astype("float32") * (1 - weight) + result * weight
      ).astype(initial_type)
      return blended
  
imports: import random
  from typing import Any, Callable, Literal, Sequence, Tuple
  import cv2
  import numpy
  from qudida import DomainAdapter
  from skimage.exposure import match_histograms
  from sklearn.decomposition import PCA
  from sklearn.preprocessing import MinMaxScaler, StandardScaler
  from albumentations.augmentations.utils import clipped, get_opencv_dtype_from_numpy, is_grayscale_image, is_multispectral_image, preserve_shape, read_rgb_image
  from ..core.transforms_interface import ImageOnlyTransform, ScaleFloatType, to_tuple
label_desc: Use image node_id 3 for calling a global function with example usage: adapt_pixel_distribution(img, ref, transform_type, weight) and returns: blended