def __init__(self, manager, task_id, sub_ids=None, dry_run=False, resubmit=False):
		self.__manager = manager
		self.__task	= self.__manager.load_task(task_id)
		self.__sub_ids = sub_ids
		self.__dry_run = dry_run
		self.__resubmit = resubmit

		self.__logger = logging.getLogger('JSUB')
		if self.__sub_ids==None:
			self.__sub_ids=range(len(self.__task.data['jobvar']))

		self.__initialize_manager()
def is_sql_dirty(sql):
    # This should not happen as using bytes in Python 3 is against db protocol,
    # but some people will pass it anyway
    if isinstance(sql, bytes):
        sql = sql.decode()
    # NOTE: not using regex here for speed
    sql = sql.lower()
    for action in ('update', 'insert', 'delete'):
        p = sql.find(action)
        if p == -1:
            continue
        start, end = p - 1, p + len(action)
        if (start < 0 or sql[start] not in CHARS) and (end >= len(sql) or sql[end] not in CHARS):
            return True
    else:
        return False