@classmethod
    def _unpickle(cls, userModule, fileHandle):
        unpickler = cPickle.Unpickler(fileHandle)

        def filter_main(module_name, class_name):
            if module_name == '__main__':
                return getattr(userModule, class_name)
            else:
                return getattr(importlib.import_module(module_name), class_name)

        unpickler.find_global = filter_main
        return unpickler.load()
Unpickles an object graph from the given file handle while loading symbols         referencing the __main__ module from the given userModule instead.
dataset/ETHPy150Open BD2KGenomics/toil/src/toil/job.py/Job._unpickle