code: def _iter_valid_files(directory, white_list_formats, follow_links):
      """Iterates on files with extension in `white_list_formats` contained in `directory`.
  
      # Arguments
          directory: Absolute path to the directory
              containing files to be counted
          white_list_formats: Set of strings containing allowed extensions for
              the files to be counted.
          follow_links: Boolean, follow symbolic links to subdirectories.
  
      # Yields
          Tuple of (root, filename) with extension in `white_list_formats`.
      """
  
      def _recursive_list(subpath):
          return sorted(
              os.walk(subpath, followlinks=follow_links),
              key=lambda x: x[0],
          )
  
      for root, _, files in _recursive_list(directory):
          for fname in sorted(files):
              if fname.lower().endswith(".tiff"):
                  warnings.warn(
                      'Using ".tiff" files with multiple bands '
                      "will cause distortion. Please verify your output."
                  )
              if fname.lower().endswith(white_list_formats):
                  yield root, fname
  
file_path: keras-preprocessing/keras_preprocessing/image/utils.py
imports: import io
  import os
  import warnings
  from pathlib import Path
  import numpy
label_desc: Use image node_id 5 for calling a global function with example usage: _iter_valid_files(directory, white_list_formats, follow_links) and returns: sorted