code: def _b_orthonormalize(
      B, blockVectorV, blockVectorBV=None, retInvR=False
  ):
      """B-orthonormalize the given block vector using Cholesky."""
      normalization = (
          blockVectorV.max(axis=0) + np.finfo(blockVectorV.dtype).eps
      )
      blockVectorV = blockVectorV / normalization
      if blockVectorBV is None:
          if B is not None:
              blockVectorBV = B(blockVectorV)
          else:
              blockVectorBV = blockVectorV  # Shared data!!!
      else:
          blockVectorBV = blockVectorBV / normalization
      VBV = np.matmul(blockVectorV.T.conj(), blockVectorBV)
      try:
          # VBV is a Cholesky factor from now on...
          VBV = cholesky(VBV, overwrite_a=True)
          VBV = inv(VBV, overwrite_a=True)
          blockVectorV = np.matmul(blockVectorV, VBV)
          # blockVectorV = (cho_solve((VBV.T, True), blockVectorV.T)).T
          if B is not None:
              blockVectorBV = np.matmul(blockVectorBV, VBV)
              # blockVectorBV = (cho_solve((VBV.T, True), blockVectorBV.T)).T
          else:
              blockVectorBV = None
      except LinAlgError:
          # raise ValueError('Cholesky has failed')
          blockVectorV = None
          blockVectorBV = None
          VBV = None
  
      if retInvR:
          return blockVectorV, blockVectorBV, VBV, normalization
      else:
          return blockVectorV, blockVectorBV
  
file_path: catboost/contrib/python/scipy/py3/scipy/sparse/linalg/eigen/lobpcg/lobpcg.py
imports: import numpy
  from scipy.linalg import inv, eigh, cho_factor, cho_solve, cholesky, LinAlgError
  from scipy.sparse.linalg import aslinearoperator
  from numpy import block
label_desc: Use image node_id 5 for calling a global function with example usage: _b_orthonormalize(B, blockVectorV, blockVectorBV, retInvR) and returns: blockVectorV,  blockVectorBV,  VBV,  normalization, blockVectorV,  blockVectorBV