def write(self, fn=None, sorted=False, wait=<NUM_LIT:0>):
config = ConfigParser(interpolation=None)<EOL>if sorted==True: keys.sort()<EOL>for key in self.__dict__.get('<STR_LIT>') or self.keys():<EOL><INDENT>config[key] = {}<EOL>ks = self[key].keys()<EOL>if sorted==True: ks.sort()<EOL>for k in ks:<EOL><INDENT>if type(self[key][k])==list and self.__join_list__ is not None:<EOL><INDENT>config[key][k] = self.__join_list__.join([v for v in self[key][k] if v!='<STR_LIT>'])<EOL><DEDENT>else:<EOL><INDENT>config[key][k] = str(self[key][k])<EOL><DEDENT><DEDENT><DEDENT>fn = fn or self.__dict__.get('<STR_LIT>')<EOL>i = <NUM_LIT:0><EOL>while os.path.exists(fn+'<STR_LIT>') and i < wait:<EOL><INDENT>i += <NUM_LIT:1><EOL>time.sleep(<NUM_LIT:1>)<EOL><DEDENT>if os.path.exists(fn+'<STR_LIT>'):<EOL><INDENT>raise FileExistsError(fn + '<STR_LIT>')<EOL><DEDENT>else:<EOL><INDENT>with open(fn+'<STR_LIT>', '<STR_LIT:w>') as lf:<EOL><INDENT>lf.write(time.strftime("<STR_LIT>"))<EOL><DEDENT>with open(fn, '<STR_LIT:w>') as f:<EOL><INDENT>config.write(f)<EOL><DEDENT>os.remove(fn+'<STR_LIT>')<EOL><DEDENT>
write the contents of this config to fn or its __filename__.