@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()
Equivalent to ExecuteOrImportScript for Python 2.7 runtime.
dataset/ETHPy150Open BD2KGenomics/toil/src/toil/job.py/Job._unpickle--crossover with--dataset/ETHPy150Open AppScale/appscale/AppServer/google/appengine/tools/dev_appserver.py/ExecutePy27Handler