'Submits job for execution.
:param Job job: job to execute
:param list[datetime] run_times: list of datetimes specifying when the job should have been run
:raises MaxInstancesReachedError: if the maximum number of allowed instances for this job has been reached'

def submit_job(self, job, run_times):

    assert (self._lock is not None), 'This    executor    has    not    been    started    yet'
    with self._lock:
        if (self._instances[job.id] >= job.max_instances):
            raise MaxInstancesReachedError(job)
        self._do_submit_job(job, run_times)
        self._instances[job.id] += 1
