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: archetype_range_tests.rs
    path of file: ./repos/rerun/crates/re_query/tests
    
    the code of the file until where you have to start completion: use smallvec::smallvec;

use re_data_store::{DataStore, TimeInt, TimeRange};
use re_log_types::{build_frame_nr, DataCell, DataCellRow, DataRow, EntityPath, RowId};
use re_query::range_archetype;
use re_types::{
    archetypes::Points2D,
    components::{Color, InstanceKey, Position2D},
};
use re_types_core::Loggable as _;

#[test]
fn simple_range() {
    let mut store = DataStore::new(
        re_log_types::StoreId::random(re_log_types::StoreKind::Recording),
        InstanceKey::name(),
        Default::default(),
    );

    let ent_path: EntityPath = "point".into();

    let timepoint1 = [build_frame_nr(123.into())];
    {
        // Create some Positions with implicit instances
        let positions = vec![Position2D::new(1.0, 2.0), Position2D::new(3.0, 4.0)];
        let row =
            DataRow::from_cells1_sized(RowId::new(), ent_path.clone(), timepoint1, 2, positions)
                .unwrap();
        store.insert_row(&row).unwrap();

        // Assign one of them a color with an explicit instance
        let color_instances = vec![InstanceKey(1)];
        let colors = vec![Color::from_rgb(255, 0, 0)];
        let row = DataRow::from_cells2_sized(
            RowId::new(),
            ent_path.clone(),
            timepoint1,
            1,
            (color_instances, colors),
        )
        .unwrap();
        store.insert_row(&row).unwrap();
    }

    let timepoint2 = [build_frame_nr(223.into())];
    {
        // Assign one of them a color with an explicit instance
        let color_instances = vec![InstanceKey(0)];
        let colors = vec![Color::from_rgb(255, 0, 0)];
        let row = DataRow::from_cells2_sized(
            RowId::new(),
            ent_path.clone(),
            timepoint2,
            1,
            (color_instances, colors),
        )
        .unwrap();
        store.insert_row(&row).unwrap();
    }

    let timepoint3 = [build_frame_nr(323.into())];
    {
        // Create some Positions with implicit instances
        let positions = vec![Position2D::new(10.0, 20.0), Position2D::new(30.0, 40.0)];
        let row =
            DataRow::from_cells1_sized(RowId::new(), ent_path.clone(), timepoint3, 2, positions)
                .unwrap();
        store.insert_row(&row).unwrap();
    }

    // --- First test: `(timepoint1, timepoint3]` ---

    let query = re_data_store::RangeQuery::new(
        timepoint1[0].0,
        TimeRange::new((timepoint1[0].1.as_i64() + 1).into(), timepoint3[0].1),
    );

    let arch_views =
        range_archetype::<Points2D, { Points2D::NUM_COMPONENTS }>(&store, &query, &ent_path);

    let results = arch_views.collect::<Vec<_>>();

    // We expect this to generate the following `DataFrame`s:
    //
    // Frame #323:
    // ┌─────────────┬──────────────┬─────────────────┐
    // │ InstanceKey ┆ Point2D      ┆ Color           │
    // ╞═════════════╪══════════════╪═════════════════╡
    // │ 0           ┆ {10.0,20.0}  ┆ 4278190080      │
    // ├╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┤
    // │ 1           ┆ {30.0,40.0}  ┆ null            │
    // └─────────────┴──────────────┴─────────────────┘

    {
        // Frame #323

        let arch_view = &results[0];
        let time = arch_view.data_time().unwrap();

        // Build expected df manually
        let instances = vec![Some(InstanceKey(0)), Some(InstanceKey(1))];
        let positions = vec![
            Some(Position2D::new(10.0, 20.0)),
            Some(Position2D::new(30.0, 40.0)),
        ];
        let colors = vec![Some(Color::from_rgb(255, 0, 0)), None];
        let expected = DataCellRow(smallvec![
            DataCell::from_native_sparse(instances),
            DataCell::from_native_sparse(positions),
            DataCell::from_native_sparse(colors)
        ]);

        //eprintln!("{expected:?}");

        assert_eq!(TimeInt::from(323), time);
        assert_eq!(
            &expected,
            &arch_view.to_data_cell_row_2::<Position2D, Color>().unwrap(),
        );
    }

    // --- Second test: `[timepoint1, timepoint3]` ---

    let query = re_data_store::RangeQuery::new(
        timepoint1[0].0,
        TimeRange::new(timepoint1[0].1, timepoint3[0].1),
    );

    let arch_views =
        range_archetype::<Points2D, { Points2D::NUM_COMPONENTS }>(&store, &query, &ent_path);

    let results = arch_views.collect::<Vec<_>>();

    // We expect this to generate the following `DataFrame`s:
    //
    // Frame #123:
    // ┌────────────────────┬───────────────┬─────────────────┐
    // │ InstanceKey ┆ Point2D ┆ Color │
    // ╞════════════════════╪═══════════════╪═════════════════╡
    // │ 0                  ┆ {1.0,2.0}     ┆ null            │
    // ├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┤
    // │ 1                  ┆ {3.0,4.0}     ┆ null            │
    // └────────────────────┴───────────────┴─────────────────┘
    //
    // Frame #323:
    // ┌────────────────────┬───────────────┬─────────────────┐
    // │ InstanceKey ┆ Point2D ┆ Color │
    // ╞════════════════════╪═══════════════╪═════════════════╡
    // │ 0                  ┆ {10.0,20.0}   ┆ 4278190080      │
    // ├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┤
    // │ 1                  ┆ {30.0,40.0}   ┆ null            │
    // └────────────────────┴───────────────┴─────────────────┘

    {
        // Frame #123

        let arch_view = &results[0];
        let time = arch_view.data_time().unwrap();

        // Build expected df manually
        let instances = vec![Some(InstanceKey(0)), Some(InstanceKey(1))];
        let positions = vec![
            Some(Position2D::new(1.0, 2.0)),
            Some(Position2D::new(3.0, 4.0)),
        ];
        let colors: Vec<Option<Color>> = vec![None, None];
        let expected = DataCellRow(smallvec![
            DataCell::from_native_sparse(instances),
       
    
fn simple_range() {
    let mut store = DataStore::new(
        re_log_types::StoreId::random(re_log_types::StoreKind::Recording),
        InstanceKey::name(),
        Default::default(),
    );

    let ent_path: EntityPath = "point".into();

    let timepoint1 = [build_frame_nr(123.into())];
    {
        // Create some Positions with implicit instances
        let positions = vec![Position2D::new(1.0, 2.0), Position2D::new(3.0, 4.0)];
        let row =
            DataRow::from_cells1_sized(RowId::new(), ent_path.clone(), timepoint1, 2, positions)
                .unwrap();
        store.insert_row(&row).unwrap();

        // Assign one of them a color with an explicit instance
        let color_instances = vec![InstanceKey(1)];
        let colors = vec![Color::from_rgb(255, 0, 0)];
        let row = DataRow::from_cells2_sized(
            RowId::new(),
            ent_path.clone(),
            timepoint1,
            1,
            (color_instances, colors),
        )
        .unwrap();
        store.insert_row(&row).unwrap();
    }

    let timepoint2 = [build_frame_nr(223.into())];
    {
        // Assign one of them a color with an explicit instance
        let color_instances = vec![InstanceKey(0)];
        let colors = vec![Color::from_rgb(255, 0, 0)];
        let row = DataRow::from_cells2_sized(
            RowId::new(),
            ent_path.clone(),
            timepoint2,
            1,
            (color_instances, colors),
        )
        .unwrap();
        store.insert_row(&row).unwrap();
    }

    let timepoint3 = [build_frame_nr(323.into())];
    {
        // Create some Positions with implicit instances
        let positions = vec![Position2D::new(10.0, 20.0), Position2D::new(30.0, 40.0)];
        let row =
            DataRow::from_cells1_sized(RowId::new(), ent_path.clone(), timepoint3, 2, positions)
                .unwrap();
        store.insert_row(&row).unwrap();
    }

    // --- First test: `(timepoint1, timepoint3]` ---

    let query = re_data_store::RangeQuery::new(
        timepoint1[0].0,
        TimeRange::new((timepoint1[0].1.as_i64() + 1).into(), timepoint3[0].1),
    );

    let arch_views =
        range_archetype::<Points2D, { Points2D::NUM_COMPONENTS }>(&store, &query, &ent_path);

    let results = arch_views.collect::<Vec<_>>();

    // We expect this to generate the following `DataFrame`s:
    //
    // Frame #323:
    // ┌─────────────┬──────────────┬─────────────────┐
    // │ InstanceKey ┆ Point2D      ┆ Color           │
    // ╞═════════════╪══════════════╪═════════════════╡
    // │ 0           ┆ {10.0,20.0}  ┆ 4278190080      │
    // ├╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┤
    // │ 1           ┆ {30.0,40.0}  ┆ null            │
    // └─────────────┴──────────────┴─────────────────┘

    {
        // Frame #323

        let arch_view = &results[0];
        let time = arch_view.data_time().unwrap();

        // Build expected df manually
        let instances = vec![Some(InstanceKey(0)), Some(InstanceKey(1))];
        let positions = vec![
            Some(Position2D::new(10.0, 20.0)),
            Some(Position2D::new(30.0, 40.0)),
        ];
        let colors = vec![Some(Color::from_rgb(255, 0, 0)), None];
        let expected = DataCellRow(smallvec![
            DataCell::from_native_sparse(instances),
            DataCell::from_native_sparse(positions),
            DataCell::from_native_sparse(colors)
        ]);

        //eprintln!("{expected:?}");

        assert_eq!(TimeInt::from(323), time);
        assert_eq!(
            &expected,
            &arch_view.to_data_cell_row_2::<Position2D, Color>().unwrap(),
        );
    }

    // --- Second test: `[timepoint1, timepoint3]` ---

    let query = re_data_store::RangeQuery::new(
        timepoint1[0].0,
        TimeRange::new(timepoint1[0].1, timepoint3[0].1),
    );

    let arch_views =
        range_archetype::<Points2D, { Points2D::NUM_COMPONENTS }>(&store, &query, &ent_path);

    let results = arch_views.collect::<Vec<_>>();

    // We expect this to generate the following `DataFrame`s:
    //
    // Frame #123:
    // ┌────────────────────┬───────────────┬─────────────────┐
    // │ InstanceKey ┆ Point2D ┆ Color │
    // ╞════════════════════╪═══════════════╪═════════════════╡
    // │ 0                  ┆ {1.0,2.0}     ┆ null            │
    // ├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┤
    // │ 1                  ┆ {3.0,4.0}     ┆ null            │
    // └────────────────────┴───────────────┴─────────────────┘
    //
    // Frame #323:
    // ┌────────────────────┬───────────────┬─────────────────┐
    // │ InstanceKey ┆ Point2D ┆ Color │
    // ╞════════════════════╪═══════════════╪═════════════════╡
    // │ 0                  ┆ {10.0,20.0}   ┆ 4278190080      │
    // ├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┤
    // │ 1                  ┆ {30.0,40.0}   ┆ null            │
    // └────────────────────┴───────────────┴─────────────────┘

    {
        // Frame #123

        let arch_view = &results[0];
        let time = arch_view.data_time().unwrap();

        // Build expected df manually
        let instances = vec![Some(InstanceKey(0)), Some(InstanceKey(1))];
        let positions = vec![
            Some(Position2D::new(1.0, 2.0)),
            Some(Position2D::new(3.0, 4.0)),
        ];
        let colors: Vec<Option<Color>> = vec![None, None];
        let expected = DataCellRow(smallvec![
            DataCell::from_native_sparse(instances),
            DataCell::from_native_sparse(positions),
            DataCell::from_native_sparse(colors)
        ]);

        //eprintln!("{expected:?}");

        assert_eq!(TimeInt::from(123), time);
        assert_eq!(
            &expected,
            &arch_view.to_data_cell_row_2::<Position2D, Color>().unwrap(),
        );
    }
    {
        // Frame #323

        let arch_view = &results[1];
        let time = arch_view.data_time().unwrap();

        // Build expected df manually
        let instances = vec![Some(InstanceKey(0)), Some(InstanceKey(1))];
        let positions = vec![
            Some(Position2D::new(10.0, 20.0)),
            Some(Position2D::new(30.0, 40.0)),
        ];
        let colors = vec![Some(Color::from_rgb(255, 0, 0)), None];
        let expected = DataCellRow(smallvec![
            DataCell::from_native_sparse(instances),
            DataCell::from_native_sparse(positions),
            DataCell::from_native_sparse(colors)
        ]);

        //eprintln!("{expected:?}");

        assert_eq!(TimeInt::from(323), time);
        assert_eq!(
            &expected,
            &arch_view.to_data_cell_row_2::<Position2D, Color>().unwrap(),
        );
    }
}