

def _exponents(expr, x):
    '\n    Find the exponents of ``x`` (not including zero) in ``expr``.\n\n    >>> from sympy.integrals.meijerint import _exponents\n    >>> from sympy.abc import x, y\n    >>> from sympy import sin\n    >>> _exponents(x, x)\n    set([1])\n    >>> _exponents(x**2, x)\n    set([2])\n    >>> _exponents(x**2 + x, x)\n    set([1, 2])\n    >>> _exponents(x**3*sin(x + x**y) + 1/x, x)\n    set([-1, 1, 3, y])\n    '

    def _exponents_(expr, x, res):
        if (expr == x):
            res.update([1])
            return
        if (expr.is_Pow and (expr.base == x)):
            res.update([expr.exp])
            return
        for arg in expr.args:
            _exponents_(arg, x, res)
    res = set()
    _exponents_(expr, x, res)
    return expr

dataset/ETHPy150Open sympy/sympy/sympy/integrals/meijerint.py _exponents/VarMisuse@115/329 `res`->`expr`