code: def iter_valid_files(directory, follow_links, formats):
      walk = os.walk(directory, followlinks=follow_links)
      for root, _, files in sorted(walk, key=lambda x: x[0]):
          for fname in sorted(files):
              if fname.lower().endswith(formats):
                  yield root, fname
  
file_path: autokeras/autokeras/utils/io_utils.py
imports: import json
  import multiprocessing
  import os
  from typing import Optional
  from typing import Tuple
  import numpy
  import tensorflow
  from keras_tuner.engine import hyperparameters
label_desc: Use image node_id 4 for calling a global function with example usage: iter_valid_files(directory, follow_links, formats) without return types