code: def convert_to_ofrecord(img_data):
      """Convert python dictionary formath data of one image to of.Example proto.
      Args:
        img_data: Python dict.
      Returns:
        example: The converted of.Exampl
      """
  
      def _int32_feature(value):
          """Wrapper for inserting int32 features into Example proto."""
          if not isinstance(value, list):
              value = [value]
          return of_record.Feature(
              int32_list=of_record.Int32List(value=value)
          )
  
      def _float_feature(value):
          """Wrapper for inserting float features into Example proto."""
          if not isinstance(value, list):
              value = [value]
          return of_record.Feature(
              float_list=of_record.FloatList(value=value)
          )
  
      def _double_feature(value):
          """Wrapper for inserting float features into Example proto."""
          if not isinstance(value, list):
              value = [value]
          return of_record.Feature(
              double_list=of_record.DoubleList(value=value)
          )
  
      def _bytes_feature(value):
          """Wrapper for inserting bytes features into Example proto."""
          # if isinstance(value, six.string_types):
          #  value = six.binary_type(value, encoding='utf-8')
          return of_record.Feature(
              bytes_list=of_record.BytesList(value=[value])
          )
  
      example = of_record.OFRecord(
          feature={
              "label": _int32_feature(img_data["label"]),
              "encoded": _bytes_feature(img_data["pixel_data"]),
          }
      )
  
      return example
  
file_path: insightface/recognition/arcface_oneflow/tools/mx_recordio_2_ofrecord_shuffled_npart.py
imports: import os
  import sys
  import struct
  import argparse
  import numbers
  import random
  from mxnet import recordio
  import oneflow.core.record.record_pb2
label_desc: Use image node_id 3 for calling a global function with example usage: convert_to_ofrecord(img_data) and returns: example, of_record, of_record, of_record, of_record