code: def write_tfrecord(
      format: str, output_path: str, *args, **kwargs
  ) -> None:
      """
      Convert input dataset to TFRecords
  
      Args:
      format: String. Support "imagenet" format.
      output_path: String. output path.
  
      """
      supported_format = {"imagenet"}
      if format not in supported_format:
          invalidInputError(
              False,
              format + " is not supported, should be 'imagenet'. ",
          )
  
      format_to_function = {
          "imagenet": (write_imagenet, ["imagenet_path"])
      }
      func, required_args = format_to_function[format]
      _check_arguments(format, kwargs, required_args)
  
      kwargs["output_path"] = output_path
      func(*args, **kwargs)
  
file_path: BigDL/python/orca/src/bigdl/orca/data/image/tfrecord_dataset.py
imports: import os
  from bigdl.orca.data.image.imagenet_dataset import *
  from bigdl.orca.data.image.parquet_dataset import _check_arguments
  from bigdl.dllib.utils.log4Error import invalidInputError
  from typing import TYPE_CHECKING, List
label_desc: Use image node_id 4 for calling a global function with example usage: write_tfrecord(format, output_path) without return types