@contextlib.contextmanager<EOL>def modify_config(path='<STR_LIT:.>', commit=True):
config_path = os.path.join(path, C.CONFIG_FILE)<EOL>with io.open(config_path) as f:<EOL><INDENT>config = ordered_load(f.read())<EOL><DEDENT>yield config<EOL>with io.open(config_path, '<STR_LIT:w>', encoding='<STR_LIT>') as config_file:<EOL><INDENT>config_file.write(ordered_dump(config, **C.YAML_DUMP_KWARGS))<EOL><DEDENT>if commit:<EOL><INDENT>git_commit(msg=modify_config.__name__, cwd=path)<EOL><DEDENT>
Modify the config yielded by this context to write to
    .pre-commit-config.yaml