code: def write_voc(
      voc_root_path: str,
      splits_names: List[Tuple[int, str]],
      output_path: str,
      **kwargs,
  ) -> None:
      custom_classes = kwargs.get("classes", None)
      voc_datasets = VOCDatasets(
          voc_root_path, splits_names, classes=custom_classes
      )
  
      def make_generator():
          for img_path, label in voc_datasets:
              yield {
                  "image": img_path,
                  "label": label,
                  "image_id": img_path,
              }
  
      image, label = voc_datasets[0]
      label_shape = (-1, label.shape[-1])
      schema = {
          "image": SchemaField(
              feature_type=FeatureType.IMAGE,
              dtype=DType.FLOAT32,
              shape=(),
          ),
          "label": SchemaField(
              feature_type=FeatureType.NDARRAY,
              dtype=ndarray_dtype_to_dtype(label.dtype),
              shape=label_shape,
          ),
          "image_id": SchemaField(
              feature_type=FeatureType.SCALAR,
              dtype=DType.STRING,
              shape=(),
          ),
      }
      kwargs = {
          key: value
          for key, value in kwargs.items()
          if key not in ["classes"]
      }
      ParquetDataset.write(
          output_path, make_generator(), schema, **kwargs
      )
  
imports: from pyspark import SparkContext
  from pyspark.sql import SparkSession
  from bigdl.dllib.nncontext import init_nncontext
  from bigdl.orca.data import SparkXShards
  from bigdl.orca.data.file import open_text, write_text
  from bigdl.orca.data.image.utils import chunks, dict_to_row, row_to_dict, encode_schema, decode_schema, SchemaField, FeatureType, DType, ndarray_dtype_to_dtype, decode_feature_type_ndarray, pa_fs
  from bigdl.orca.data.image.voc_dataset import VOCDatasets
  from bigdl.dllib.utils.common import get_node_and_core_number
  import os
  import numpy
  import random
  import io
  import math
  from bigdl.dllib.utils.log4Error import invalidInputError
  from numpy import ndarray, uint32
  from typing import TYPE_CHECKING, Callable, Dict, List, Optional, Tuple, Union, Any
label_desc: Use image node_id 7 for calling a global function with example usage: write_voc(voc_root_path, splits_names, output_path) without return types