code: def test_vmap_of_grad_of_scan_should_transform_stack(self):
      @jax.vmap
      @jax.value_and_grad
      @jax.named_scope("foo")
      def f(x):
          @jax.named_scope("scan_body")
          def body(carry, x):
              return carry * x, carry + x
  
          return lax.scan(body, x, jnp.arange(8.0))[0]
  
      jaxpr = jax.make_jaxpr(f)(jnp.arange(2.0))
      self.assertEqual(
          str(jaxpr.eqns[1].source_info.name_stack), "vmap(jvp(foo))"
      )
      self.assertEqual(
          str(jaxpr.eqns[2].source_info.name_stack),
          "vmap(transpose(jvp(foo)))",
      )
      self.assertEqual(
          str(
              jaxpr.eqns[1]
              .params["jaxpr"]
              .eqns[0]
              .source_info.name_stack
          ),
          "scan_body",
      )
  
      hlo_text = _get_hlo(f)(jnp.arange(2.0))
      self.assertIn("vmap(jvp(foo))/while/body/scan_body/mul", hlo_text)
      self.assertIn(
          "vmap(transpose(jvp(foo)))/while/body/scan_body/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 15 for calling the NameStackControlFlowTest obj's underlying member method code with example usage: obj.test_vmap_of_grad_of_scan_should_transform_stack() and returns: lax, unknown,  unknown