code: def test_bound_degree():
      # Base
      DE = DifferentialExtension(extension={"D": [Poly(1, x)]})
      assert (
          bound_degree(Poly(1, x), Poly(-2 * x, x), Poly(1, x), DE) == 0
      )
  
      # Primitive (see above test_bound_degree_fail)
      # TODO: Add test for when the degree bound becomes larger after limited_integrate
      # TODO: Add test for db == da - 1 case
  
      # Exp
      # TODO: Add tests
      # TODO: Add test for when the degree becomes larger after parametric_log_deriv()
  
      # Nonlinear
      DE = DifferentialExtension(
          extension={"D": [Poly(1, x), Poly(t**2 + 1, t)]}
      )
      assert (
          bound_degree(
              Poly(t, t),
              Poly((t - 1) * (t**2 + 1), t),
              Poly(1, t),
              DE,
          )
          == 0
      )
  
file_path: sympy/sympy/integrals/tests/test_rde.py
imports: from sympy.core.numbers import I, Rational, oo
  from sympy.core.symbol import symbols
  from sympy.polys.polytools import Poly
  from sympy.integrals.risch import DifferentialExtension, NonElementaryIntegralException
  from sympy.integrals.rde import order_at, order_at_oo, weak_normalizer, normal_denom, special_denom, bound_degree, spde, solve_poly_rde, no_cancel_equal, cancel_primitive, cancel_exp, rischDE
  from sympy.testing.pytest import raises
  from sympy.abc import x, t, z, n
label_desc: Use image node_id 6 for calling a global function with example usage: test_bound_degree() without return types