code: def check_retrieval_once(
      self, train_name, test_name, root, retrieval_func
  ):
      self.cached_train_file = os.path.join(root, train_name)
      self.cached_test_file = os.path.join(root, test_name)
  
      train, test = retrieval_func(
          withlabel=self.withlabel,
          ndim=self.ndim,
          scale=self.scale,
          rgb_format=self.rgb_format,
      )
  
      for mnist_dataset in (train, test):
          if self.withlabel:
              self.assertIsInstance(
                  mnist_dataset, tuple_dataset.TupleDataset
              )
              mnist_dataset = mnist_dataset._datasets[0]
          else:
              self.assertIsInstance(mnist_dataset, numpy.ndarray)
  
          if self.ndim == 1:
              self.assertEqual(mnist_dataset.ndim, 2)
          else:
              # self.ndim == 3
              self.assertEqual(mnist_dataset.ndim, 4)
              self.assertEqual(
                  mnist_dataset.shape[2], mnist_dataset.shape[3]
              )
  
imports: import importlib
  import os
  import unittest
  import mock
  import numpy
  from chainer.dataset import download
  from chainer.datasets import get_fashion_mnist
  from chainer.datasets import get_fashion_mnist_labels
  from chainer.datasets import get_kuzushiji_mnist
  from chainer.datasets import get_kuzushiji_mnist_labels
  from chainer.datasets import get_mnist
  from chainer.datasets import tuple_dataset
  from chainer import testing
  from chainer.testing import attr
label_desc: Use image node_id 8 for calling the TestMnist obj's underlying member method code with example usage: obj.check_retrieval_once(train_name, test_name, root, retrieval_func) without return types