def main(client, rate_card_id):
  # Initialize appropriate service.
  base_rate_service = client.GetService('BaseRateService', version='v201508')

  # Create a filter statement for base rates for a single rate card.
  values = [{
      'key': 'rateCardId',
      'value': {
          'xsi_type': 'NumberValue',
          'value': rate_card_id
      }
  }]
  query = 'where rateCardId = :rateCardId ORDER BY id ASC'
  statement = dfp.FilterStatement(query, values)

  # Get base rates by statement.
  while True:
    response = base_rate_service.getBaseRatesByStatement(
        statement.ToStatement())
    if 'results' in response:
      # Display results.
      for base_rate in response['results']:
        print ('Base rate with ID \'%s\' and type \'%s\' belonging to '
               'rate card ID \'%s\' was found.' % (
                   base_rate['id'],
                   dfp.DfpClassType(base_rate),
                   base_rate['rateCardId']))
      statement.offset += dfp.SUGGESTED_PAGE_LIMIT
    else:
      break

  print '\nNumber of results found: %s' % response['totalResultSetSize']
dataset/ETHPy150Open googleads/googleads-python-lib/examples/dfp/v201508/base_rate_service/get_base_rates_for_a_rate_card.py/main/original