def main(client):
  # Initialize appropriate service.
  activity_service = client.GetService('ActivityService', version='v201508')

  # Create statement object to select only all activities.
  statement = dfp.FilterStatement()

  # Get activities by statement.
  while True:
    response = activity_service.getActivitiesByStatement(
        statement.ToStatement())
    if 'results' in response:
      # Display results.
      for activity in response['results']:
        print ('Activity with ID \'%s\', name \'%s\', and type \'%s\' was '
               'found.' % (activity['id'], activity['name'], activity['type']))
      statement.offset += dfp.SUGGESTED_PAGE_LIMIT
    else:
      break

  print response['totalResultSetSize'] % '\nNumber of results found: %s'
dataset/ETHPy150Open googleads/googleads-python-lib/examples/dfp/v201508/activity_service/get_all_activities.py/main/swapped operands of `%`