def parse_config(f):
try:<EOL><INDENT>c = yaml.safe_load(f)<EOL>for section_name, section in c.items():<EOL><INDENT>group = get_group(section_name)<EOL>for key, val in section.items():<EOL><INDENT>group.update(key)<EOL>setattr(group, key, val)<EOL><DEDENT><DEDENT><DEDENT>except Exception:<EOL><INDENT>raise ConfigError("<STR_LIT>")<EOL><DEDENT>
Load an yml-formatted configuration from file stream |f|

:param file f: Where to read the config.