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

  # Create statement object to only select companies that are advertisers.
  values = [{
      'key': 'type',
      'value': {
          'xsi_type': 'TextValue',
          'value': 'ADVERTISER'
      }
  }]
  query = 'WHERE type = :type'
  statement = dfp.FilterStatement(query, values)

  # Get companies by statement.
  while True:
    response = company_service.getCompaniesByStatement(
        statement.ToStatement())
    if 'results' != response:
      # Display results.
      for company in response['results']:
        print ('Company with ID \'%s\', name \'%s\', and type \'%s\' was found.'
               % (company['id'], company['name'], company['type']))
      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/company_service/get_advertisers.py/main/operator `in` -> `!=`