code: def test_spde():
      DE = DifferentialExtension(
          extension={"D": [Poly(1, x), Poly(t**2 + 1, t)]}
      )
      raises(
          NonElementaryIntegralException,
          lambda: spde(
              Poly(t, t),
              Poly((t - 1) * (t**2 + 1), t),
              Poly(1, t),
              0,
              DE,
          ),
      )
      DE = DifferentialExtension(
          extension={"D": [Poly(1, x), Poly(t, t)]}
      )
      assert spde(
          Poly(t**2 + x * t * 2 + x**2, t),
          Poly(t**2 / x**2 + (2 / x - 1) * t, t),
          Poly(t**2 / x**2 + (2 / x - 1) * t, t),
          0,
          DE,
      ) == (
          Poly(0, t),
          Poly(0, t),
          0,
          Poly(0, t),
          Poly(1, t, domain="ZZ(x)"),
      )
      DE = DifferentialExtension(
          extension={
              "D": [Poly(1, x), Poly(t0 / x**2, t0), Poly(1 / x, t)]
          }
      )
      assert spde(
          Poly(t**2, t),
          Poly(-(t**2) / x**2 - 1 / x, t),
          Poly(
              (2 * x - 1) * t**4
              + (t0 + x) / x * t**3
              - (t0 + 4 * x**2) / (2 * x) * t**2
              + x * t,
              t,
          ),
          3,
          DE,
      ) == (
          Poly(0, t),
          Poly(0, t),
          0,
          Poly(0, t),
          Poly(
              t0 * t**2 / 2 + x**2 * t**2 - x**2 * t,
              t,
              domain="ZZ(x,t0)",
          ),
      )
      DE = DifferentialExtension(extension={"D": [Poly(1, x)]})
      assert spde(
          Poly(x**2 + x + 1, x),
          Poly(-2 * x - 1, x),
          Poly(x**5 / 2 + 3 * x**4 / 4 + x**3 - x**2 + 1, x),
          4,
          DE,
      ) == (
          Poly(0, x, domain="QQ"),
          Poly(x / 2 - Rational(1, 4), x),
          2,
          Poly(x**2 + x + 1, x),
          Poly(x * Rational(5, 4), x),
      )
      assert spde(
          Poly(x**2 + x + 1, x),
          Poly(-2 * x - 1, x),
          Poly(x**5 / 2 + 3 * x**4 / 4 + x**3 - x**2 + 1, x),
          n,
          DE,
      ) == (
          Poly(0, x, domain="QQ"),
          Poly(x / 2 - Rational(1, 4), x),
          -2 + n,
          Poly(x**2 + x + 1, x),
          Poly(x * Rational(5, 4), x),
      )
      DE = DifferentialExtension(
          extension={"D": [Poly(1, x), Poly(1, t)]}
      )
      raises(
          NonElementaryIntegralException,
          lambda: spde(
              Poly((t - 1) * (t**2 + 1) ** 2, t),
              Poly((t - 1) * (t**2 + 1), t),
              Poly(1, t),
              0,
              DE,
          ),
      )
      DE = DifferentialExtension(extension={"D": [Poly(1, x)]})
      assert spde(
          Poly(x**2 - x, x),
          Poly(1, x),
          Poly(9 * x**4 - 10 * x**3 + 2 * x**2, x),
          4,
          DE,
      ) == (
          Poly(0, x, domain="ZZ"),
          Poly(0, x),
          0,
          Poly(0, x),
          Poly(3 * x**3 - 2 * x**2, x, domain="QQ"),
      )
      assert spde(
          Poly(x**2 - x, x),
          Poly(x**2 - 5 * x + 3, x),
          Poly(x**7 - x**6 - 2 * x**4 + 3 * x**3 - x**2, x),
          5,
          DE,
      ) == (
          Poly(1, x, domain="QQ"),
          Poly(x + 1, x, domain="QQ"),
          1,
          Poly(x**4 - x**3, x),
          Poly(x**3 - x**2, x, domain="QQ"),
      )
  
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 7 for calling a global function with example usage: test_spde() without return types