def main(args):
  if args.database not in '://':
    args.database = "sqlite:///" + args.database
  engine, Session = opentuner.resultsdb.connect(args.database)
  session = Session()

  config_count = session.query(Configuration).count()
  # result_count = session.query(Result).count()
  # desired_result_count = session.query(DesiredResult).count()

  if args.level >= 1:
    q = (session.query(Configuration)
         .filter(~Configuration.id.in_(session.query(Result.configuration_id)
                                       .filter_by(was_new_best=True)
                                       .subquery()))
         .filter(Configuration.data != None))

    log.info("%s: compacted %d of %d Configurations",
             args.database,
             q.update({'data': None}, False),
             config_count)
    session.commit()

  if args.level >= 2:
    session.execute('VACUUM;')
    session.commit()

  log.info('done')
dataset/ETHPy150Open jansel/opentuner/opentuner/utils/compactdb.py/main/swapped operands of `not in`