code: def write_parquet(format, output_path, *args, **kwargs):
      supported_format = {"mnist", "image_folder", "voc"}
      if format not in supported_format:
          raise ValueError(
              format + " is not supported, should be one of 'mnist',"
              "'image_folder' and 'voc'."
          )
  
      format_to_function = {
          "mnist": (write_mnist, ["image_file", "label_file"]),
          "image_folder": (
              write_from_directory,
              ["directory", "label_map"],
          ),
          "voc": (write_voc, ["voc_root_path", "splits_names"]),
      }
      func, required_args = format_to_function[format]
      _check_arguments(format, kwargs, required_args)
      func(output_path=output_path, *args, **kwargs)
  
imports: from pyspark import SparkContext
  from pyspark.sql import SparkSession
  from zoo import init_nncontext
  from zoo.orca.data import SparkXShards
  from zoo.orca.data.file import open_text, write_text
  from zoo.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 zoo.orca.data.image.voc_dataset import VOCDatasets
  from bigdl.util.common import get_node_and_core_number
  import os
  import numpy
  import random
  import pyarrow.parquet
  import io
  import math
label_desc: Use image node_id 9 for calling a global function with example usage: write_parquet(format, output_path) without return types