You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: window.rs
    path of file: ./repos/polars/crates/polars/tests/it/lazy/expressions
    
    the code of the file until where you have to start completion: use crate::lazy::*;

#[test]
fn test_lazy_window_functions() {
    let df = df! {
        "groups" => &[1, 1, 2, 2, 1, 2, 3, 3, 1],
        "values" => &[1, 2, 3, 4, 5, 6, 7, 8, 8]
    }
    .unwrap();

    // sums
    // 1 => 16
    // 2 => 13
    // 3 => 15
    let correct = [16, 16, 13, 13, 16, 13, 15, 15, 16]
        .iter()
        .copied()
        .map(Some)
        .collect::<Vec<_>>();

    // test if groups is available after projection pushdown.
    let _ = df
        .clone()
        .lazy()
        .select(&[avg("values").over([col("groups")]).alias("part")])
        .collect()
        .unwrap();
    // test if partition aggregation is correct
    let out = df
        .lazy()
        .select([col("groups"), sum("values").over([col("groups")])])
        .collect()
        .unwrap();
    assert_eq!(
        Vec::from(out.select_at_idx(1).unwrap().i32().unwrap()),
        correct
    );
}

#[test]
fn test_shift_and_fill_window_function() -> PolarsResult<()> {
    let df = fruits_cars();

    // a ternary expression with a final list aggregation
    let out1 = df
        .clone()
        .lazy()
        .select([
            col("fruits"),
            col("B")
                .shift_and_fill(lit(-1), lit(-1))
                .over_with_options([col("fruits")], WindowMapping::Join),
        ])
        .collect()?;

    // same expression, no final list aggregation
    let out2 = df
        .lazy()
        .select([
            col("fruits"),
            col("B")
                .shift_and_fill(lit(-1), lit(-1))
                .over_with_options([col("fruits")], WindowMapping::Join),
        ])
        .collect()?;

    assert!(out1.equals(&out2));

    Ok(())
}

#[test]
fn test_exploded_window_function() -> PolarsResult<()> {
    let df = fruits_cars();

    let out = df
        .clone()
        .lazy()
        .sort("fruits", Default::default())
        .select([
            col("fruits"),
            col("B")
                .shift(lit(1))
                .over_with_options([col("fruits")], WindowMapping::Explode)
               
    
fn test_window_mapping() -> PolarsResult<()> {
    let df = fruits_cars();

    // no aggregation
    let out = df
        .clone()
        .lazy()
        .select([col("A").over([col("fruits")])])
        .collect()?;

    assert!(out.column("A")?.equals(df.column("A")?));

    let out = df
        .clone()
        .lazy()
        .select([col("A"), lit(0).over([col("fruits")])])
        .collect()?;

    assert_eq!(out.shape(), (5, 2));

    let out = df
        .clone()
        .lazy()
        .select([(lit(10) + col("A")).alias("foo").over([col("fruits")])])
        .collect()?;

    let expected = Series::new("foo", [11, 12, 13, 14, 15]);
    assert!(out.column("foo")?.equals(&expected));

    let out = df
        .clone()
        .lazy()
        .select([
            col("fruits"),
            col("B"),
            col("A"),
            (col("B").sum() + col("A"))
                .alias("foo")
                .over([col("fruits")]),
        ])
        .collect()?;
    let expected = Series::new("foo", [11, 12, 8, 9, 15]);
    assert!(out.column("foo")?.equals(&expected));

    let out = df
        .clone()
        .lazy()
        .select([
            col("fruits"),
            col("A"),
            col("B"),
            (col("B").shift(lit(1)) - col("A"))
                .alias("foo")
                .over([col("fruits")]),
        ])
        .collect()?;
    let expected = Series::new("foo", [None, Some(3), None, Some(-1), Some(-1)]);
    assert!(out.column("foo")?.equals_missing(&expected));

    // now sorted
    // this will trigger a fast path
    let df = df.sort(["fruits"], vec![false], false)?;

    let out = df
        .clone()
        .lazy()
        .select([(lit(10) + col("A")).alias("foo").over([col("fruits")])])
        .collect()?;
    let expected = Series::new("foo", [13, 14, 11, 12, 15]);
    assert!(out.column("foo")?.equals(&expected));

    let out = df
        .clone()
        .lazy()
        .select([
            col("fruits"),
            col("B"),
            col("A"),
            (col("B").sum() + col("A"))
                .alias("foo")
                .over([col("fruits")]),
        ])
        .collect()?;

    let expected = Series::new("foo", [8, 9, 11, 12, 15]);
    assert!(out.column("foo")?.equals(&expected));

    let out = df
        .lazy()
        .select([
            col("fruits"),
            col("A"),
            col("B"),
            (col("B").shift(lit(1)) - col("A"))
                .alias("foo")
                .over([col("fruits")]),
        ])
        .collect()?;

    let expected = Series::new("foo", [None, Some(-1), None, Some(3), Some(-1)]);
    assert!(out.column("foo")?.equals_missing(&expected));

    Ok(())
}