# Buggy code
def issueBatchJob(self, command, memory, cores, disk, preemptable):
    """
    Issues the following command returning a unique jobID. Command is the string to run, memory
    is an int giving the number of bytes the job needs to run in and cores is the number of cpus
    needed for the job and error-file is the path of the file to place any std-err/std-out in.
    """
    self.checkResourceRequest(memory, cores, disk)
    jobID = next(self.unusedJobID)
    job = ToilJob(
        jobID=jobID,
        resources=ResourceRequirement(
            memory=memory, cores=cores, disk=disk, preemptable=preemptable
        ),
        command=command,
        userScript=self.userScript,
        toilDistribution=self.toilDistribution,
        environment=self.environment.copy(),
        workerCleanupInfo=self.workerCleanupInfo,
    )
    jobType = job.resources
    log.debug("Queueing the job command: %s with job id: %s ...", command, str(jobID))
    self.jobQueues[jobType].append(job)
    log.debug("... queued")
    return jobID


# Traceback (ImportError)
WARNING:toil.leader:fc48619f_e141_4211_8ab9_3004f95b16df:   ---TOIL WORKER OUTPUT LOG---
WARNING:toil.leader:fc48619f_e141_4211_8ab9_3004f95b16df:   Next available file descriptor: 10
WARNING:toil.leader:fc48619f_e141_4211_8ab9_3004f95b16df:   DEBUG:toil.worker:Next available file descriptor: 10
WARNING:toil.leader:fc48619f_e141_4211_8ab9_3004f95b16df:   DEBUG:urllib3.connectionpool:Setting read timeout to 65
WARNING:toil.leader:fc48619f_e141_4211_8ab9_3004f95b16df:   DEBUG:urllib3.connectionpool:"GET /acmarkellotoilvgjobstore11xxjobitems(PartitionKey='default',RowKey='fc48619f_e141_4211_8ab9_3004f95b16df')?$select= HTTP/1.1" 200 None
WARNING:toil.leader:fc48619f_e141_4211_8ab9_3004f95b16df:   Parsed jobWrapper
WARNING:toil.leader:fc48619f_e141_4211_8ab9_3004f95b16df:   DEBUG:toil.worker:Parsed jobWrapper
WARNING:toil.leader:fc48619f_e141_4211_8ab9_3004f95b16df:   Got a command to run: _toil b5feca2d_3cbf_46a6_81cc_43d5f3a43cb6 /home/cmarkello/toilvenv/local/lib/python2.7/site-packages toil_vg.vg_evaluation_pipeline
WARNING:toil.leader:fc48619f_e141_4211_8ab9_3004f95b16df:   DEBUG:toil.worker:Got a command to run: _toil b5feca2d_3cbf_46a6_81cc_43d5f3a43cb6 /home/cmarkello/toilvenv/local/lib/python2.7/site-packages toil_vg.vg_evaluation_pipeline
WARNING:toil.leader:fc48619f_e141_4211_8ab9_3004f95b16df:   DEBUG:toil.job:Loading user module ModuleDescriptor(dirPath='/home/cmarkello/toilvenv/local/lib/python2.7/site-packages', name='toil_vg.vg_evaluation_pipeline').
WARNING:toil.leader:fc48619f_e141_4211_8ab9_3004f95b16df:   WARNING:toil.resource:Can't find resource for leader path '/home/cmarkello/toilvenv/local/lib/python2.7/site-packages/toil_vg'
WARNING:toil.leader:fc48619f_e141_4211_8ab9_3004f95b16df:   WARNING:toil.resource:Can't localize module ModuleDescriptor(dirPath='/home/cmarkello/toilvenv/local/lib/python2.7/site-packages', name='toil_vg.vg_evaluation_pipeline')
WARNING:toil.leader:fc48619f_e141_4211_8ab9_3004f95b16df:   ERROR:toil.job:Failed to import user module ModuleDescriptor(dirPath='/home/cmarkello/toilvenv/local/lib/python2.7/site-packages', name='toil_vg.vg_evaluation_pipeline') from sys.path=['/home/cmarkello/toilvenv/bin', '/home/cmarkello/toilvenv/lib/python2.7', '/home/cmarkello/toilvenv/lib/python2.7/plat-x86_64-linux-gnu', '/home/cmarkello/toilvenv/lib/python2.7/lib-tk', '/home/cmarkello/toilvenv/lib/python2.7/lib-old', '/home/cmarkello/toilvenv/lib/python2.7/lib-dynload', '/usr/lib/python2.7', '/usr/lib/python2.7/plat-x86_64-linux-gnu', '/usr/lib/python2.7/lib-tk', '/home/cmarkello/toilvenv/local/lib/python2.7/site-packages', '/home/cmarkello/toil/src', '/home/cmarkello/toilvenv/lib/python2.7/site-packages', '/usr/local/lib/python2.7/dist-packages/mesos.interface-0.22.0-py2.7.egg', '/usr/local/lib/python2.7/dist-packages/mesos-0.22.0-py2.7-linux-x86_64.egg', '/home/cmarkello/toil-scripts/src', '/usr/local/lib/python2.7/site-packages', '/usr/local/lib/python2.7/dist-packages', '/usr/lib/python2.7/site-packages', '/usr/lib/python2.7/dist-packages']
WARNING:toil.leader:fc48619f_e141_4211_8ab9_3004f95b16df:   Traceback (most recent call last):
WARNING:toil.leader:fc48619f_e141_4211_8ab9_3004f95b16df:     File "/home/cmarkello/toil/src/toil/worker.py", line 316, in main
WARNING:toil.leader:fc48619f_e141_4211_8ab9_3004f95b16df:       job = Job._loadJob(jobWrapper.command, jobStore)
WARNING:toil.leader:fc48619f_e141_4211_8ab9_3004f95b16df:     File "/home/cmarkello/toil/src/toil/job.py", line 666, in _loadJob
WARNING:toil.leader:fc48619f_e141_4211_8ab9_3004f95b16df:       userModule = cls._loadUserModule(userModule)
WARNING:toil.leader:fc48619f_e141_4211_8ab9_3004f95b16df:     File "/home/cmarkello/toil/src/toil/job.py", line 640, in _loadUserModuleWARNING:toil.leader:fc48619f_e141_4211_8ab9_3004f95b16df:       return importlib.import_module(userModule.name)
WARNING:toil.leader:fc48619f_e141_4211_8ab9_3004f95b16df:     File "/usr/lib/python2.7/importlib/__init__.py", line 37, in import_module
WARNING:toil.leader:fc48619f_e141_4211_8ab9_3004f95b16df:       __import__(name)
WARNING:toil.leader:fc48619f_e141_4211_8ab9_3004f95b16df:   ImportError: No module named toil_vg.vg_evaluation_pipeline
WARNING:toil.leader:fc48619f_e141_4211_8ab9_3004f95b16df:   Exiting the worker because of a failed jobWrapper on host c1agent3
WARNING:toil.leader:fc48619f_e141_4211_8ab9_3004f95b16df:   ERROR:toil.worker:Exiting the worker because of a failed jobWrapper on host c1agent3
WARNING:toil.leader:fc48619f_e141_4211_8ab9_3004f95b16df:   DEBUG:urllib3.connectionpool:Setting read timeout to 65
WARNING:toil.leader:fc48619f_e141_4211_8ab9_3004f95b16df:   DEBUG:urllib3.connectionpool:"GET /acmarkellotoilvgjobstore11xxjobitems(PartitionKey='default',RowKey='fc48619f_e141_4211_8ab9_3004f95b16df')?$select= HTTP/1.1" 200 None
WARNING:toil.leader:fc48619f_e141_4211_8ab9_3004f95b16df:   WARNING:toil.jobWrapper:Due to failure we are reducing the remaining retry count of job fc48619f_e141_4211_8ab9_3004f95b16df to 0

# Fixed code
def issueBatchJob(self, command, memory, cores, disk, preemptable):
    """
    Issues the following command returning a unique jobID. Command is the string to run, memory
    is an int giving the number of bytes the job needs to run in and cores is the number of cpus
    needed for the job and error-file is the path of the file to place any std-err/std-out in.
    """
    self.checkResourceRequest(memory, cores, disk)
    jobID = next(self.unusedJobID)
    job = ToilJob(
        jobID=jobID,
        resources=ResourceRequirement(
            memory=memory, cores=cores, disk=disk, preemptable=preemptable
        ),
        command=command,
        userScript=self.userScript,
        environment=self.environment.copy(),
        workerCleanupInfo=self.workerCleanupInfo,
    )
    jobType = job.resources
    log.debug("Queueing the job command: %s with job id: %s ...", command, str(jobID))
    self.jobQueues[jobType].append(job)
    log.debug("... queued")
    return jobID