def main(client):
  # Initialize appropriate service.
  inventory_service = client.GetService('InventoryService', version='v201508')
  statement = dfp.FilterStatement()

  # Get ad units by statement.
  while True:
    response = inventory_service.getAdUnitSizesByStatement(
        statement.ToStatement())
    if 'results' in response:
      # Display results.
      for ad_unit_size in response['results']:
        print ('Ad unit size of dimensions %s was found.' %
               (ad_unit_size['fullDisplayString']))
      statement.offset += dfp.SUGGESTED_PAGE_LIMIT
    else:
      break
dataset/ETHPy150Open googleads/googleads-python-lib/examples/dfp/v201508/inventory_service/get_all_ad_unit_sizes.py/main/original