code: def has_reduction(expr):
      
  
      def fn(expr):
          op = expr.op()
          if isinstance(op, ops.TableNode):  # don't go below any table nodes
              return lin.halt, None
          if isinstance(op, ops.Reduction):
              return lin.halt, True
          return lin.proceed, None
  
      reduction_status = lin.traverse(fn, expr)
      return any(reduction_status)
docs: Does `expr` contain a reduction?
  
      Parameters
      ----------
      expr : ibis.expr.types.Expr
          An ibis expression
  
      Returns
      -------
      truth_value : bool
          Whether or not there's at least one reduction in `expr`
  
      Notes
      -----
      The ``isinstance(op, ops.TableNode)`` check in this function implies
      that we only examine every non-table expression that precedes the first
      table expression.