code: def manhattan_distances(X, Y=None, sum_over_features=True):
      """ 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
          A tensor with shape (n_samples_X, n_features).
  
      Y : array_like, optional
          A tensor with shape (n_samples_Y, n_features).
  
      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.
  
      Returns
      -------
      D : Tensor
          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.
  
      Examples
      --------
      >>> from mars.learn.metrics.pairwise import manhattan_distances
      >>> manhattan_distances([[3]], [[3]]).execute() #doctest:+ELLIPSIS
      array([[0.]])
      >>> manhattan_distances([[3]], [[2]]).execute() #doctest:+ELLIPSIS
      array([[1.]])
      >>> manhattan_distances([[2]], [[3]]).execute() #doctest:+ELLIPSIS
      array([[1.]])
      >>> manhattan_distances([[1, 2], [3, 4]],\
           [[1, 2], [0, 3]]).execute() #doctest:+ELLIPSIS
      array([[0., 2.],
             [4., 4.]])
      >>> import mars.tensor as mt
      >>> X = mt.ones((1, 2))
      >>> y = mt.full((2, 2), 2.)
      >>> manhattan_distances(X, y, sum_over_features=False).execute() #doctest:+ELLIPSIS
      array([[1., 1.],
             [1., 1.]])
      """
      op = ManhattanDistances(
          x=X,
          y=Y,
          sum_over_features=sum_over_features,
          dtype=np.dtype(np.float64),
      )
      return op(X, Y=Y)
  
imports: import numpy
  from ....None import opcodes
  from ....core import recursive_tile
  from ....serialization.serializables import KeyField, BoolField
  from ....tensor.core import TensorOrder
  from ....tensor.arithmetic import abs
  from ....tensor.spatial.distance import cdist
  from ....tensor.array_utils import as_same_device, device
  from ....utils import ensure_own_data
  from .core import PairwiseDistances
label_desc: Use image node_id 1 for calling a global function with example usage: manhattan_distances(X, Y, sum_over_features) and returns: op