# Path: opentuner/driverbase.py
# class DriverBase(object):
#     """
#     shared base class between MeasurementDriver and SearchDriver
#     """
# 
#     def __init__(self,
#                  session,
#                  tuning_run,
#                  objective,
#                  tuning_run_main,
#                  args,
#                  **kwargs):
#         self.args = args
#         self.objective = objective
#         self.session = session
#         self.tuning_run_main = tuning_run_main
#         self.tuning_run = tuning_run
#         self.program = tuning_run.program
# 
#     def results_query(self,
#                       generation=None,
#                       objective_ordered=False,
#                       config=None):
#         self.session.flush()
#         q = self.session.query(Result)
#         q = q.filter_by(tuning_run=self.tuning_run)
# 
#         if config:
#             q = q.filter_by(configuration=config)
# 
#         if generation is not None:
#             subq = (self.session.query(DesiredResult.result_id)
#                     .filter_by(tuning_run=self.tuning_run,
#                                generation=generation))
#             q = q.filter(Result.id.in_(subq.subquery()))
# 
#         if objective_ordered:
#             q = self.objective.result_order_by(q)
# 
#         return q
# 
#     def requests_query(self):
#         q = self.session.query(DesiredResult).filter_by(tuning_run=self.tuning_run)
#         return q


import argparse
import logging
import os
import socket
import time
        import subprocess
        import subprocess
from builtins import zip
from datetime import datetime
from multiprocessing.pool import ThreadPool
from past.utils import old_div
from sqlalchemy.exc import SQLAlchemyError
from sqlalchemy.orm.exc import NoResultFound
from opentuner.driverbase import DriverBase
from opentuner.resultsdb.models import *
from __future__ import division
from __future__ import print_function




log = logging.getLogger(__name__)

argparser = argparse.ArgumentParser(add_help=False)
argparser.add_argument('--machine-class',
                       help="name of the machine class being run on")



# Path: opentuner/driverbase.py
# class DriverBase(object):
#     """
#     shared base class between MeasurementDriver and SearchDriver
#     """
# 
#     def __init__(self,
#                  session,
#                  tuning_run,
#                  objective,
#                  tuning_run_main,
#                  args,
#                  **kwargs):
#         self.args = args
#         self.objective = objective
#         self.session = session
#         self.tuning_run_main = tuning_run_main
#         self.tuning_run = tuning_run
#         self.program = tuning_run.program
# 
#     def results_query(self,
#                       generation=None,
#                       objective_ordered=False,
#                       config=None):
#         self.session.flush()
#         q = self.session.query(Result)
#         q = q.filter_by(tuning_run=self.tuning_run)
# 
#         if config:
#             q = q.filter_by(configuration=config)
# 
#         if generation is not None:
#             subq = (self.session.query(DesiredResult.result_id)
#                     .filter_by(tuning_run=self.tuning_run,
#                                generation=generation))
#             q = q.filter(Result.id.in_(subq.subquery()))
# 
#         if objective_ordered:
#             q = self.objective.result_order_by(q)
# 
#         return q
# 
#     def requests_query(self):
#         q = self.session.query(DesiredResult).filter_by(tuning_run=self.tuning_run)
#         return q


# Path: opentuner/measurement/driver.py
import argparse
import logging
import os
import socket
import time
        import subprocess
        import subprocess
from builtins import zip
from datetime import datetime
from multiprocessing.pool import ThreadPool
from past.utils import old_div
from sqlalchemy.exc import SQLAlchemyError
from sqlalchemy.orm.exc import NoResultFound
from opentuner.driverbase import DriverBase
from opentuner.resultsdb.models import *

from __future__ import division
from __future__ import print_function




log = logging.getLogger(__name__)

argparser = argparse.ArgumentParser(add_help=False)
argparser.add_argument('--machine-class',
                       help="name of the machine class being run on")



class MeasurementDriver(DriverBase):