code: def euclidean_distances(
      X: ArrayLike,
      Y: Optional[ArrayLike] = None,
      Y_norm_squared: Optional[ArrayLike] = None,
      squared: bool = False,
      X_norm_squared: Optional[ArrayLike] = None,
  ) -> ArrayLike:
      if Y is None:
          Y = X
  
      if X_norm_squared is not None:
          XX = X_norm_squared
          if XX.shape == (1, X.shape[0]):
              XX = XX.T
          elif XX.shape != (X.shape[0], 1):
              raise ValueError(
                  "Incompatible dimensions for X and X_norm_squared"
              )
      else:
          XX = row_norms(X, squared=True)[:, np.newaxis]
      if X is Y:
          YY = XX.T
      elif Y_norm_squared is not None:
          if Y_norm_squared.ndim < 2:
              YY = Y_norm_squared[:, np.newaxis]
          else:
              YY = Y_norm_squared
          if YY.shape != (1, Y.shape[0]):
              raise ValueError(
                  "Incompatible dimensions for Y and Y_norm_squared"
              )
      else:
          YY = row_norms(Y, squared=True)[np.newaxis, :]
  
      # TODO: this often emits a warning. Silence it here?
      distances = -2 * da.dot(X, Y.T) + XX + YY
      distances = da.maximum(distances, 0)
      # TODO: scikit-learn sets the diagonal to 0 when X is Y.
  
      return distances if squared else da.sqrt(distances)
  
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 3 for calling a global function with example usage: euclidean_distances(X, Y, Y_norm_squared, squared, X_norm_squared) and returns: unknown