pub fn pick_from_slice<'a, T>( slice: &'a [T], weights: &'a [usize]) -> Option<&'a T>
Pick an element from a slice randomly by given weights.