code: def load_data(filepath):
      with gzip.open(filepath, "rb") as f:
          train_set, valid_set, test_set = pickle.load(
              f, encoding="bytes"
          )
          traindata = train_set[0].astype(np.float32)
          validdata = valid_set[0].astype(np.float32)
          testdata = test_set[0].astype(np.float32)
          trainlabel = train_set[1].astype(np.float32)
          validlabel = valid_set[1].astype(np.float32)
          testlabel = test_set[1].astype(np.float32)
          return (
              traindata,
              trainlabel,
              validdata,
              validlabel,
              testdata,
              testlabel,
          )
  
file_path: singa/examples/gan/utils.py
imports: import gzip
  import matplotlib.pyplot
  import numpy
  import os
  import pickle
  import sys
  import time
label_desc: Use image node_id 2 for calling a global function with example usage: load_data(filepath) and returns: traindata,  trainlabel,  validdata,  validlabel,  testdata,  testlabel