code: def _preprocess_cifar(images, labels, withlabel, ndim, scale, dtype):
      if ndim == 1:
          images = images.reshape(-1, 3072)
      elif ndim == 3:
          images = images.reshape(-1, 3, 32, 32)
      else:
          raise ValueError("invalid ndim for CIFAR dataset")
      dtype = chainer.get_dtype(dtype)
      images = images.astype(dtype)
      images *= scale / 255.0
  
      if withlabel:
          labels = labels.astype(numpy.int32)
          return tuple_dataset.TupleDataset(images, labels)
      else:
          return images
  
file_path: chainer/chainer/datasets/cifar.py
imports: import os
  import sys
  import tarfile
  import numpy
  import six.moves.cPickle
  import chainer
  from chainer.dataset import download
  from chainer.datasets import tuple_dataset
label_desc: Use image node_id 4 for calling a global function with example usage: _preprocess_cifar(images, labels, withlabel, ndim, scale, dtype) and returns: tuple_dataset, images