206447f53847129741d0b1abff789b2788e89a3b,solutionbox/structured_data/datalab_structured_data/_package.py,,local_train,#Any#Any#Any#Any#Any#Any#Any#Any#Any#Any#Any#Any#Any#Any#Any#,178

Before Change


  stderr = sys.stderr
  sys.stderr = sys.stdout
  print("Starting local training.")
  trainer.task.main(args)
  print("Local training done.")
  sys.stderr = stderr

def cloud_train(train_dataset,

After Change


  monitor_process = None
  try:
    print("Starting local training")
    p = subprocess.Popen(" ".join(args),
                         shell=True,
                         stdout=subprocess.PIPE,
                         stderr=subprocess.STDOUT)
    pids_to_kill = [p.pid]

    //script -> name = datalab_structured_data._package
    script = "import %s; %s._wait_and_kill(%s, %s)" % \
          (__name__, __name__, str(os.getpid()), str(pids_to_kill))
    monitor_process = subprocess.Popen(["python", "-c", script])

    while p.poll() is None:
      sys.stdout.write(p.stdout.readline())
    print("Local training done.")
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 6

Instances


Project Name: googledatalab/pydatalab
Commit Name: 206447f53847129741d0b1abff789b2788e89a3b
Time: 2017-03-01
Author: brandondutra@google.com
File Name: solutionbox/structured_data/datalab_structured_data/_package.py
Class Name:
Method Name: local_train


Project Name: studioml/studio
Commit Name: 55b19edff6268cc18ec1de0a1432444a27d225ff
Time: 2017-10-22
Author: peter.zhokhov@sentient.ai
File Name: studio/local_worker.py
Class Name:
Method Name: pip_install_packages


Project Name: studioml/studio
Commit Name: b4c0e43bd2bae70750b20f78b5d83fe0b3a1771d
Time: 2017-07-13
Author: peter.zhokhov@sentient.ai
File Name: studio/local_worker.py
Class Name:
Method Name: worker_loop