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: group_by.rs
    path of file: ./repos/plotters/plotters/src/coord/ranged1d/combinators
    
    the code of the file until where you have to start completion: use crate::coord::ranged1d::{
    AsRangedCoord, DiscreteRanged, KeyPointHint, NoDefaultFormatting, Ranged, ValueFormatter,
};
use std::ops::Range;

/// Grouping the value in the coordinate specification.
///
/// This combinator doesn't change the coordinate mapping behavior. But it changes how
/// the key point is generated, this coordinate specification will enforce that only the first value in each group
/// can be emitted as the bold key points.
///
/// This is useful, for example, when we have an X axis is a integer and denotes days.
/// And we are expecting the tick mark denotes weeks, in this way we can make the rang
    
    fn key_points<HintType: KeyPointHint>(&self, hint: HintType) -> Vec<T::ValueType> {
        let range = 0..(self.0.size() + self.1) / self.1;
        //let logic_range: RangedCoordusize = range.into();

        let interval =
            ((range.end - range.start + hint.bold_points() - 1) / hint.bold_points()).max(1);
        let count = (range.end - range.start) / interval;

        let idx_iter = (0..hint.bold_points()).map(|x| x * interval);

        if hint.weight().allow_light_points() && count < hint.bold_points() * 2 {
            let outter_ticks = idx_iter;
            let outter_tick_size = interval * self.1;
            let inner_ticks_per_group = hint.max_num_points() / outter_ticks.len();
            let inner_ticks =
                (outter_tick_size + inner_ticks_per_group - 1) / inner_ticks_per_group;
            let inner_ticks: Vec<_> = (0..(outter_tick_size / inner_ticks))
                .map(move |x| x * inner_ticks)
                .collect();
            let size = self.0.size();
            return outter_ticks
                .flat_map(|base| inner_ticks.iter().map(move |&ofs| base * self.1 + ofs))
                .take_while(|&idx| idx < size)
                .map(|x| self.0.from_index(x).unwrap())
                .collect();
        }

        idx_iter
            .map(|x| self.0.from_index(x * self.1).unwrap())
            .collect()
    }