code: def _labels_to_mnist_file(labels, filepath):
      assert len(labels.shape) == 1
      assert labels.dtype == np.uint8
  
      with open(filepath, "wb") as f:
          f.write(int(2049).to_bytes(4, "big"))
  
          f.write(
              np.array(labels.shape)
              .astype(np.int32)
              .byteswap()
              .tobytes()
          )
          f.write(labels.tobytes())
  
file_path: BigDL/python/orca/test/bigdl/orca/data/test_write_parquet.py
imports: import tempfile
  import shutil
  import pytest
  import numpy
  import os
  from bigdl.orca.data.image.parquet_dataset import ParquetDataset
  from bigdl.orca.data.image.parquet_dataset import write_from_directory, write_parquet
  from bigdl.orca.data.image.utils import DType, FeatureType, SchemaField
  from bigdl.orca.data.image import write_mnist, write_voc
label_desc: Use image node_id 4 for calling a global function with example usage: _labels_to_mnist_file(labels, filepath) without return types