code: def to_pil(img: Image):
      """
      Convert a towhee.types.Image into PIL.Image.Image.
  
      Args:
          img (`towhee.types.Image`):
              A towhee image.
  
      Returns (`PIL.Image.Image`):
              A PIL image.
      """
      # pylint: disable=import-outside-toplevel
      from towhee.utils.pil_utils import PILImage
  
      return PILImage.fromarray(img, img.mode)
  
imports: from towhee.types import Image
label_desc: Use image node_id 3 for calling a global function with example usage: to_pil(img) and returns: PILImage