code: def test_array2dict(self):
      from bigdl.orca.learn.utils import arrays2dict
  
      record_num = 100
      shard_size = 30
      data = [
          (
              np.float32(np.random.randn(1, 50)),
              np.float32(
                  [
                      np.random.randint(
                          0,
                          2,
                      )
                  ]
              ),
          )
          for i in range(record_num)
      ]
      result = arrays2dict(
          data,
          feature_cols=["feature"],
          label_cols=["label"],
          shard_size=shard_size,
      )
      for i, d in enumerate(result):
          if (record_num % shard_size == 0) or (
              i != record_num // shard_size
          ):
              assert d["x"].shape[0] == shard_size
              assert d["y"].shape[0] == shard_size
          else:
              assert d["x"].shape[0] == record_num % shard_size
              assert d["y"].shape[0] == record_num % shard_size
  
imports: from unittest import TestCase
  import os
  import pytest
  import numpy
  from pyspark.sql.types import ArrayType, DoubleType
  from bigdl.orca import init_orca_context, stop_orca_context
  from bigdl.orca.data import SparkXShards
  from bigdl.orca.data.image.utils import chunks
  from bigdl.orca.learn.utils import convert_predict_rdd_to_dataframe, _dataframe_to_xshards, convert_predict_xshards_to_dataframe, convert_predict_rdd_to_xshard, update_predict_xshards
label_desc: Use image node_id 11 for calling the TestUtil obj's underlying member method code with example usage: obj.test_array2dict() without return types