code: def row_to_sample(row, schema, feature_cols, label_cols):
      from bigdl.dllib.utils.common import Sample
  
      if label_cols:
          feature, label = convert_row_to_numpy(
              row, schema, feature_cols, label_cols
          )
          sample = Sample.from_ndarray(feature, label)
      else:
          (feature,) = convert_row_to_numpy(
              row, schema, feature_cols, label_cols
          )
          sample = Sample.from_ndarray(feature, np.array([0.0]))
      return sample
  
imports: from bigdl.dllib.utils.file_utils import get_file_list, callZooFunc
  from bigdl.dllib.utils.utils import convert_row_to_numpy
  from bigdl.dllib.utils.common import *
  from bigdl.dllib.utils.log4Error import *
  import pyspark.sql.functions
  from typing import TYPE_CHECKING, Dict, List, Optional, Type, Union
  from numpy import float32, int32
label_desc: Use image node_id 11 for calling a global function with example usage: row_to_sample(row, schema, feature_cols, label_cols) and returns: sample