(var, block)
Filters given block by statements with given variable
Filters given block by statements with given variable
Filters given block by statements with given variable
def find_usage(var, block):
    """
    Filters given block by statements with given variable
    """
    assert isinstance(var, Var)

    # TODO handle usage outside of given block
    for stmt in block.body:
        if var in stmt.list_vars() or (isinstance(stmt, Del) and stmt.value == var.name):
            yield stmt
def find_usage ( var , block ) : assert isinstance ( var , Var ) # TODO handle usage outside of given block for stmt in block . body : if var in stmt . list_vars ( ) or ( isinstance ( stmt , Del ) and stmt . value == var . name ) : yield stmt