code: def test_rewrite():
      x, y, z = symbols("x y z")
      a, b = symbols("a b")
      f1 = sin(x) + cos(x)
      assert (
          f1.rewrite(cos, exp)
          == exp(I * x) / 2 + sin(x) + exp(-I * x) / 2
      )
      assert f1.rewrite([cos], sin) == sin(x) + sin(
          x + pi / 2, evaluate=False
      )
      f2 = sin(x) + cos(y) / gamma(z)
      assert f2.rewrite(sin, exp) == -I * (
          exp(I * x) - exp(-I * x)
      ) / 2 + cos(y) / gamma(z)
  
      assert f1.rewrite() == f1
  
imports: import collections
  from typing import TypeVar, Generic
  from sympy.assumptions.ask import Q
  from sympy.core.basic import Basic, Atom, as_Basic, _atomic, _aresame
  from sympy.core.containers import Tuple
  from sympy.core.function import Function, Lambda
  from sympy.core.numbers import I, pi, Float
  from sympy.core.singleton import S
  from sympy.core.symbol import symbols, Symbol, Dummy
  from sympy.concrete.summations import Sum
  from sympy.functions.elementary.trigonometric import cos, sin
  from sympy.functions.special.gamma_functions import gamma
  from sympy.integrals.integrals import Integral
  from sympy.functions.elementary.exponential import exp
  from sympy.testing.pytest import raises, warns_deprecated_sympy
label_desc: Use image node_id 16 for calling a global function with example usage: test_rewrite() without return types