def save(f):
global _groups<EOL>c = {}<EOL>for group_name, group in _groups.items():<EOL><INDENT>section = {var.name: var.value for var in group.updated_vars()}<EOL>if not section:<EOL><INDENT>continue<EOL><DEDENT>c[group_name] = section<EOL><DEDENT>yaml.safe_dump(c, f, line_break=True)<EOL>
Save current config state to an yml file stream identified by |f|

:param f: where to write the config file