code: def validate_filename(filename, white_list_formats):
      """Check if a filename refers to a valid file.
  
      # Arguments
          filename: String, absolute path to a file
          white_list_formats: Set, allowed file extensions
  
      # Returns
          A boolean value indicating if the filename is valid or not
      """
      return filename.lower().endswith(
          white_list_formats
      ) and os.path.isfile(filename)
  
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 1 for calling a global function with example usage: validate_filename(filename, white_list_formats) and returns: unknown