code: def check_paired_arrays(X, Y):
      """Set X and Y appropriately and checks inputs for paired distances.
  
      All paired distance metrics should use this function first to assert that
      the given parameters are correct and safe to use.
  
      Specifically, this function first ensures that both X and Y are arrays,
      then checks that they are at least two dimensional while ensuring that
      their elements are floats. Finally, the function checks that the size
      of the dimensions of the two arrays are equal.
  
      Parameters
      ----------
      X : {array-like, sparse matrix} of shape (n_samples_X, n_features)
  
      Y : {array-like, sparse matrix} of shape (n_samples_Y, n_features)
  
      Returns
      -------
      safe_X : {array-like, sparse matrix} of shape (n_samples_X, n_features)
          An array equal to X, guaranteed to be a numpy array.
  
      safe_Y : {array-like, sparse matrix} of shape (n_samples_Y, n_features)
          An array equal to Y if Y was not None, guaranteed to be a numpy array.
          If Y was None, safe_Y will be a pointer to X.
      """
      X, Y = check_pairwise_arrays(X, Y)
      if X.shape != Y.shape:
          raise ValueError(
              "X and Y should be of same shape. They were respectively %r and %r long."
              % (X.shape, Y.shape)
          )
      return X, Y
  
imports: import itertools
  import warnings
  from functools import partial
  import numpy
  from joblib import effective_n_jobs
  from scipy.sparse import csr_matrix, issparse
  from scipy.spatial import distance
  from ..None import config_context
  from ..exceptions import DataConversionWarning
  from ..preprocessing import normalize
  from ..utils import check_array, gen_batches, gen_even_slices, get_chunk_n_rows, is_scalar_nan
  from ..utils._mask import _get_mask
  from ..utils._param_validation import Hidden, Integral, Interval, MissingValues, Options, Real, StrOptions, validate_params
  from ..utils.extmath import row_norms, safe_sparse_dot
  from ..utils.fixes import parse_version, sp_base_version
  from ..utils.parallel import Parallel, delayed
  from ..utils.validation import _num_samples, check_non_negative
  from ._pairwise_distances_reduction import ArgKmin
  from ._pairwise_fast import _chi2_kernel_fast, _sparse_manhattan
label_desc: Use image node_id 3 for calling a global function with example usage: check_paired_arrays(X, Y) and returns: X,  Y