code: def test_rsolve_raises():
      x = Function("x")
      raises(ValueError, lambda: rsolve(y(n) - y(k + 1), y(n)))
      raises(ValueError, lambda: rsolve(y(n) - y(n + 1), x(n)))
      raises(ValueError, lambda: rsolve(y(n) - x(n + 1), y(n)))
      raises(
          ValueError, lambda: rsolve(y(n) - sqrt(n) * y(n + 1), y(n))
      )
      raises(
          ValueError, lambda: rsolve(y(n) - y(n + 1), y(n), {x(0): 0})
      )
      raises(
          ValueError,
          lambda: rsolve(y(n) + y(n + 1) + 2**n + cos(n), y(n)),
      )
  
imports: from sympy.core.function import Function, Lambda, expand
  from sympy.core.numbers import I, Rational
  from sympy.core.relational import Eq
  from sympy.core.singleton import S
  from sympy.core.symbol import Symbol, symbols
  from sympy.functions.combinatorial.factorials import rf, binomial, factorial
  from sympy.functions.elementary.complexes import Abs
  from sympy.functions.elementary.miscellaneous import sqrt
  from sympy.functions.elementary.trigonometric import cos, sin
  from sympy.polys.polytools import factor
  from sympy.solvers.recurr import rsolve, rsolve_hyper, rsolve_poly, rsolve_ratio
  from sympy.testing.pytest import raises, slow, XFAIL
  from sympy.abc import a, b
label_desc: Use image node_id 9 for calling a global function with example usage: test_rsolve_raises() without return types