0bc0f57a4e1de4297ddffbea135f97e57af77b0a,studio/magics.py,StudioMagics,studio_run,#StudioMagics#Any#Any#,27
Before Change
runner_args.append("--capture={}:_ns".format(ns_path))
runner_args.append("--force-git")
runner_args.append("--experiment=" + experiment_key)
p = subprocess.Popen(["studio", "run"] +
runner_args +
["_script.py"],
stdout=subprocess.PIPE,
stderr=subprocess.STDOUT,
cwd=workspace_new,
close_fds=True)
sched = BackgroundScheduler()
sched.start()
logging.getLogger("apscheduler.scheduler").setLevel(60)
def studiotail_func():
try:
data = p.stdout.read()
if data and data != "":
print(data)
except BaseException:
pass
sched.add_job(studiotail_func, "interval", seconds=1, max_instances=1)
with model.get_db_provider() as db:
while True:
experiment = db.get_experiment(experiment_key)
if experiment and experiment.status == "finished":
break
time.sleep(10)
new_ns_path = db.get_artifact(experiment.artifacts["_ns"])
with open(new_ns_path) as f:
new_ns = pickle.loads(f.read())
self.shell.user_ns.update(new_ns)
studiorun_out, _ = p.communicate()
if p.returncode != 0:
print("studio-run returned code " + str(p.returncode))
sched.shutdown()
After Change
script = script_stub.format(script=script_text)
experiment_key = str(time.time()) + "_jupyter_" + str(uuid.uuid4())
print("Running studio with experiment key " + experiment_key)
config = model.get_config()
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 6
Instances
Project Name: studioml/studio
Commit Name: 0bc0f57a4e1de4297ddffbea135f97e57af77b0a
Time: 2017-12-11
Author: peter.zhokhov@sentient.ai
File Name: studio/magics.py
Class Name: StudioMagics
Method Name: studio_run
Project Name: vatlab/SoS
Commit Name: bc823da8c38eae03a311d0ba0627b23b84939b56
Time: 2017-07-30
Author: ben.bog@gmail.com
File Name: src/sos/actions.py
Class Name: SoS_ExecuteScript
Method Name: run
Project Name: scikit-image/scikit-image
Commit Name: ddfac3e42d2ae2e09751de6638d813c76e30ff94
Time: 2018-12-04
Author: mark.harfouche@gmail.com
File Name: tools/check_sdist.py
Class Name:
Method Name: