code: def from_pil(pil_img):
      """
      Convert a PIL.Image.Image into towhee.types.Image.
  
      Args:
          pil_img (`PIL.Image.Image`):
              A PIL image.
  
      Returns:
          (`towhee.types.Image`)
              The image wrapepd as towhee Image.
      """
      # pylint: disable=import-outside-toplevel
      import numpy as np
  
      return Image(np.array(pil_img), pil_img.mode)
  
imports: from towhee.types import Image
label_desc: Use image node_id 2 for calling a global function with example usage: from_pil(pil_img) and returns: Image