def find_all_tables(expr, memo=None):
    if memo is None:
        memo = {}

    node = expr.op()

    if isinstance(expr, ir.TableExpr):
        key = id(node)
        if key not in memo:
            memo[key] = expr
        return memo

    for arg in node.flat_args():
        if isinstance(arg, ir.Expr):
            find_all_tables(arg, memo)

    return memo
dataset/ETHPy150Open cloudera/ibis/ibis/expr/analysis.py/find_all_tables/original