code: def _b_orthonormalize(
      B, blockVectorV, blockVectorBV=None, retInvR=False
  ):
      """B-orthonormalize the given block vector using Cholesky."""
      normalization = (
          blockVectorV.max(axis=0) + cupy.finfo(blockVectorV.dtype).eps
      )
      blockVectorV = blockVectorV / normalization
      if blockVectorBV is None:
          if B is not None:
              blockVectorBV = B(blockVectorV)
          else:
              blockVectorBV = blockVectorV
      else:
          blockVectorBV = blockVectorBV / normalization
      VBV = cupy.matmul(blockVectorV.T.conj(), blockVectorBV)
      try:
          # VBV is a Cholesky factor
          VBV = _cholesky(VBV)
          VBV = linalg.inv(VBV.T)
          blockVectorV = cupy.matmul(blockVectorV, VBV)
          if B is not None:
              blockVectorBV = cupy.matmul(blockVectorBV, VBV)
          else:
              blockVectorBV = None
      except numpy.linalg.LinAlgError:
          # LinAlg Error: cholesky transformation might fail in rare cases
          # raise ValueError("cholesky has failed")
          blockVectorV = None
          blockVectorBV = None
          VBV = None
  
      if retInvR:
          return blockVectorV, blockVectorBV, VBV, normalization
      else:
          return blockVectorV, blockVectorBV
  
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 7 for calling a global function with example usage: _b_orthonormalize(B, blockVectorV, blockVectorBV, retInvR) and returns: blockVectorV,  blockVectorBV,  VBV,  normalization, blockVectorV,  blockVectorBV