def optimize(node, max_pass=32, min_change=1):
    changes = min_change
    passes = 0
    while passes < max_pass and changes >= min_change:
        changes, node = optimization_pass(node)
        passes += 1
    return node
Takes an AST and returns one that is equivilent
dataset/ETHPy150Open armon/pypred/pypred/optimizer.py/optimize