class_docstr: MNIST handwritten digits dataset from http://yann.lecun.com/exdb/mnist
  
  Each sample is an image (in 3D NDArray) with shape (28, 28, 1).
  
  Parameters
  ----------
  root : str, default $MXNET_HOME/datasets/mnist
      Path to temp folder for storing data.
  train : bool, default True
      Whether to load the training or testing set.
  transform : function, default None
      DEPRECATED FUNCTION ARGUMENTS.
      A user defined callback that transforms each sample. For example::
  
          transform=lambda data, label: (data.astype(np.float32)/255, label)
class_docstr_tok: ["MNIST","handwritten","digits","dataset","from","http",":","\/\/yann.lecun.com\/exdb\/mnist","Each","sample","is","an","image","(","in","3D","NDArray",")","with","shape","(","28",",","28",",","1",")",".","Parameters","--","--","--","--","--","root",":","str",",","default","$","MXNET_HOME\/datasets\/mnist","Path","to","temp","folder","for","storing","data",".","train",":","bool",",","default","True","Whether","to","load","the","training","or","testing","set",".","transform",":","function",",","default","None","DEPRECATED","FUNCTION","ARGUMENTS",".","A","user","defined","callback","that","transforms","each","sample",".","For","example",":",":","transform=lambda","data",",","label",":","(","data.astype","(","np.float32",")","\/255",",","label",")"]
code: def _get_data(self):
      if self._train:
          data, label = self._train_data, self._train_label
      else:
          data, label = self._test_data, self._test_label
  
      namespace = "gluon/dataset/" + self._namespace
      data_file = download(
          _get_repo_file_url(namespace, data[0]),
          path=self._root,
          sha1_hash=data[1],
      )
      label_file = download(
          _get_repo_file_url(namespace, label[0]),
          path=self._root,
          sha1_hash=label[1],
      )
  
      with gzip.open(label_file, "rb") as fin:
          struct.unpack(">II", fin.read(8))
          label = np.frombuffer(fin.read(), dtype=np.uint8).astype(
              np.int32
          )
          if is_np_array():
              label = _mx_np.array(label, dtype=label.dtype)
  
      with gzip.open(data_file, "rb") as fin:
          struct.unpack(">IIII", fin.read(16))
          data = np.frombuffer(fin.read(), dtype=np.uint8)
          data = data.reshape(len(label), 28, 28, 1)
  
      array_fn = _mx_np.array if is_np_array() else nd.array
      self._data = array_fn(data, dtype=data.dtype)
      self._label = label
  
imports: import os
  import gzip
  import tarfile
  import struct
  import warnings
  import numpy
  from ..None import dataset
  from ...utils import download, check_sha1, _get_repo_file_url
  from ....None import ndarray, image, recordio, base
  from ....None import numpy
  from ....util import is_np_array, default_array
  from ....base import numeric_types
label_desc: Use image node_id 2 for calling the MNIST obj's underlying member method code with example usage: obj._get_data() without return types