code: def write_imagenet(
      imagenet_path: str, output_path: str, **kwargs
  ) -> None:
      """
      Write ImageNet data to TFRecords file format. The train and validation data will be
      converted into 1024 and 128 TFRecord files, respectively. Each train TFRecord file
      contains ~1250 records. Each validation TFRecord file contains ~390 records.
  
      Each record within the TFRecord file is a serialized Example proto. The Example proto
      contains the following fields:
  
      image/height: integer, image height in pixels
      image/width: integer, image width in pixels
      image/colorspace: string, specifying the colorspace, always 'RGB'
      image/channels: integer, specifying the number of channels, always 3
      image/class/label: integer, identifier for the ground truth for the network
      image/class/synset: string, unique WordNet ID specifying the label, e.g., 'n02323233'
      image/format: string, specifying the format, always'JPEG'
      image/filename: string, path to an image file, e.g., '/path/to/example.JPG'
      image/encoded: string containing JPEG encoded image in RGB colorspace
  
      Args:
      imagenet_path: ImageNet raw data path. Download raw ImageNet data from
                     http://image-net.org/download-images
                     e.g, if you use ImageNet 2012, please extract ILSVRC2012_img_train.tar and
                     ILSVRC2012_img_val.tar. Download the validation image labels file
                     https://github.com/tensorflow/models/blob/master/research/slim/datasets/
                     imagenet_2012_validation_synset_labels.txt and rename as synset_labels.txt
                     provide imagenet path in this format:
                     - Training images: train/n03062245/n03062245_4620.JPEG
                     - Validation Images: validation/ILSVRC2012_val_00000001.JPEG
                     - Validation Labels: synset_labels.txt
      output_path: Output data directory
  
      """
      if not imagenet_path:
          invalidInputError(
              False,
              "ImageNet data path should not be empty. Please download "
              "from http://image-net.org/download-images and extract .tar "
              "and provide raw data directory path",
          )
      convert_imagenet_to_tf_records(
          imagenet_path, output_path, **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 1 for calling a global function with example usage: write_imagenet(imagenet_path, output_path) without return types