code: def has_file_allowed_extension(filename, extensions):
      """Checks if a file is an allowed extension.
  
      Args:
          filename (string): path to a file
          extensions (iterable of strings): extensions to consider (lowercase)
  
      Returns:
          bool: True if the filename ends with one of given extensions
      """
      filename_lower = filename.lower()
      return any(filename_lower.endswith(ext) for ext in extensions)
  
imports: import torch.utils.data
  from torch.utils.data import Dataset
  from torchvision import transforms
  from PIL import Image
  import os
  import os.path
  import sys
label_desc: Use image node_id 1 for calling a global function with example usage: has_file_allowed_extension(filename, extensions) and returns: any