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)
  
file_path: NeMo/nemo/collections/vision/data/megatron/image_folder.py
imports: import os
  import os.path
  from typing import Any, Callable, Dict, List, Optional, Tuple, cast
  import numpy
  from PIL import Image
  from nemo.utils import logging
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