code: def replace_dummy(expr, sym):
      from sympy.core.symbol import Dummy
  
      dum = expr.atoms(Dummy)
      if not dum:
          return expr
      assert len(dum) == 1
      return expr.xreplace({dum.pop(): sym})
  
imports: from sympy.core.containers import Tuple
  from sympy.core.function import Derivative
  from sympy.core.numbers import I, Rational, oo, pi
  from sympy.core.singleton import S
  from sympy.core.symbol import symbols
  from sympy.functions.elementary.exponential import exp, log
  from sympy.functions.elementary.miscellaneous import sqrt
  from sympy.functions.elementary.trigonometric import cos
  from sympy.functions.special.gamma_functions import gamma
  from sympy.functions.special.hyper import appellf1, hyper, meijerg
  from sympy.series.order import O
  from sympy.abc import x, z, k
  from sympy.series.limits import limit
  from sympy.testing.pytest import raises, slow
  from sympy.core.random import random_complex_number, verify_numerically, test_derivative_numerically
label_desc: Use image node_id 4 for calling a global function with example usage: replace_dummy(expr, sym) and returns: expr, expr