code: def read_CIFAR10(data_folder):
      """Reads and parses examples from CIFAR10 data files"""
  
      train_img = []
      train_label = []
      test_img = []
      test_label = []
  
      train_file_list = [
          "data_batch_1",
          "data_batch_2",
          "data_batch_3",
          "data_batch_4",
          "data_batch_5",
      ]
      test_file_list = ["test_batch"]
  
      if "CIFAR10_PATH" in os.environ:
          cifar10_path = os.environ["CIFAR10_PATH"]
      else:
          cifar10_path = "cifar-10-batches-py"
  
      for i in range(len(train_file_list)):
          tmp_dict = unpickle(
              os.path.join(
                  data_folder, cifar10_path, train_file_list[i]
              )
          )
  
          train_img.append(tmp_dict["data"])
          train_label.append(tmp_dict["labels"])
  
      tmp_dict = unpickle(
          os.path.join(data_folder, cifar10_path, test_file_list[0])
      )
      test_img.append(tmp_dict["data"])
      test_label.append(tmp_dict["labels"])
  
      train_img = np.concatenate(train_img)
      train_label = np.concatenate(train_label)
      test_img = np.concatenate(test_img)
      test_label = np.concatenate(test_label)
  
      train_img = np.reshape(
          train_img,
          [NUM_TRAIN_IMG, NUM_CHANNEL, IMAGE_HEIGHT, IMAGE_WIDTH],
      )
      test_img = np.reshape(
          test_img,
          [NUM_TEST_IMG, NUM_CHANNEL, IMAGE_HEIGHT, IMAGE_WIDTH],
      )
  
      # change format from [B, C, H, W] to [B, H, W, C] for feeding to Tensorflow
      train_img = np.transpose(train_img, [0, 2, 3, 1])
      test_img = np.transpose(test_img, [0, 2, 3, 1])
  
      mean_img = np.mean(np.concatenate([train_img, test_img]), axis=0)
  
      CIFAR10_data = {}
      CIFAR10_data["train_img"] = train_img - mean_img
      CIFAR10_data["test_img"] = test_img - mean_img
      CIFAR10_data["train_label"] = train_label
      CIFAR10_data["test_label"] = test_label
  
      train_img = train_img - mean_img
      test_img = test_img - mean_img
      train_label = train_label
      test_label = test_label
  
      train_label = np.eye(10)[train_label]
      test_label = np.eye(10)[test_label]
  
      return train_img, train_label, test_img, test_label
  
file_path: cleverhans/cleverhans_v3.1.0/examples/multigpu_advtrain/utils_cifar.py
imports: from __future__ import absolute_import, division, print_function, unicode_literals
  import os
  import cPickle
  import numpy
  from six.moves import range
  import tensorflow
label_desc: Use image node_id 2 for calling a global function with example usage: read_CIFAR10(data_folder) and returns: train_img,  train_label,  test_img,  test_label