code: def over(expr, window):
      
      prior_op = expr.op()
  
      if isinstance(prior_op, ops.WindowOp):
          op = prior_op.over(window)
      else:
          op = ops.WindowOp(expr, window)
  
      result = op.to_expr()
  
      try:
          name = expr.get_name()
      except com.ExpressionError:
          pass
      else:
          result = result.name(name)
  
      return result
docs: Turn an aggregation or full-sample analytic operation into a windowed
      operation. See ibis.window for more details on window configuration
  
      Parameters
      ----------
      expr : value expression
      window : ibis.Window
  
      Returns
      -------
      expr : type of input