def reduce_configs(self):
experiment_ids = self.get_reduced_configs()<EOL>experiments = self.experiment_group.experiments.filter(id__in=experiment_ids)<EOL>self.create_iteration()<EOL>iteration_config = self.experiment_group.iteration_config<EOL>hptuning_config = self.experiment_group.hptuning_config<EOL>n_resources = self.experiment_group.search_manager.get_resources_for_iteration(<EOL>iteration=iteration_config.iteration)<EOL>resource_value = self.experiment_group.search_manager.get_n_resources(<EOL>n_resources=n_resources, bracket_iteration=iteration_config.bracket_iteration<EOL>)<EOL>resource_name = hptuning_config.hyperband.resource.name<EOL>resource_value = hptuning_config.hyperband.resource.cast_value(resource_value)<EOL>for experiment in experiments:<EOL><INDENT>declarations = experiment.declarations<EOL>declarations[resource_name] = resource_value<EOL>declarations_spec = {'<STR_LIT>': declarations}<EOL>specification = experiment.specification.patch(declarations_spec)<EOL>status_message = '<STR_LIT>'.format(<EOL>iteration_config.iteration,<EOL>iteration_config.bracket_iteration)<EOL>if hptuning_config.hyperband.resume:<EOL><INDENT>experiment.resume(<EOL>declarations=declarations,<EOL>config=specification.parsed_data,<EOL>message=status_message)<EOL><DEDENT>else:<EOL><INDENT>experiment.restart(<EOL>experiment_group=self.experiment_group,<EOL>declarations=declarations,<EOL>config=specification.parsed_data)<EOL><DEDENT><DEDENT>
Reduce the experiments to restart.