# Buggy code
def getJobStore(cls, locator):
    """
    Create an instance of the concrete job store implementation that matches the given locator.

    :param str locator: The location of the job store to be represent by the instance

    :return: an instance of a concrete subclass of AbstractJobStore
    :rtype: toil.jobStores.abstractJobStore.AbstractJobStore
    """
    name, rest = cls.parseLocator(locator)
    if name == "file":
        from toil.jobStores.fileJobStore import FileJobStore

        return FileJobStore(rest)
    elif name == "aws":
        from toil.jobStores.aws.jobStore import AWSJobStore

        return AWSJobStore(rest)
    elif name == "azure":
        from toil.jobStores.azureJobStore import AzureJobStore

        return AzureJobStore(rest)
    elif name == "google":
        from toil.jobStores.googleJobStore import GoogleJobStore

        projectID, namePrefix = rest.split(":", 1)
        return GoogleJobStore(namePrefix, projectID, config=config)
    else:
        raise RuntimeError("Unknown job store implementation '%s'" % name)


# Traceback (ImportError)
WARNING:toil.leader:The jobWrapper seems to have left a log file, indicating failure: 52d0d400_4080_480d_9c53_e7a7624b20e9
WARNING:toil.leader:Reporting file: 52d0d400_4080_480d_9c53_e7a7624b20e9
WARNING:toil.leader:52d0d400_4080_480d_9c53_e7a7624b20e9:       ---TOIL WORKER OUTPUT LOG---
WARNING:toil.leader:52d0d400_4080_480d_9c53_e7a7624b20e9:       WARNING:toil.resource:Can't find resource for leader path '/home/anovak/hgvm-graph-bakeoff-evaluations/scripts'
WARNING:toil.leader:52d0d400_4080_480d_9c53_e7a7624b20e9:       WARNING:toil.resource:Can't localize module ModuleDescriptor(dirPath='/home/anovak/hgvm-graph-bakeoff-evaluations/scripts', name='parallelMappingEvaluation')
WARNING:toil.leader:52d0d400_4080_480d_9c53_e7a7624b20e9:       ERROR:toil.job:Failed to import user module ModuleDescriptor(dirPath='/home/anovak/hgvm-graph-bakeoff-evaluations/scripts', name='parallelMappingEvaluation') from sys.path=['/usr/local/bin', '/usr/local/lib/python2.7/dist-packages/pip-8.1.2-py2.7.egg', '/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', '/usr/lib/python2.7', '/usr/lib/python2.7/plat-x86_64-linux-gnu', '/usr/lib/python2.7/lib-tk', '/usr/lib/python2.7/lib-old', '/usr/lib/python2.7/lib-dynload', '/usr/local/lib/python2.7/dist-packages', '/usr/lib/python2.7/dist-packages', '/home/anovak/hgvm-graph-bakeoff-evaluations/scripts']
WARNING:toil.leader:52d0d400_4080_480d_9c53_e7a7624b20e9:       Traceback (most recent call last):
WARNING:toil.leader:52d0d400_4080_480d_9c53_e7a7624b20e9:         File "/usr/local/lib/python2.7/dist-packages/toil/worker.py", line 316, in main
WARNING:toil.leader:52d0d400_4080_480d_9c53_e7a7624b20e9:           job = Job._loadJob(jobWrapper.command, jobStore)
WARNING:toil.leader:52d0d400_4080_480d_9c53_e7a7624b20e9:         File "/usr/local/lib/python2.7/dist-packages/toil/job.py", line 666, in _loadJob
WARNING:toil.leader:52d0d400_4080_480d_9c53_e7a7624b20e9:           userModule = cls._loadUserModule(userModule)
WARNING:toil.leader:52d0d400_4080_480d_9c53_e7a7624b20e9:         File "/usr/local/lib/python2.7/dist-packages/toil/job.py", line 640, in _loadUserModule
WARNING:toil.leader:52d0d400_4080_480d_9c53_e7a7624b20e9:           return importlib.import_module(userModule.name)
WARNING:toil.leader:52d0d400_4080_480d_9c53_e7a7624b20e9:         File "/usr/lib/python2.7/importlib/__init__.py", line 37, in import_module
WARNING:toil.leader:52d0d400_4080_480d_9c53_e7a7624b20e9:           __import__(name)
WARNING:toil.leader:52d0d400_4080_480d_9c53_e7a7624b20e9:       ImportError: No module named parallelMappingEvaluation
WARNING:toil.leader:52d0d400_4080_480d_9c53_e7a7624b20e9:       Exiting the worker because of a failed jobWrapper on host amn2agent3
WARNING:toil.leader:52d0d400_4080_480d_9c53_e7a7624b20e9:       ERROR:toil.worker:Exiting the worker because of a failed jobWrapper on host amn2agent3
WARNING:toil.leader:52d0d400_4080_480d_9c53_e7a7624b20e9:       WARNING:toil.jobWrapper:Due to failure we are reducing the remaining retry count of job 52d0d400_4080_480d_9c53_e7a7624b20e9 to 0
WARNING:toil.leader:Job: 52d0d400_4080_480d_9c53_e7a7624b20e9 is completely failed

# Fixed code
def getJobStore(cls, locator):
    """
    Create an instance of the concrete job store implementation that matches the given locator.

    :param str locator: The location of the job store to be represent by the instance

    :return: an instance of a concrete subclass of AbstractJobStore
    :rtype: toil.jobStores.abstractJobStore.AbstractJobStore
    """
    name, rest = cls.parseLocator(locator)
    if name == "file":
        from toil.jobStores.fileJobStore import FileJobStore

        return FileJobStore(rest)
    elif name == "aws":
        from toil.jobStores.aws.jobStore import AWSJobStore

        return AWSJobStore(rest)
    elif name == "azure":
        from toil.jobStores.azureJobStore import AzureJobStore

        return AzureJobStore(rest)
    elif name == "google":
        from toil.jobStores.googleJobStore import GoogleJobStore

        projectID, namePrefix = rest.split(":", 1)
        return GoogleJobStore(namePrefix, projectID)
    else:
        raise RuntimeError("Unknown job store implementation '%s'" % name)