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):
          invalidInputError(False, "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:
              invalidInputError(False, "Wrong type: %s" % type(element))
  
      return results
  
imports: import functools
  import glob
  import os
  import subprocess
  import tempfile
  import uuid
  from urllib.parse import urlparse
  import numpy
  from bigdl.dllib.utils.common import Sample, JTensor, JavaCreator, _get_gateway, _py2java, _java2py
  from bigdl.dllib.utils.log4Error import *
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