code: def test_custom_vjp(self, filter_mode):
      def err(*args):
          assert False
          return args[0]
  
      @jax.custom_vjp
      def f(x):
          return err(x)
  
      def fwd(x):
          return x, ()
  
      def fwd_err(x):
          x = err(x)
          return x, ()
  
      def bwd(_, g):
          return (g,)
  
      def bwd_err(_, g):
          g = err(g)
          return (g,)
  
      f.defvjp(fwd_err, bwd)
  
      check_filtered_stack_trace(
          self,
          AssertionError,
          lambda: f(1.0),
          [("f", "return err(x)"), ("err", "assert False")],
          filter_mode=filter_mode,
      )
  
      check_filtered_stack_trace(
          self,
          AssertionError,
          lambda: jax.grad(f)(1.0),
          [("fwd_err", "x = err(x)"), ("err", "assert False")],
          filter_mode=filter_mode,
      )
  
      f.defvjp(fwd, bwd_err)
  
      check_filtered_stack_trace(
          self,
          AssertionError,
          lambda: jax.grad(f)(1.0),
          [("bwd_err", "g = err(g)"), ("err", "assert False")],
          filter_mode=filter_mode,
      )
  
imports: import re
  import sys
  import traceback
  from absl.testing import absltest
  from absl.testing import parameterized
  import jax
  import jax.numpy
  from jax import grad, jit, vmap, lax
  from jax._src import config
  from jax._src import core
  from jax._src import source_info_util
  from jax._src import test_util
  from jax._src import traceback_util
label_desc: Use image node_id 14 for calling the FilteredTracebackTest obj's underlying member method code with example usage: obj.test_custom_vjp(filter_mode) and returns: args, err, x,  , x,  , g, g