def __new__(cls, parameters: DiversityFilterParameters) -> BaseDiversityFilter:
    all_filters = dict(NoFilter=NoFilter, NoFilterWithPenalty=NoFilterWithPenalty)
    div_filter = all_filters.get(parameters.name)
    return div_filter(parameters)
def __new__(cls, parameters: DiversityFilterParameters) -> BaseDiversityFilter:
    all_filters = dict(NoFilter=NoFilter, NoFilterWithPenalty=NoFilterWithPenalty)
    div_filter = all_filters.get(parameters.name)
    return div_filter(parameters)