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: lib.rs
    path of file: ./repos/joystream/runtime-modules/working-group/src
    
    the code of the file until where you have to start completion: //! # Working group pallet
//! Working group pallet for the Joystream platform.
//! Contains abstract working group workflow.
//!
//! Exact working group (eg.: forum working group) should create an instance of the Working group module.
//!
//! ## Supported extrinsics
//!
//! - [add_opening](./struct.Module.html#method.add_opening) - Add an opening for a regular worker/lead role.
//! - [apply_on_opening](./struct.Module.html#method.apply_on_opening) - Apply on a regular worker/lead opening.
//! - 
    
    fn terminate_role_weight(penalty: &Option<Vec<u8>>) -> Weight {
        WeightInfoWorkingGroup::<T, I>::terminate_role_lead(to_kb(
            penalty
                .as_ref()
                .map(|penalty| penalty.len().saturated_into())
                .unwrap_or_default(),
        ))
        .max(WeightInfoWorkingGroup::<T, I>::terminate_role_worker(
            to_kb(
                penalty
                    .as_ref()
                    .map(|penalty| penalty.len().saturated_into())
                    .unwrap_or_default(),
            ),
        ))
    }