code: def img_to_base64(image: Union[Image.Image, List[Image.Image]]):
      """
      Returns base64 encoded strings of PIL Image objects
      """
      is_list = False
  
      if type(image) == list:
          is_list = True
  
      if not is_list:
          image = [image]
  
      images = []
      for img in image:
          buffered = BytesIO()
          img.save(buffered, format=img.format)
          img = base64.b64encode(buffered.getvalue())
          images.append(img)
  
      if not is_list:
          images = images[0]
  
      return images
  
file_path: backprop/backprop/utils/helpers.py
imports: from PIL import Image
  from io import BytesIO
  from typing import Union, List
  import base64
  import os
label_desc: Use image node_id 3 for calling a global function with example usage: img_to_base64(image) and returns: images