code: def convert_pil_to_image_str(pil_image: PILImage.Image) -> str:
      """Converts PIL image to base64 URL encoded string."""
      buffered = io.BytesIO()
      pil_image.save(buffered, format="PNG")
      img_str = base64.b64encode(buffered.getvalue())
      return "data:image/png;base64," + img_str.decode("utf-8")
  
file_path: lit/lit_nlp/lib/image_utils.py
imports: import base64
  import io
  from typing import Optional
  import matplotlib.cm
  import numpy
  from PIL import Image
  from PIL import ImageEnhance
label_desc: Use image node_id 3 for calling a global function with example usage: convert_pil_to_image_str(pil_image) and returns: unknown