def load(self, clear=False):
if clear:<EOL><INDENT>self.settings = {}<EOL><DEDENT>defer = []<EOL>for conf in pkg_resources.iter_entry_points('<STR_LIT>'):<EOL><INDENT>if conf.attrs:<EOL><INDENT>raise RuntimeError("<STR_LIT>")<EOL><DEDENT>mod_name = conf.module_name<EOL>base_name = conf.name if conf.name != '<STR_LIT>' else None<EOL>log.info("<STR_LIT>", mod_name)<EOL>mod_dict = runpy.run_module(mod_name)<EOL>if mod_dict.get('<STR_LIT>', None) is deferred:<EOL><INDENT>log.info("<STR_LIT>", mod_name)<EOL>mod_dict.pop('<STR_LIT>')<EOL>defer.append((mod_name, base_name, mod_dict))<EOL>continue<EOL><DEDENT>self._update(mod_dict, base_name)<EOL><DEDENT>for mod_name, base_name, mod_dict in defer:<EOL><INDENT>log.info("<STR_LIT>", mod_name)<EOL>self._update(mod_dict, base_name)<EOL><DEDENT>if etcd().configured:<EOL><INDENT>mod_dict = etcd().load()<EOL>if mod_dict:<EOL><INDENT>self._update(mod_dict)<EOL><DEDENT><DEDENT>mod_dict = None<EOL>try:<EOL><INDENT>mod_dict = runpy.run_module('<STR_LIT>')<EOL><DEDENT>except ImportError:<EOL><INDENT>pass<EOL><DEDENT>except ValueError as err:<EOL><INDENT>if getattr(err, '<STR_LIT:message>') != '<STR_LIT>':<EOL><INDENT>raise<EOL><DEDENT>mod_name = '<STR_LIT>'<EOL>if sys.version_info < (<NUM_LIT:2>, <NUM_LIT:7>):<EOL><INDENT>loader, code, fname = runpy._get_module_details(mod_name)<EOL><DEDENT>else:<EOL><INDENT>_, loader, code, fname = runpy._get_module_details(mod_name)<EOL><DEDENT>mod_dict = runpy._run_code(code, {}, {}, mod_name, fname, loader,<EOL>pkg_name=None)<EOL><DEDENT>if mod_dict:<EOL><INDENT>log.info("<STR_LIT>")<EOL>self._update(mod_dict)<EOL><DEDENT>self.call_reload_hooks()<EOL>
Loads all the config plugin modules to build a working configuration.

If there is a ``localconfig`` module on the python path, it will be
loaded last, overriding other settings.

:param bool clear: Clear out the previous settings before loading