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