def _exponents(expr, x):
    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 res
Testing the `centroid` GeoQuerySet method.
dataset/ETHPy150Open sympy/sympy/sympy/integrals/meijerint.py/_exponents--crossover with--dataset/ETHPy150Open AppScale/appscale/AppServer/lib/django-1.5/django/contrib/gis/tests/geoapp/tests.py/GeoQuerySetTest.test_centroid