def enable_sections(sections, core_opts):
DEPRECATED_PLUGINS = ['<STR_LIT>', '<STR_LIT>']<EOL>plugin_instances = [PluginInstance(key.split('<STR_LIT:_>')[<NUM_LIT:1>], value) for key, value in core_opts if<EOL>key.startswith(PLUGIN_PREFIX) and value not in DEPRECATED_PLUGINS]<EOL>enabled_instances = {instance.section_name: instance for instance in plugin_instances if instance.enabled}<EOL>disabled_instances = {instance.section_name: instance for instance in plugin_instances if not instance.enabled}<EOL>for section in sections:<EOL><INDENT>if section.name in enabled_instances.keys():<EOL><INDENT>section.enabled = True<EOL>enabled_instances.pop(section.name)<EOL><DEDENT>elif section.name in disabled_instances.keys():<EOL><INDENT>section.enabled = False<EOL>disabled_instances.pop(section.name)<EOL><DEDENT><DEDENT>for plugin_instance in [i for i in plugin_instances if<EOL>i.section_name in enabled_instances.keys() + disabled_instances.keys()]:<EOL><INDENT>sections.append(Section(plugin_instance.section_name, plugin_instance.plugin_name, [], plugin_instance.enabled))<EOL><DEDENT>return sections<EOL>
:type sections: list of Section