code: def to_list_of_numpy(elements):
      if isinstance(elements, np.ndarray):
          return [elements]
      elif np.isscalar(elements):
          return [np.array(elements)]
      elif not isinstance(elements, list):
          raise ValueError("Wrong type: %s" % type(elements))
  
      results = []
      for element in elements:
          if np.isscalar(element):
              results.append(np.array(element))
          elif isinstance(element, np.ndarray):
              results.append(element)
          else:
              raise ValueError("Wrong type: %s" % type(element))
  
      return results
  
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 a global function with example usage: to_list_of_numpy(elements) and returns: results, list, list