code: def color_balance(images):
      images = images.astype("float32")
      red = images[:, :, :, 0]
      green = images[:, :, :, 1]
      blue = images[:, :, :, 2]
      combined = red + green + blue
      total_color = combined.sum()
      overall_fraction_red = red.sum() / total_color
      overall_fraction_green = green.sum() / total_color
      overall_fraction_blue = blue.sum() / total_color
  
      for i in range(images.shape[0]):
          image = images[i]
          image_total = combined[i].sum()
          red_scale = overall_fraction_red / (
              red[i].sum() / image_total
          )
          green_scale = overall_fraction_green / (
              green[i].sum() / image_total
          )
          blue_scale = overall_fraction_blue / (
              blue[i].sum() / image_total
          )
          image[:, :, 0] *= red_scale
          image[:, :, 1] *= green_scale
          image[:, :, 2] *= blue_scale
      image[image < 0] = 0
      image[image > 255] = 255
      return images
  
imports: from os import mkdir
  from os.path import exists, join
  from collections import defaultdict
  import pylab
  from sklearn.datasets import fetch_lfw_people
  from sklearn.impute import IterativeImputer
  import numpy
  from fancyimpute import SimpleFill, IterativeSVD, SoftImpute, BiScaler, KNN
  from fancyimpute.common import masked_mae, masked_mse
label_desc: Use image node_id 3 for calling a global function with example usage: color_balance(images) and returns: images