code: def image_whitening(data):
      """
      Subtracts mean of image and divides by adjusted standard variance (for
      stability). Operations are per image but performed for the entire array.
      """
      assert len(np.shape(data)) == 4
  
      # Compute number of pixels in image
      nb_pixels = (
          np.shape(data)[1] * np.shape(data)[2] * np.shape(data)[3]
      )
  
      # Subtract mean
      mean = np.mean(data, axis=(1, 2, 3))
  
      ones = np.ones(np.shape(data)[1:4], dtype=np.float32)
      for i in xrange(len(data)):
          data[i, :, :, :] -= mean[i] * ones
  
      # Compute adjusted standard variance
      adj_std_var = np.maximum(
          np.ones(len(data), dtype=np.float32) / math.sqrt(nb_pixels),
          np.std(data, axis=(1, 2, 3)),
      )  # pylint: disable=line-too-long
  
      # Divide image
      for i in xrange(len(data)):
          data[i, :, :, :] = data[i, :, :, :] / adj_std_var[i]
  
      print(np.shape(data))
  
      return data
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import gzip
  import math
  import os
  import sys
  import tarfile
  import numpy
  from scipy.io import loadmat
  from six.moves import cPickle
  from six.moves import urllib
  from six.moves import xrange
  import tensorflow.compat.v1
label_desc: Use image node_id 3 for calling a global function with example usage: image_whitening(data) and returns: data