def replace_dummy(expr, sym):
    from sympy import Dummy
    dum = expr.atoms(Dummy)
    if not dum:
        return expr
    assert len(dum) == 1
    return expr.xreplace({dum.pop(): sym})
dataset/ETHPy150Open sympy/sympy/sympy/functions/special/tests/test_hyper.py/replace_dummy/original