22 lines
861 B
Python
22 lines
861 B
Python
"""Route the verified measurement to the original scientific worker."""
|
|
|
|
import argparse
|
|
from pathlib import Path
|
|
import sys
|
|
from types import FunctionType
|
|
|
|
from track_b_gino_import_checked_entry import authorized_child
|
|
from track_b_gino_paper_keyword_patch import extract_patched_paper_code
|
|
from track_b_gino_shapenet_worker import work
|
|
|
|
|
|
if __name__ == "__main__":
|
|
parser = argparse.ArgumentParser(description=__doc__)
|
|
parser.add_argument("root", type=Path)
|
|
root = parser.parse_args().root.resolve()
|
|
c = authorized_child(root)
|
|
if str(Path(sys.executable).absolute()) != c["environment"]["python"]:
|
|
raise PermissionError("The worker did not start with the accepted interpreter")
|
|
namespace = dict(work.__globals__, extract_paper_code=extract_patched_paper_code)
|
|
FunctionType(work.__code__, namespace, work.__name__)(root, c)
|