<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def over(expr, window):
 """ 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 """

    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