code: def test_dataframe_iterator_n(all_test_images, tmpdir):
      # save the images in the tmpdir
      count = 0
      filenames = []
      for test_images in all_test_images:
          for im in test_images:
              filename = "image-{}.png".format(count)
              filenames.append(filename)
              im.save(str(tmpdir / filename))
              count += 1
  
      # exclude first two items
      n_files = len(filenames)
      input_filenames = filenames[2:]
  
      # create dataframes
      classes = np.random.randint(2, size=len(input_filenames))
      classes = [str(c) for c in classes]
      df = pd.DataFrame({"filename": input_filenames})
      df2 = pd.DataFrame(
          {"filename": input_filenames, "class": classes}
      )
  
      # create iterators
      generator = image_data_generator.ImageDataGenerator()
      df_iterator = generator.flow_from_dataframe(
          df, str(tmpdir), class_mode=None
      )
      df2_iterator = generator.flow_from_dataframe(
          df2, str(tmpdir), class_mode="binary"
      )
  
      # Test the number of items in iterators
      assert df_iterator.n == n_files - 2
      assert df2_iterator.n == n_files - 2
  
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 11 for calling a global function with example usage: test_dataframe_iterator_n(all_test_images, tmpdir) without return types