code: def test_directory_parsing_label_dataset(self):
      dataset = DirectoryParsingLabelDataset(
          self.tmp_dir, color=self.color
      )
  
      if self.depth == 1:
          expected_legnth = self.n_img_per_class * self.n_class
      elif self.depth == 2:
          expected_legnth = (
              self.n_img_per_class * self.n_sub_directory * self.n_class
          )
      self.assertEqual(len(dataset), expected_legnth)
  
      assert_is_label_dataset(dataset, self.n_class, color=self.color)
  
      label_names = directory_parsing_label_names(self.tmp_dir)
      self.assertEqual(
          label_names,
          ["class_{}".format(i) for i in range(self.n_class)],
      )
  
      if self.depth == 1:
          self.assertEqual(
              dataset.img_paths,
              [
                  "{}/class_{}/img{}.{}".format(
                      self.tmp_dir, i, j, self.suffix
                  )
                  for i in range(self.n_class)
                  for j in range(self.n_img_per_class)
              ],
          )
      elif self.depth == 2:
          self.assertEqual(
              dataset.img_paths,
              [
                  "{}/class_{}/nested_{}/img{}.{}".format(
                      self.tmp_dir, i, j, k, self.suffix
                  )
                  for i in range(self.n_class)
                  for j in range(self.n_sub_directory)
                  for k in range(self.n_img_per_class)
              ],
          )
  
imports: import numpy
  import os
  import shutil
  import tempfile
  import unittest
  from chainer import testing
  from chainercv.datasets import directory_parsing_label_names
  from chainercv.datasets import DirectoryParsingLabelDataset
  from chainercv.utils import assert_is_label_dataset
  from chainercv.utils import write_image
label_desc: Use image node_id 3 for calling the TestDirectoryParsingLabelDataset obj's underlying member method code with example usage: obj.test_directory_parsing_label_dataset() without return types