code: def check_valid_image(path_to_image):
      """
      Function to check if a file has valid image extensions and return True if it does.
      Note: Azure Cognitive Services only accepts below file formats.
      """
      valid_extensions = (
          ".png",
          ".jpg",
          ".jpeg",
          ".gif",
          ".bmp",
          ".jfif",
      )
      if path_to_image.endswith(valid_extensions):
          return True
  
file_path: shap/shap/utils/image.py
imports: import os
  from textwrap import wrap
  import cv2
  import matplotlib.pyplot
  import numpy
  import shap
label_desc: Use image node_id 5 for calling a global function with example usage: check_valid_image(path_to_image) and returns: True