(var, block, func_ir)
return result
Search given block for variable usages.
    If it is used only in one assignment and one Del - remove it and all it's aliases
Search given block for variable usages.
    If it is used only in one assignment and one Del - remove it and all it's aliases
Search given block for variable usages . If it is used only in one assignment and one Del - remove it and all it s aliases
def remove_unused_recursively(var, block, func_ir):
    """
    Search given block for variable usages.
    If it is used only in one assignment and one Del - remove it and all it's aliases
    """

    result, usage = _remove_unused_internal(var, block, func_ir)

    while usage:
        for stmt in usage:
            if isinstance(stmt, Del):
                continue

            if isinstance(stmt.value, Var):
                result, usage = _remove_unused_internal(stmt.value, block, func_ir)
            else:
                usage = None
                break

    return result
def remove_unused_recursively ( var , block , func_ir ) : result , usage = _remove_unused_internal ( var , block , func_ir ) while usage : for stmt in usage : if isinstance ( stmt , Del ) : continue if isinstance ( stmt . value , Var ) : result , usage = _remove_unused_internal ( stmt . value , block , func_ir ) else : usage = None break return result