code: def manhattan_distances(X, Y=None, *, sum_over_features="deprecated"):
      """Compute the L1 distances between the vectors in X and Y.
  
      With sum_over_features equal to False it returns the componentwise
      distances.
  
      Read more in the :ref:`User Guide <metrics>`.
  
      Parameters
      ----------
      X : {array-like, sparse matrix} of shape (n_samples_X, n_features)
          An array where each row is a sample and each column is a feature.
  
      Y : {array-like, sparse matrix} of shape (n_samples_Y, n_features), default=None
          An array where each row is a sample and each column is a feature.
          If `None`, method uses `Y=X`.
  
      sum_over_features : bool, default=True
          If True the function returns the pairwise distance matrix
          else it returns the componentwise L1 pairwise-distances.
          Not supported for sparse matrix inputs.
  
          .. deprecated:: 1.2
              ``sum_over_features`` was deprecated in version 1.2 and will be removed in
              1.4.
  
      Returns
      -------
      D : ndarray of shape (n_samples_X * n_samples_Y, n_features) or \
              (n_samples_X, n_samples_Y)
          If sum_over_features is False shape is
          (n_samples_X * n_samples_Y, n_features) and D contains the
          componentwise L1 pairwise-distances (ie. absolute difference),
          else shape is (n_samples_X, n_samples_Y) and D contains
          the pairwise L1 distances.
  
      Notes
      -----
      When X and/or Y are CSR sparse matrices and they are not already
      in canonical format, this function modifies them in-place to
      make them canonical.
  
      Examples
      --------
      >>> from sklearn.metrics.pairwise import manhattan_distances
      >>> manhattan_distances([[3]], [[3]])
      array([[0.]])
      >>> manhattan_distances([[3]], [[2]])
      array([[1.]])
      >>> manhattan_distances([[2]], [[3]])
      array([[1.]])
      >>> manhattan_distances([[1, 2], [3, 4]],\
           [[1, 2], [0, 3]])
      array([[0., 2.],
             [4., 4.]])
      """
      # TODO(1.4): remove sum_over_features
      if sum_over_features != "deprecated":
          warnings.warn(
              (
                  "`sum_over_features` is deprecated in version 1.2 and will be"
                  " removed in version 1.4."
              ),
              FutureWarning,
          )
      else:
          sum_over_features = True
  
      X, Y = check_pairwise_arrays(X, Y)
  
      if issparse(X) or issparse(Y):
          if not sum_over_features:
              raise TypeError(
                  "sum_over_features=%r not supported for sparse matrices"
                  % sum_over_features
              )
  
          X = csr_matrix(X, copy=False)
          Y = csr_matrix(Y, copy=False)
          X.sum_duplicates()  # this also sorts indices in-place
          Y.sum_duplicates()
          D = np.zeros((X.shape[0], Y.shape[0]))
          _sparse_manhattan(
              X.data,
              X.indices,
              X.indptr,
              Y.data,
              Y.indices,
              Y.indptr,
              D,
          )
          return D
  
      if sum_over_features:
          return distance.cdist(X, Y, "cityblock")
  
      D = X[:, np.newaxis, :] - Y[np.newaxis, :, :]
      D = np.abs(D, D)
      return D.reshape((-1, X.shape[1]))
  
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 13 for calling a global function with example usage: manhattan_distances(X, Y) and returns: D, D, distance