code: def read_parquet(
      format: str,
      path: str,
      transforms: Optional[Callable] = None,
      config: Optional[Dict[str, int]] = None,
      batch_size: int = 1,
      *args,
      **kwargs,
  ) -> Union["tf.data.Dataset", "DataLoader"]:
      supported_format = {"tf_dataset", "dataloader"}
      if format not in supported_format:
          invalidInputError(
              False,
              format
              + " is not supported, should be 'tf_dataset' or 'dataloader'.",
          )
  
      format_to_function = {
          "tf_dataset": (read_as_tfdataset, ["output_types"]),
          "dataloader": (read_as_dataloader, []),
      }  # type: Dict[str, Tuple]
      func, required_args = format_to_function[format]
      _check_arguments(format, kwargs, required_args)
      return func(
          path=path,
          config=config or {},
          transforms=transforms,
          batch_size=batch_size,
          *args,
          **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 12 for calling a global function with example usage: read_parquet(format, path, transforms, config, batch_size) and returns: func