<s> import os <EOL> import json <EOL> _CONFIG_JSON = '<STR_LIT>' <EOL> _json = json . load ( open ( _CONFIG_JSON ) ) <EOL> def get ( key ) : <EOL> return _json [ key ] <EOL> _temp_dir = get ( '<STR_LIT>' ) <EOL> def make_dirs ( directory ) : <EOL> if not os . path . exists ( directory ) : <EOL> os . makedirs ( directory ) <EOL> make_dirs ( _temp_dir ) <EOL> def temp_path ( path ) : <EOL> return os . path . join ( _temp_dir , path ) <EOL> def clear_dir ( directory ) : <EOL> filenames = os . listdir ( directory ) <EOL> print ( '<STR_LIT>' . format ( len ( filenames ) ) ) <EOL> for filename in filenames : <EOL> os . remove ( os . path . join ( directory , filename ) ) <EOL> def clear_temp ( ) : <EOL> clear_dir ( _temp_dir ) </s>
