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)
      else:
          norms = np.einsum("ij,ij->i", X, X)
  
      if not squared:
          np.sqrt(norms, norms)
      return norms
  
imports: import warnings
  import numpy
  from scipy import linalg, sparse
  from .None import check_random_state
  from ._array_api import _is_numpy_namespace, get_namespace
  from ._logistic_sigmoid import _log_logistic_sigmoid
  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