code: def check_pairwise_arrays(
      X: ArrayLike, Y: Optional[ArrayLike], precomputed: bool = False
  ) -> Tuple[ArrayLike, ArrayLike]:
      # XXX
      if Y is None:
          Y = X
  
      if precomputed:
          if X.shape[1] != Y.shape[0]:
              raise ValueError(
                  "Precomputed metric requires shape "
                  "(n_queries, n_indexed). Got (%d, %d) "
                  "for %d indexed."
                  % (X.shape[0], X.shape[1], Y.shape[0])
              )
      elif X.shape[1] != Y.shape[1]:
          raise ValueError(
              "Incompatible dimension for X and Y matrices: "
              "X.shape[1] == %d while Y.shape[1] == %d"
              % (X.shape[1], Y.shape[1])
          )
      return X, Y
  
file_path: dask-ml/dask_ml/metrics/pairwise.py
imports: import warnings
  from typing import Any, Callable, Dict, Optional, Tuple, Union
  import dask.array
  import numpy
  from dask import delayed
  from dask.utils import derived_from
  from sklearn import metrics
  from sklearn.metrics.pairwise import KERNEL_PARAMS
  from .._typing import ArrayLike
  from ..utils import row_norms
label_desc: Use image node_id 4 for calling a global function with example usage: check_pairwise_arrays(X, Y, precomputed) and returns: X,  Y