code: def test_from_data_frame_cat(spark_context):
      features = np.ones((2, 10))
      labels = np.asarray([[0, 0, 1.0], [0, 1.0, 0]])
  
      data_frame = adapter.to_data_frame(
          spark_context, features, labels, categorical=True
      )
  
      x, y = adapter.from_data_frame(
          data_frame, categorical=True, nb_classes=3
      )
      assert features.shape == x.shape
      assert labels.shape == y.shape
  
imports: import numpy
  from elephas.ml import adapter
label_desc: Use image node_id 4 for calling a global function with example usage: test_from_data_frame_cat(spark_context) without return types