code: def test_custom_linear_solve_errors(self):
      solve = lambda f, x: x
  
      with self.assertRaisesRegex(
          TypeError, re.escape("matvec() output pytree")
      ):
          lax.custom_linear_solve(lambda x: [x], 1.0, solve, solve)
      with self.assertRaisesRegex(
          TypeError, re.escape("solve() output pytree")
      ):
          lax.custom_linear_solve(
              lambda x: x, 1.0, lambda f, x: [x], solve
          )
      with self.assertRaisesRegex(
          TypeError, re.escape("transpose_solve() output pytree")
      ):
          lax.custom_linear_solve(
              lambda x: x, 1.0, solve, lambda f, x: [x]
          )
  
      with self.assertRaisesRegex(
          ValueError, re.escape("solve() output shapes")
      ):
          lax.custom_linear_solve(
              lambda x: x, 1.0, lambda f, x: jnp.ones(2), solve
          )
  
      def bad_matvec_usage(a):
          return lax.custom_linear_solve(
              lambda x: a * jnp.ones(2), 1.0, solve, solve
          )
  
      with self.assertRaisesRegex(
          ValueError, re.escape("matvec() output shapes")
      ):
          jax.jvp(bad_matvec_usage, (1.0,), (1.0,))
  
imports: from functools import partial
  import re
  import unittest
  from absl.testing import absltest
  from absl.testing import parameterized
  import numpy
  import jax
  from jax import lax
  from jax.ad_checkpoint import checkpoint
  from jax._src import test_util
  from jax import tree_util
  import jax.numpy
  import jax.scipy
  from jax import config
label_desc: Use image node_id 11 for calling the CustomLinearSolveTest obj's underlying member method code with example usage: obj.test_custom_linear_solve_errors() and returns: lax