code: def check_non_negative(X, whom):
      """
      Check if there is any negative value in an array.
  
      Parameters
      ----------
      X : {array-like, sparse matrix}
          Input data.
  
      whom : str
          Who passed X to this function.
      """
      xp, _ = get_namespace(X)
      # avoid X.min() on sparse matrix since it also sorts the indices
      if sp.issparse(X):
          if X.format in ["lil", "dok"]:
              X = X.tocsr()
          if X.data.size == 0:
              X_min = 0
          else:
              X_min = X.data.min()
      else:
          X_min = xp.min(X)
  
      if X_min < 0:
          raise ValueError(
              "Negative values in data passed to %s" % whom
          )
  
imports: import numbers
  import operator
  import warnings
  from contextlib import suppress
  from functools import reduce, wraps
  from inspect import Parameter, isclass, signature
  import joblib
  import numpy
  import scipy.sparse
  from ..None import get_config
  from ..exceptions import DataConversionWarning, NotFittedError, PositiveSpectrumWarning
  from ..utils._array_api import _asarray_with_order, _is_numpy_namespace, get_namespace
  from ..utils.fixes import ComplexWarning
  from ._isfinite import FiniteStatus, cy_isfinite
  from .fixes import _object_dtype_isnan
label_desc: Use image node_id 29 for calling a global function with example usage: check_non_negative(X, whom) without return types