code: def _test_cases(bdf_only=False):
      # JAX cannot deal with ChosenBySolver as that requires dynamic TensorArrays.
      # NumPy cannot deal with BDF due to the Newton's method inside of it.
  
      def _fixed_fn(final_time):
          return [final_time]
  
      test_cases = []
      if not bdf_only:
          if not JAX_MODE:
              test_cases.append(
                  (
                      "dormand_prince",
                      dormand_prince.DormandPrince,
                      base.ChosenBySolver,
                  )
              )
          test_cases.append(
              (
                  "dormand_prince_fixed",
                  dormand_prince.DormandPrince,
                  _fixed_fn,
              )
          )
      if not NUMPY_MODE:
          if not JAX_MODE:
              test_cases.append(("bdf", bdf.BDF, base.ChosenBySolver))
          test_cases.append(("bdf_fixed", bdf.BDF, _fixed_fn))
      if not test_cases:
          # This is here just to appease parameterized.named_parameters, as it needs
          # at least 1 test case. We'll be disabling the entire test manually in this
          # case.
          test_cases.append(("disabled", None, None))
  
      return test_cases
  
imports: from absl.testing import parameterized
  import numpy
  import tensorflow.compat.v1
  import tensorflow.compat.v2
  from tensorflow_probability.python.internal import test_util
  from tensorflow_probability.python.math import gradient
  from tensorflow_probability.python.math.ode import base
  from tensorflow_probability.python.math.ode import bdf
  from tensorflow_probability.python.math.ode import dormand_prince
label_desc: Use image node_id 1 for calling a global function with example usage: _test_cases(bdf_only) and returns: test_cases, list