code: def _vdot_real_part(x, y):
      """Vector dot-product guaranteed to have a real valued result despite
      possibly complex input. Thus neglects the real-imaginary cross-terms.
      The result is a real float.
      """
      # all our uses of vdot() in CG are for computing an operator of the form
      #  z^H M z
      #  where M is positive definite and Hermitian, so the result is
      # real valued:
      # https://en.wikipedia.org/wiki/Definiteness_of_a_matrix#Definitions_for_complex_matrices
      result = _vdot(x.real, y.real)
      if jnp.iscomplexobj(x) or jnp.iscomplexobj(y):
          result += _vdot(x.imag, y.imag)
      return result
  
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 1 for calling a global function with example usage: _vdot_real_part(x, y) and returns: result