#NEWLINE# def ensure_dirs( filename ) : #NEWLINE# #INDENT# 'Make sure the directories exist for `filename`.' #NEWLINE# ( dirname , _ ) = os . path . split ( filename ) #NEWLINE# if ( dirname and ( not os . path . exists ( dirname ) ) ) : #NEWLINE# #INDENT# os . makedirs ( dirname )