code: def _prepare_lab_array(arr):
      """Ensure input for lab2lch, lch2lab are well-posed.
      Arrays must be in floating point and have at least 3 elements in
      last dimension.  Return a new array.
      """
      arr = np.asarray(arr)
      shape = arr.shape
      if shape[-1] < 3:
          raise ValueError("Input array has less than 3 color channels")
      return img_as_float(arr, force_copy=True)
  
imports: import numpy
  from scipy import linalg
  from warnings import warn
label_desc: Use image node_id 7 for calling a global function with example usage: _prepare_lab_array(arr) and returns: img_as_float