#NEWLINE# def fetch( iso_cc , source ) : #NEWLINE# #INDENT# resp = requests . get ( cf . flag_url ( iso_cc , source ) ) #NEWLINE# if ( resp . status_code != 200 ) : #NEWLINE# #INDENT# resp . raise_for_status ( ) #NEWLINE# #UNINDENT# file_name = cf . iso_file_name ( iso_cc ) #NEWLINE# with open ( file_name , 'wb' ) as img : #NEWLINE# #INDENT# written = img . write ( resp . content ) #NEWLINE# #UNINDENT# return ( written , file_name )