<s> from twisted . internet . task import react <EOL> import treq <EOL> def download_file ( reactor , url , destination_filename ) : <EOL> destination = file ( destination_filename , '<STR_LIT:w>' ) <EOL> d = treq . get ( url ) <EOL> d . addCallback ( treq . collect , destination . write ) <EOL> d . addBoth ( lambda _ : destination . close ( ) ) <EOL> return d <EOL> react ( download_file , [ '<STR_LIT>' , '<STR_LIT>' ] ) </s>
