code: def UploadImage(client, filepath):
    
    media_service = client.GetService('MediaService', 'v201809')
  
    with open(filepath, 'rb') as image_handle:
      image_data = image_handle.read().decode('utf-8')
  
    image = [{
        'xsi_type': 'Image',
        'data': image_data,
        'type': 'IMAGE'
    }]
  
    image = media_service.upload(image)[0]
  
    return image
docs: Uploads a .jpg image with the given filepath via the AdWords MediaService.
  
    Args:
      client: an AdWordsClient instance.
      filepath: a str filepath to the .jpg file to be uploaded.
  
    Returns:
      The created Image as a sudsobject.