code: def _extract_mnist_labels(labels_filepath):
      with open(labels_filepath, "rb") as bytestream:
          magic = _read32(bytestream)
          if magic != 2049:
              raise ValueError(
                  "Invalid magic number %d in MNIST label file: %s"
                  % (magic, labels_filepath.name)
              )
          num_items = _read32(bytestream)
          buf = bytestream.read(num_items)
          labels = np.frombuffer(buf, dtype=np.uint8)
          return labels
  
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 3 for calling a global function with example usage: _extract_mnist_labels(labels_filepath) and returns: labels