code: def test_dataframe_iterator_with_subdirs(all_test_images, tmpdir):
      num_classes = 2
  
      # create folders and subfolders
      paths = []
      for cl in range(num_classes):
          class_directory = "class-{}".format(cl)
          classpaths = [
              class_directory,
              os.path.join(class_directory, "subfolder-1"),
              os.path.join(class_directory, "subfolder-2"),
              os.path.join(
                  class_directory, "subfolder-1", "sub-subfolder"
              ),
          ]
          for path in classpaths:
              tmpdir.join(path).mkdir()
          paths.append(classpaths)
  
      # save the images in the paths
      count = 0
      filenames = []
      for test_images in all_test_images:
          for im in test_images:
              # rotate image class
              im_class = count % num_classes
              # rotate subfolders
              classpaths = paths[im_class]
              filename = os.path.join(
                  classpaths[count % len(classpaths)],
                  "image-{}.png".format(count),
              )
              filenames.append(filename)
              im.save(str(tmpdir / filename))
              count += 1
  
      # create dataframe
      classes = np.random.randint(num_classes, size=len(filenames))
      classes = [str(c) for c in classes]
      df = pd.DataFrame({"filename": filenames, "class": classes})
  
      # create iterator
      generator = image_data_generator.ImageDataGenerator()
      df_iterator = generator.flow_from_dataframe(
          df, str(tmpdir), class_mode="binary"
      )
  
      # Test the number of items in iterator
      assert df_iterator.n == len(filenames)
      assert set(df_iterator.filenames) == set(filenames)
  
imports: import os
  import random
  import shutil
  import numpy
  import pandas
  import pytest
  from PIL import Image
  from keras_preprocessing.image import dataframe_iterator, image_data_generator
label_desc: Use image node_id 13 for calling a global function with example usage: test_dataframe_iterator_with_subdirs(all_test_images, tmpdir) without return types