(condition, rewrite)
return _rewriter
Strategy that rewrites an integrand.
Strategy that rewrites an integrand.
Strategy that rewrites an integrand .
def rewriter(condition, rewrite):
    """Strategy that rewrites an integrand."""
    def _rewriter(integral):
        integrand, symbol = integral
        if condition(*integral):
            rewritten = rewrite(*integral)
            if rewritten != integrand:
                substep = integral_steps(rewritten, symbol)
                if not isinstance(substep, DontKnowRule):
                    return RewriteRule(
                        rewritten,
                        substep,
                        integrand, symbol)
    return _rewriter
def rewriter ( condition , rewrite ) : def _rewriter ( integral ) : integrand , symbol = integral if condition ( * integral ) : rewritten = rewrite ( * integral ) if rewritten != integrand : substep = integral_steps ( rewritten , symbol ) if not isinstance ( substep , DontKnowRule ) : return RewriteRule ( rewritten , substep , integrand , symbol ) return _rewriter