def save(func):
def aux(self, *args, **kwargs):<EOL><INDENT>out = func(self, *args, **kwargs)<EOL>path = (hasattr(self, '<STR_LIT:path>') and self.path<EOL>or os.path.join(os.getcwd(), '<STR_LIT>'))<EOL>gpath = (hasattr(self, '<STR_LIT>') and self.gpath<EOL>or os.path.expanduser('<STR_LIT>'))<EOL>if os.path.exists(path):<EOL><INDENT>shutil.copy2(path, os.path.join(os.path.dirname(path), '<STR_LIT>'))<EOL><DEDENT>open(path, '<STR_LIT:w>').write(<EOL>json.dumps({<EOL>'<STR_LIT>': self.data,<EOL>'<STR_LIT>': self.refs,<EOL>'<STR_LIT>': self.options<EOL>})<EOL>)<EOL>open(gpath, '<STR_LIT:w>').write(json.dumps(self.globalOptions))<EOL>return out<EOL><DEDENT>return aux<EOL>
@decorator: Saves data after executing :func:.

    Also performs modifications set as permanent options.