code: def test_load_images(self):
      image_url_dir = current_file_dir + "/images"
      # Test auto format, with path and recursive
      sf1 = image_analysis.load_images(
          image_url_dir, "auto", True, True
      )
      self.assertEqual(sf1.num_columns(), 2)
      self.assertEqual(sf1.num_rows(), 18)
      self.assertEqual(sf1["image"].dtype, image.Image)
  
      # Test auto format, with path and non recursive
      sf2 = image_analysis.load_images(
          image_url_dir, "auto", True, False
      )
      self.assertEqual(sf2.num_columns(), 2)
      self.assertEqual(sf2.num_rows(), 2)
      self.assertEqual(sf2["image"].dtype, image.Image)
  
      # Test auto format, without path and recursive
      sf3 = image_analysis.load_images(
          image_url_dir, "auto", False, True
      )
      self.assertEqual(sf3.num_columns(), 1)
      self.assertEqual(sf3.num_rows(), 18)
      self.assertEqual(sf3["image"].dtype, image.Image)
  
      # Test auto format, without path and non recursive
      sf4 = image_analysis.load_images(
          image_url_dir, "auto", False, False
      )
      self.assertEqual(sf4.num_columns(), 1)
      self.assertEqual(sf4.num_rows(), 2)
  
      # Confirm that load_images works with a single image as well
      sf5 = image_analysis.load_images(
          image_url_dir + "/sample.jpg", "auto", False, False
      )
      self.assertEqual(sf5.num_columns(), 1)
      self.assertEqual(sf5.num_rows(), 1)
  
      # Expect error when trying to load PNG image as JPG
      with self.assertRaises(RuntimeError):
          image_analysis.load_images(
              image_url_dir, "JPG", ignore_failure=False
          )
  
      # Expect error when trying to load JPG image as PNG
      with self.assertRaises(RuntimeError):
          image_analysis.load_images(
              image_url_dir, "PNG", ignore_failure=False
          )
  
      # Setting ignore_failure to True, and we should be able to load images
      # to our best effort without throwing error
      image_analysis.load_images(
          image_url_dir, "JPG", ignore_failure=True
      )
      image_analysis.load_images(
          image_url_dir, "PNG", ignore_failure=True
      )
  
imports: from __future__ import print_function
  from __future__ import division
  from __future__ import absolute_import
  import array
  import unittest
  from PIL import Image
  import os
  from ..data_structures import image
  from ..None import SArray
  from ..toolkits.image_analysis import image_analysis
  from ..toolkits._main import ToolkitError
  from .._deps import numpy, HAS_NUMPY
label_desc: Use image node_id 7 for calling the ImageClassTest obj's underlying member method code with example usage: obj.test_load_images() without return types