code: def test_write_voc(orca_context_fixture, use_api=False):
      sc = orca_context_fixture
      temp_dir = tempfile.mkdtemp()
      try:
          from bigdl.orca.data import SparkXShards
  
          dataset_path = os.path.join(resource_path, "VOCdevkit")
          output_path = os.path.join(temp_dir, "output_dataset")
          if use_api:
              write_parquet(
                  "voc",
                  "file://" + output_path,
                  voc_root_path=dataset_path,
                  splits_names=[(2007, "trainval")],
              )
          else:
              write_voc(
                  dataset_path,
                  splits_names=[(2007, "trainval")],
                  output_path="file://" + output_path,
              )
  
          data, schema = ParquetDataset._read_as_dict_rdd(
              "file://" + output_path
          )
          data = data.collect()[0]
          image_path = data["image_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 6 for calling a global function with example usage: test_write_voc(orca_context_fixture, use_api) without return types