<s> """<STR_LIT>""" <EOL> import base64 <EOL> from googleads import adwords <EOL> IMAGE_FILENAME = '<STR_LIT>' <EOL> def main ( client , image_filename ) : <EOL> media_service = client . GetService ( '<STR_LIT>' , version = '<STR_LIT>' ) <EOL> with open ( image_filename , '<STR_LIT:r>' ) as image_handle : <EOL> image_data = base64 . encodestring ( image_handle . read ( ) ) <EOL> media = [ { <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT:data>' : image_data , <EOL> '<STR_LIT:type>' : '<STR_LIT>' <EOL> } ] <EOL> media = media_service . upload ( media ) [ <NUM_LIT:0> ] <EOL> if media : <EOL> dimensions = dict ( [ ( entry [ '<STR_LIT:key>' ] , entry [ '<STR_LIT:value>' ] ) <EOL> for entry in media [ '<STR_LIT>' ] ] ) <EOL> print ( '<STR_LIT>' <EOL> '<STR_LIT>' % ( media [ '<STR_LIT>' ] , dimensions [ '<STR_LIT>' ] [ '<STR_LIT>' ] , <EOL> dimensions [ '<STR_LIT>' ] [ '<STR_LIT:width>' ] , media [ '<STR_LIT>' ] ) ) <EOL> else : <EOL> print '<STR_LIT>' <EOL> if __name__ == '<STR_LIT:__main__>' : <EOL> adwords_client = adwords . AdWordsClient . LoadFromStorage ( ) <EOL> main ( adwords_client , IMAGE_FILENAME ) </s>
