code: def test_source_locations_exclude_contextlib(self):
      def f(x):
          # This generates a stack where the most recent non-jax frame
          # comes from contextlib.
          return jax.named_call(jnp.cos, name="test")(x)
  
      hist = jaxpr_util.source_locations(
          make_jaxpr(f)(jnp.arange(8.0)).jaxpr
      )
      for filename in hist.keys():
          self.assertIn(os.path.basename(__file__), filename)
  
file_path: jax/tests/jaxpr_util_test.py
imports: import os
  import gzip
  import json
  from absl.testing import absltest
  import jax
  from jax import jit, make_jaxpr, numpy
  from jax._src import config
  from jax._src import jaxpr_util
  from jax._src import test_util
  from jax._src.lib import xla_client
label_desc: Use image node_id 5 for calling the JaxprStatsTest obj's underlying member method code with example usage: obj.test_source_locations_exclude_contextlib() and returns: jax