code: def is_image_file(filename: str) -> bool:
      """Checks if a file is an allowed image extension.
  
      Args:
          filename (string): path to a file
  
      Returns:
          bool: True if the filename ends with a known image extension
      """
      return has_file_allowed_extension(filename, IMG_EXTENSIONS)
  
imports: import os
  import os.path
  from typing import Any, Callable, cast, Dict, List, Optional, Tuple, Union
  from PIL import Image
  from .vision import VisionDataset
label_desc: Use image node_id 2 for calling a global function with example usage: is_image_file(filename) and returns: has_file_allowed_extension