#NEWLINE# def _write_text( path , contents ) : #NEWLINE# #INDENT# contents = dedent ( contents ) #NEWLINE# dir_path = op . dirname ( path ) #NEWLINE# if ( not op . exists ( dir_path ) ) : #NEWLINE# #INDENT# os . mkdir ( dir_path ) #NEWLINE# #UNINDENT# assert op . isdir ( dir_path ) #NEWLINE# assert ( not op . exists ( path ) ) #NEWLINE# with open ( path , 'w' ) as f : #NEWLINE# #INDENT# f . write ( contents )