code: def test_write_parquet_images(orca_context_fixture):
      sc = orca_context_fixture
      temp_dir = tempfile.mkdtemp()
  
      def generator():
          dataset_path = os.path.join(resource_path, "cat_dog")
          for root, dirs, files in os.walk(
              os.path.join(dataset_path, "cats")
          ):
              for name in files:
                  image_path = os.path.join(root, name)
                  yield {
                      "image": image_path,
                      "label": 1,
                      "id": image_path,
                  }
  
          for root, dirs, files in os.walk(
              os.path.join(dataset_path, "dogs")
          ):
              for name in files:
                  image_path = os.path.join(root, name)
                  yield {
                      "image": image_path,
                      "label": 0,
                      "id": image_path,
                  }
  
      schema = {
          "image": SchemaField(
              feature_type=FeatureType.IMAGE,
              dtype=DType.FLOAT32,
              shape=(10,),
          ),
          "label": SchemaField(
              feature_type=FeatureType.NDARRAY,
              dtype=DType.FLOAT32,
              shape=(4,),
          ),
          "id": SchemaField(
              feature_type=FeatureType.SCALAR,
              dtype=DType.STRING,
              shape=(),
          ),
      }
  
      try:
          ParquetDataset.write(
              "file://" + temp_dir, generator(), schema
          )
          data, schema = ParquetDataset._read_as_dict_rdd(
              "file://" + temp_dir
          )
          data = data.collect()[0]
          image_path = data["id"]
          with open(image_path, "rb") as f:
              image_bytes = f.read()
  
          assert image_bytes == data["image"]
  
      finally:
          shutil.rmtree(temp_dir)
  
file_path: BigDL/python/orca/test/bigdl/orca/data/test_write_parquet.py
imports: import tempfile
  import shutil
  import pytest
  import numpy
  import os
  from bigdl.orca.data.image.parquet_dataset import ParquetDataset
  from bigdl.orca.data.image.parquet_dataset import write_from_directory, write_parquet
  from bigdl.orca.data.image.utils import DType, FeatureType, SchemaField
  from bigdl.orca.data.image import write_mnist, write_voc
label_desc: Use image node_id 2 for calling a global function with example usage: test_write_parquet_images(orca_context_fixture) without return types