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

  # Create statement object to only select a single company by ID.
  values = [{
      'key': 'id',
      'value': {
          'xsi_type': 'NumberValue',
          'value': company_id
      }
  }]
  query = 'WHERE id = :id'
  statement = dfp.FilterStatement(query, values, 1)

  # Get companies by statement.
  response = company_service.getCompaniesByStatement(
      statement.ToStatement())
  if 'results' in response:
    updated_companies = []
    for company in response['results']:
      company['comment'] += ' Updated.'
      updated_companies.append(company)

    # Update the companies on the server.
    companies = company_service.updateCompanies(updated_companies)

    # Display results.
    for company in companies:
      print (('Company with ID \'%s\', name \'%s\', and comment \'%s\''
              'was updated.')
             % (company['id'], company['name'], company['comment']))
  else:
    print 'No companies found to update.'
dataset/ETHPy150Open googleads/googleads-python-lib/examples/dfp/v201511/company_service/update_companies.py/main/original