code: def test_pil_encoding():
      image_feat = features_lib.Image(encoding_format="png")
      x = np.uint8(np.array([[[1.0, 2.0, 3.0], [4.0, 5.0, 6.0]]]))
      pil_image = PIL.Image.fromarray(x)
      pil_image.format = "png"
      encoded_example = image_feat.encode_example(pil_image)
  
      assert isinstance(encoded_example, bytes)
  
imports: import contextlib
  import enum
  import os
  import pathlib
  from typing import Optional, Type
  from absl.testing import parameterized
  import numpy
  import PIL
  import pytest
  import tensorflow
  import tensorflow_datasets
  from tensorflow_datasets import testing
  from tensorflow_datasets.core import features
label_desc: Use image node_id 6 for calling a global function with example usage: test_pil_encoding() without return types