def optimization_pass(node):
    # Get a partial application of the optimization function
    info = {'c': 0}
    func = partial(optimization_func, info)

    # Tile over the ast
    patterns = optimization_patterns()
    node = tile(node, patterns, func)

    # Return the counts
    return info['c'], node
Does a single optimization pass.
dataset/ETHPy150Open armon/pypred/pypred/optimizer.py/optimization_pass