code: def test_load_dataset_with_image_feature(
      shared_datadir, data_dir, dataset_loading_script_dir, streaming
  ):
      import PIL.Image
  
      image_path = str(shared_datadir / "test_image_rgb.jpg")
      dset = load_dataset(
          dataset_loading_script_dir,
          split="train",
          data_dir=data_dir,
          streaming=streaming,
      )
      item = dset[0] if not streaming else next(iter(dset))
      assert item.keys() == {"image", "caption"}
      assert isinstance(item["image"], PIL.Image.Image)
      assert os.path.samefile(item["image"].filename, image_path)
      assert item["image"].format == "JPEG"
      assert item["image"].size == (640, 480)
      assert item["image"].mode == "RGB"
  
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 21 for calling a global function with example usage: test_load_dataset_with_image_feature(shared_datadir, data_dir, dataset_loading_script_dir, streaming) without return types