code: def test_list_pictures(tmpdir):
      filenames = [
          "test.png",
          "test0.jpg",
          "test-1.jpeg",
          "2test.bmp",
          "2-test.ppm",
          "3.png",
          "1.jpeg",
          "test.bmp",
          "test0.ppm",
          "test4.tiff",
          "5-test.tif",
          "test.txt",
          "foo.csv",
          "face.gif",
          "bar.txt",
      ]
      subdirs = ["", "subdir1", "subdir2"]
      filenames = [
          tmpdir.ensure(subdir, f)
          for subdir in subdirs
          for f in filenames
      ]
  
      found_images = utils.list_pictures(str(tmpdir))
      assert len(found_images) == 33
  
      found_images = utils.list_pictures(str(tmpdir), ext="png")
      assert len(found_images) == 6
  
file_path: keras-preprocessing/tests/image/utils_test.py
imports: import io
  import resource
  from pathlib import Path
  import numpy
  import PIL
  import pytest
  from keras_preprocessing.image import utils
label_desc: Use image node_id 3 for calling a global function with example usage: test_list_pictures(tmpdir) without return types