code: def get_image_from_path(image_path, image_mode):
      """Get image from path.
  
      :param image_path: The path to the image.
      :type image_path: str
      :param image_mode: The mode to open the image in.
          See pillow documentation for all modes:
          https://pillow.readthedocs.io/en/stable/handbook/concepts.html
      :type image_mode: str
      :return: The image as a numpy array.
      :rtype: numpy.ndarray
      """
      image_open_pointer = image_path
      if image_path.startswith("http://") or image_path.startswith(
          "https://"
      ):
          response = _get_retry_session(image_path).get(image_path)
          image_open_pointer = BytesIO(response.content)
      with Image.open(image_open_pointer) as im:
          if image_mode is not None:
              im = im.convert(image_mode)
          image_array = np.asarray(im)
      return image_array
  
file_path: responsible-ai-toolbox/rai_test_utils/rai_test_utils/datasets/vision/object_detection_data_utils.py
imports: import os
  import urllib.request
  import xml.etree.ElementTree
  from io import BytesIO
  from urllib.parse import urlparse
  from zipfile import ZipFile
  import numpy
  import pandas
  import requests
  from PIL import Image
  from requests.adapters import HTTPAdapter
  from requests.packages.urllib3.util.retry import Retry
label_desc: Use image node_id 2 for calling a global function with example usage: get_image_from_path(image_path, image_mode) and returns: image_array