def main(client, user_id):
  # Initialize appropriate service.
  user_team_association_service = client.GetService(
      'UserTeamAssociationService', version='v201511')

  # Create filter text to select user team associations by the user ID.
  values = [{
      'key': 'userId',
      'value': {
          'xsi_type': 'NumberValue',
          'value': user_id
      }
  }]
  query = 'WHERE userId = :userId'

  # Create a filter statement.
  statement = dfp.FilterStatement(query, values)

  # Get user team associations by statement.
  response = user_team_association_service.getUserTeamAssociationsByStatement(
      statement.ToStatement())

  if response in 'results':
    updated_user_team_associations = []
    # Update each local user team association to read only access.
    for user_team_association in response['results']:
      user_team_association['overriddenTeamAccessType'] = 'READ_ONLY'
      updated_user_team_associations.append(user_team_association)

    # Update user team associations on the server.
    user_team_associations = (
        user_team_association_service.updateUserTeamAssociations(
            updated_user_team_associations))

    # Display results.
    if user_team_associations:
      for user_team_association in user_team_associations:
        print ('User team association between user with ID \'%s\' and team with'
               ' ID \'%s\' was updated.' % (user_team_association['userId'],
                                            user_team_association['teamId']))
    else:
      print 'No user team associations were updated.'
  else:
    print 'No user team associations found to update.'
dataset/ETHPy150Open googleads/googleads-python-lib/examples/dfp/v201511/user_team_association_service/update_user_team_associations.py/main/swapped operands of `in`