def METHOD_NAME(self, layer_db: LayerDatabase, layer_comp_ratio_list: List[LayerCompRatioPair],
                cost_metric: CostMetric, trainer) -> LayerDatabase:
    """
    Prune a model given a list of layer-comp_ratio pairs
    :param cost_metric:
    :param layer_db: Layer database of the model to prune
    :param layer_comp_ratio_list: List of layer-comp_ratio pairs
    :param trainer: Used for
    :return: Compressed copy of the LayerDatabase
    """
    # Copy the db
    comp_layer_db = copy.deepcopy(layer_db)
    for layer_comp_ratio in layer_comp_ratio_list:
        layer = comp_layer_db.find_layer_by_name(layer_comp_ratio.layer.name)
        comp_ratio = layer_comp_ratio.comp_ratio
        if comp_ratio is not None and comp_ratio < 1.0:
            self._prune_layer(layer_db, comp_layer_db, layer, comp_ratio, cost_metric)
        # fine-tuning the layer while creating the final model
        if trainer is not None:
            trainer.train_model(comp_layer_db.model, layer)
    return comp_layer_db