code: def test_image_decode_example(shared_datadir):
      import PIL.Image
  
      image_path = str(shared_datadir / "test_image_rgb.jpg")
      image = Image()
      decoded_example = image.decode_example(
          {"path": image_path, "bytes": None}
      )
  
      assert isinstance(decoded_example, PIL.Image.Image)
      assert os.path.samefile(decoded_example.filename, image_path)
      assert decoded_example.size == (640, 480)
      assert decoded_example.mode == "RGB"
  
      with pytest.raises(RuntimeError):
          Image(decode=False).decode_example(image_path)
  
imports: import os
  import tarfile
  import warnings
  import numpy
  import pandas
  import pyarrow
  import pytest
  from datasets import Dataset, Features, Image, Sequence, Value, concatenate_datasets, load_dataset
  from datasets.features.image import encode_np_array, image_to_bytes
  from ..utils import require_pil
label_desc: Use image node_id 6 for calling a global function with example usage: test_image_decode_example(shared_datadir) without return types