def _prepare_rgba_array(arr):
 arr = np.asanyarray(arr)
 if ((arr.ndim not in [3, 4]) or (arr.shape[(-1)] != 4)):
  msg = 'the input array must have a shape == (.., ..,[ ..,] 4)), got {0}'.format(arr.shape)
  raise ValueError(msg)
 return dtype.img_as_float(arr)

def _prepare_rgba_array ( arr ) : arr = np . asanyarray ( arr ) if ( ( arr . ndim not in [ 3 , 4 ] ) or ( arr . shape [ ( - 1 ) ] != 4 ) ) : msg = 'the input array must have a shape == (.., ..,[ ..,] 4)), got {0}' . format ( arr . shape ) raise ValueError ( msg ) return dtype . img_as_float ( arr )
check the shape of the array to be rgba and convert it to floating point representation .