code: def _apply_givens_rotations(H_row, givens, k):
      """
      Applies the Givens rotations stored in the vectors cs and sn to the vector
      H_row. Then constructs and applies a new Givens rotation that eliminates
      H_row's k'th element.
      """
      # This call successively applies each of the
      # Givens rotations stored in givens[:, :k] to H_col.
  
      def apply_ith_rotation(i, H_row):
          return _rotate_vectors(H_row, i, *givens[i, :])
  
      R_row = lax.fori_loop(0, k, apply_ith_rotation, H_row)
  
      givens_factors = _givens_rotation(R_row[k], R_row[k + 1])
      givens = givens.at[k, :].set(givens_factors)
      R_row = _rotate_vectors(R_row, k, *givens_factors)
      return R_row, givens
  
imports: from functools import partial
  import operator
  import numpy
  import jax
  import jax.numpy
  from jax import device_put
  from jax import lax
  from jax import scipy
  from jax.tree_util import tree_leaves, tree_map, tree_structure, tree_reduce, Partial
  from jax._src import dtypes
  from jax._src.lax import lax
  from jax._src.util import safe_map
label_desc: Use image node_id 20 for calling a global function with example usage: _apply_givens_rotations(H_row, givens, k) and returns: R_row,  givens, _rotate_vectors