code: def read_SVHN(data_folder):
      """Reads and parses examples from SVHN data files"""
  
      train_img = []
      train_label = []
      test_img = []
      test_label = []
  
      train_file_list = ["train_32x32.mat", "extra_32x32.mat"]
      test_file_list = ["test_32x32.mat"]
  
      for i in range(len(train_file_list)):
          tmp_dict = sio.loadmat(
              os.path.join(data_folder, train_file_list[i])
          )
          train_img.append(tmp_dict["X"])
          train_label.append(tmp_dict["y"])
  
      tmp_dict = sio.loadmat(
          os.path.join(data_folder, test_file_list[0])
      )
      test_img.append(tmp_dict["X"])
      test_label.append(tmp_dict["y"])
  
      train_img = np.concatenate(train_img, axis=-1)
      train_label = np.concatenate(train_label).flatten()
      test_img = np.concatenate(test_img, axis=-1)
      test_label = np.concatenate(test_label).flatten()
  
      # change format from [H, W, C, B] to [B, H, W, C] for feeding to Tensorflow
      train_img = np.transpose(train_img, [3, 0, 1, 2])
      test_img = np.transpose(test_img, [3, 0, 1, 2])
  
      mean_img = np.mean(np.concatenate([train_img, test_img]), axis=0)
  
      train_img = train_img - mean_img
      test_img = test_img - mean_img
      train_y = train_label - 1  # 0-based label
      test_y = test_label - 1  # 0-based label
  
      train_label = np.eye(10)[train_y]
      test_label = np.eye(10)[test_y]
  
      return train_img, train_label, test_img, test_label
  
file_path: cleverhans/cleverhans_v3.1.0/examples/multigpu_advtrain/utils_svhn.py
imports: from __future__ import absolute_import, division, print_function, unicode_literals
  import os
  import numpy
  from six.moves import range
  import tensorflow
  import scipy.io
label_desc: Use image node_id 1 for calling a global function with example usage: read_SVHN(data_folder) and returns: train_img,  train_label,  test_img,  test_label