def main(client, team_id):
  # Initialize appropriate service.
  team_service = client.GetService('TeamService', version='v201511')

  # Create a filter statement to select a single team by ID.
  values = [{
      'key': 'teamId',
      'value': {
          'xsi_type': 'NumberValue',
          'value': team_id
      }
  }]
  query = 'WHERE id = :teamId'
  statement = dfp.FilterStatement(query, values)

  while True:
    # Get teams by statement.
    response = team_service.getTeamsByStatement(statement.ToStatement())
    if 'results' in response:
      # Display results.
      for team in response['results']:
        print ('Team with id \'%s\' and name \'%s\' was found.'
               % (team['id'], team['name']))
      statement.offset += dfp.SUGGESTED_PAGE_LIMIT
    else:
      break

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