code: def ld_svhn(extended=False, test_only=False):
      """
      Load the original SVHN data
  
      Args:
        extended: include extended training data in the returned array
        test_only: disables loading of both train and extra -> large speed up
      """
      # Define files to be downloaded
      # WARNING: changing the order of this list will break indices (cf. below)
      file_urls = [
          "http://ufldl.stanford.edu/housenumbers/train_32x32.mat",
          "http://ufldl.stanford.edu/housenumbers/test_32x32.mat",
          "http://ufldl.stanford.edu/housenumbers/extra_32x32.mat",
      ]
  
      # Maybe download data and retrieve local storage urls
      local_urls = maybe_download(file_urls, FLAGS.data_dir)
  
      # Extra Train, Test, and Extended Train data
      if not test_only:
          # Load and applying whitening to train data
          train_data, train_labels = extract_svhn(local_urls[0])
          train_data = image_whitening(train_data)
  
          # Load and applying whitening to extended train data
          ext_data, ext_labels = extract_svhn(local_urls[2])
          ext_data = image_whitening(ext_data)
  
      # Load and applying whitening to test data
      test_data, test_labels = extract_svhn(local_urls[1])
      test_data = image_whitening(test_data)
  
      if test_only:
          return test_data, test_labels
      else:
          if extended:
              # Stack train data with the extended training data
              train_data = np.vstack((train_data, ext_data))
              train_labels = np.hstack((train_labels, ext_labels))
  
              return train_data, train_labels, test_data, test_labels
          else:
              # Return training and extended training data separately
              return (
                  train_data,
                  train_labels,
                  test_data,
                  test_labels,
                  ext_data,
                  ext_labels,
              )
  
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 9 for calling a global function with example usage: ld_svhn(extended, test_only) and returns: test_data,  test_labels, train_data,  train_labels,  test_data,  test_labels, train_data,  train_labels,  test_data,  test_labels,  ext_data,  ext_labels