code: def _cholesky(B):
      """
      Wrapper around `cupy.linalg.cholesky` that raises LinAlgError if there are
      NaNs in the output
      """
      R = cupy.linalg.cholesky(B)
      if cupy.any(cupy.isnan(R)):
          raise numpy.linalg.LinAlgError
      return R
  
file_path: cupy/cupyx/scipy/sparse/linalg/_lobpcg.py
imports: import warnings
  import numpy
  import cupy
  import cupy.linalg
  from cupyx.scipy.sparse import linalg
label_desc: Use image node_id 1 for calling a global function with example usage: _cholesky(B) and returns: R