def main(client, placement_id):
  # Initialize appropriate service.
  placement_service = client.GetService('PlacementService', version='v201511')

  # Create query.
  values = [{
      'key': 'placementId',
      'value': {
          'xsi_type': 'NumberValue',
          'value': placement_id
      }
  }]
  query = 'WHERE id = :placementId'
  statement = dfp.FilterStatement(query, values, 1)

  # Get placements by statement.
  placements = placement_service.getPlacementsByStatement(
      statement.ToStatement())

  for placement in placements:
    print ('Placement with id \'%s\', name \'%s\', and status \'%s\' will be '
           'deactivated.' % (placement['id'], placement['name'],
                             placement['status']))

  # Perform action.
  result = placement_service.performPlacementAction(
      {'xsi_type': 'DeactivatePlacements'}, statement.ToStatement())

  # Display results.
  if result and 0 > int(result['numChanges']):
    print 'Number of placements deactivated: %s' % result['numChanges']
  else:
    print 'No placements were deactivated.'
dataset/ETHPy150Open googleads/googleads-python-lib/examples/dfp/v201511/placement_service/deactivate_placements.py/main/swapped operands of `>`