code: def _load_cifar10():
      def unflatten(images):
          return np.transpose(
              images.reshape((images.shape[0], 3, 32, 32)), [0, 2, 3, 1]
          )
  
      with tempfile.NamedTemporaryFile() as f:
          request.urlretrieve(URLS["cifar10"], f.name)
          tar = tarfile.open(fileobj=f)
          train_data_batches, train_data_labels = [], []
          for batch in range(1, 6):
              data_dict = scipy.io.loadmat(
                  tar.extractfile(
                      "cifar-10-batches-mat/data_batch_{}.mat".format(
                          batch
                      )
                  )
              )
              train_data_batches.append(data_dict["data"])
              train_data_labels.append(data_dict["labels"].flatten())
          train_set = {
              "images": np.concatenate(train_data_batches, axis=0),
              "labels": np.concatenate(train_data_labels, axis=0),
          }
          data_dict = scipy.io.loadmat(
              tar.extractfile("cifar-10-batches-mat/test_batch.mat")
          )
          test_set = {
              "images": data_dict["data"],
              "labels": data_dict["labels"].flatten(),
          }
      train_set["images"] = _encode_png(unflatten(train_set["images"]))
      test_set["images"] = _encode_png(unflatten(test_set["images"]))
      return dict(train=train_set, test=test_set)
  
imports: import collections
  import gzip
  import os
  import tarfile
  import tempfile
  from urllib import request
  import numpy
  import scipy.io
  import tensorflow
  from absl import app
  from tqdm import trange
  from examples.fixmatch.libml.data import core
  from objax.util import EasyDict
  from objax.util.image import to_png
label_desc: Use image node_id 4 for calling a global function with example usage: _load_cifar10() and returns: dict, np