code: def from_ndarray(cls, features, labels, bigdl_type="float"):
      features = to_list_of_numpy(features)
      labels = to_list_of_numpy(labels)
      return cls(
          features=[
              JTensor(feature, feature.shape) for feature in features
          ],
          labels=[JTensor(label, label.shape) for label in labels],
          bigdl_type=bigdl_type,
      )
  
imports: from bigdl.util.common import Sample, JTensor, JavaCreator, _get_gateway, _py2java, _java2py
  import numpy
  import os
  import tempfile
  import uuid
  import functools
  from urllib.parse import urlparse
label_desc: Use image node_id 2 for calling the Sample obj's underlying member method code with example usage: obj.from_ndarray(cls, features, labels, bigdl_type) and returns: cls