code: def get_possible_image_paths(path):
      image_path = path.split(".")
      # Image path might contain file extension (e.g. .jpg),
      # In this case, we want the path without the extension
      image_path = (
          image_path if len(image_path) == 1 else image_path[:-1]
      )
      for ext in tv_helpers.IMG_EXTENSIONS:
          image_ext = ".".join(image_path) + ext
          if PathManager.isfile(image_ext):
              path = image_ext
              break
      return path
  
imports: import collections
  import os
  import torch
  import torchvision
  import torchvision.datasets.folder
  from mmf.utils.file_io import PathManager
  from mmf.utils.general import get_absolute_path
  from PIL import Image
label_desc: Use image node_id 1 for calling a global function with example usage: get_possible_image_paths(path) and returns: path