code: def _convert(matrix, arr):
      """Do the color space conversion.
  
      Parameters
      ----------
      matrix : array_like
          The 3x3 matrix to use.
      arr : (..., C=3, ...) array_like
          The input array. By default, the final dimension denotes
          channels.
  
      Returns
      -------
      out : (..., C=3, ...) ndarray
          The converted array. Same dimensions as input.
      """
      arr = _prepare_colorarray(arr)
  
      return arr @ matrix.T.astype(arr.dtype)
  
imports: from warnings import warn
  import numpy
  from scipy import linalg
  from .._shared.utils import _supported_float_type, channel_as_last_axis, identity, reshape_nd, slice_at_axis
  from ..util import dtype, dtype_limits
label_desc: Use image node_id 8 for calling a global function with example usage: _convert(matrix, arr) and returns: unknown