#NEWLINE# @ contextmanager #NEWLINE# def restoring_config( filename ) : #NEWLINE# #INDENT# with open ( sample ( filename ) ) as f : #NEWLINE# #INDENT# cfg = yaml . load ( cfg ) #NEWLINE# #UNINDENT# try : #NEWLINE# #INDENT# ( yield ) #NEWLINE# #UNINDENT# finally : #NEWLINE# #INDENT# alter_yaml ( filename , cfg )