c776afc9c31227c919b75a42f1b3922095ae1d53,perfzero/lib/cloud_manager.py,,run_command,#Any#Any#,32

Before Change


  Raises:
    Exception: raised when the command execution has non-zero exit code
  
  if is_from_user:
    logging.info("Executing command: %s\n", cmd)
  else:
    logging.debug("Executing command: %s\n", cmd)

  stdout = ""
  p = subprocess.Popen(cmd, stdout=subprocess.PIPE,
                       stderr=subprocess.STDOUT, shell=True)
  exit_code = None

After Change


    exit_code = p.poll()
    line = p.stdout.readline().decode("utf-8")
    stdout += line
    _log(line)
  if exit_code and is_from_user:
    sys.exit(exit_code)
  elif exit_code:
    raise Exception("Command:\n{}\nfailed with output:\n{}".format(cmd, stdout))
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 3

Instances


Project Name: tensorflow/benchmarks
Commit Name: c776afc9c31227c919b75a42f1b3922095ae1d53
Time: 2019-05-15
Author: ayushd@google.com
File Name: perfzero/lib/cloud_manager.py
Class Name:
Method Name: run_command


Project Name: tensorflow/models
Commit Name: 2d34259281a6251cbdc67103ce8a1310010b8ceb
Time: 2020-10-05
Author: dhr@google.com
File Name: orbit/controller.py
Class Name: Controller
Method Name: evaluate


Project Name: tensorflow/models
Commit Name: 2d34259281a6251cbdc67103ce8a1310010b8ceb
Time: 2020-10-05
Author: dhr@google.com
File Name: orbit/controller.py
Class Name: Controller
Method Name: train