code: def test_dataframe_iterator_with_custom_indexed_dataframe(
      all_test_images, tmpdir
  ):
      num_classes = 2
  
      # 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
  
      # create dataframes
      classes = np.random.randint(num_classes, size=len(filenames))
      classes = [str(c) for c in classes]
      df = pd.DataFrame({"filename": filenames, "class": classes})
      df2 = pd.DataFrame(
          {"filename": filenames, "class": classes},
          index=np.arange(1, len(filenames) + 1),
      )
      df3 = pd.DataFrame(
          {"filename": filenames, "class": classes}, index=filenames
      )
  
      # create iterators
      seed = 1
      generator = image_data_generator.ImageDataGenerator()
      df_iterator = generator.flow_from_dataframe(
          df, str(tmpdir), seed=seed
      )
      df2_iterator = generator.flow_from_dataframe(
          df2, str(tmpdir), seed=seed
      )
      df3_iterator = generator.flow_from_dataframe(
          df3, str(tmpdir), seed=seed
      )
  
      # Test all iterators return same pairs of arrays
      for _ in range(len(filenames)):
          a1, c1 = next(df_iterator)
          a2, c2 = next(df2_iterator)
          a3, c3 = next(df3_iterator)
          assert np.array_equal(a1, a2)
          assert np.array_equal(a1, a3)
          assert np.array_equal(c1, c2)
          assert np.array_equal(c1, c3)
  
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 10 for calling a global function with example usage: test_dataframe_iterator_with_custom_indexed_dataframe(all_test_images, tmpdir) without return types