code: def row_norms(X, squared=False):
      """Row-wise (squared) Euclidean norm of X.
  
      Equivalent to np.sqrt((X * X).sum(axis=1)), but also supports sparse
      matrices and does not create an X.shape-sized temporary.
  
      Performs no input validation.
  
      Parameters
      ----------
      X : array-like
          The input array.
      squared : bool, default=False
          If True, return squared norms.
  
      Returns
      -------
      array-like
          The row-wise (squared) Euclidean norm of X.
      """
      if sparse.issparse(X):
          X = X.tocsr()
          norms = csr_row_norms(X)
          if not squared:
              norms = np.sqrt(norms)
      else:
          xp, _ = get_namespace(X)
          if _is_numpy_namespace(xp):
              X = np.asarray(X)
              norms = np.einsum("ij,ij->i", X, X)
              norms = xp.asarray(norms)
          else:
              norms = xp.sum(xp.multiply(X, X), axis=1)
          if not squared:
              norms = xp.sqrt(norms)
      return norms
  
imports: import warnings
  from functools import partial
  from numbers import Integral
  import numpy
  from scipy import linalg, sparse
  from ..utils import deprecated
  from ..utils._param_validation import Interval, StrOptions, validate_params
  from .None import check_random_state
  from ._array_api import _is_numpy_namespace, device, get_namespace
  from .sparsefuncs_fast import csr_row_norms
  from .validation import check_array
label_desc: Use image node_id 2 for calling a global function with example usage: row_norms(X, squared) and returns: norms