code: def test_grad_of_cond_transforms_name_stack(self):
      @jax.grad
      @jax.named_scope("foo")
      def f(x, y):
          @jax.named_scope("true")
          def true_fn(x):
              return x * x * 2.0
  
          @jax.named_scope("false")
          def false_fn(x):
              return x / jnp.square(x)
  
          return lax.cond(y, true_fn, false_fn, x)
  
      jaxpr = jax.make_jaxpr(f)(1.0, True)
      self.assertEqual(
          str(jaxpr.eqns[1].source_info.name_stack), "jvp(foo)"
      )
      self.assertEqual(
          str(jaxpr.eqns[2].source_info.name_stack),
          "transpose(jvp(foo))",
      )
  
      hlo_text = _get_hlo(f)(1.0, True)
      self.assertIn("jvp(foo)/cond/branch_0_fun/false/div", hlo_text)
      self.assertIn("jvp(foo)/cond/branch_1_fun/true/mul", hlo_text)
      self.assertIn(
          "transpose(jvp(foo))/cond/branch_0_fun/false/div", hlo_text
      )
      self.assertIn(
          "transpose(jvp(foo))/cond/branch_1_fun/true/mul", hlo_text
      )
  
imports: import functools
  from absl.testing import absltest
  import jax
  import jax.numpy
  from jax._src import core
  from jax import lax
  from jax._src.pjit import pjit
  from jax._src import linear_util
  from jax import config
  from jax._src import test_util
  from jax._src.lib import xla_client
label_desc: Use image node_id 9 for calling the NameStackControlFlowTest obj's underlying member method code with example usage: obj.test_grad_of_cond_transforms_name_stack() and returns: lax, unknown, unknown