3d03ae2086b232cb6803507ae4defd997c256ec9,tensorflow/python/distribute/multi_process_lib.py,,_set_spawn_exe_path,#,90

Before Change


      // /.../org_tensorflow/tensorflow/python/distribute/input_lib_test_multiworker_gpu
      org_tensorflow_path = sys.argv[0][:sys.argv[0].rfind("/tensorflow")]
      if org_tensorflow_path.endswith("/org_tensorflow"):
        binary = os.environ["TEST_TARGET"][2:].replace(":", "/", 1)
      possible_path = os.path.join(org_tensorflow_path, binary)
      logging.info("Guessed test binary path: %s", possible_path)
      if os.access(possible_path, os.X_OK):
        path = possible_path

After Change


    path_to_use = None
    guess_path = sys.argv[0][:-3]
    guess_path = guess_path.split(os.sep)
    for path_reduction in range(-1, -len(guess_path), -1):
      possible_path = os.sep.join(guess_path[:path_reduction] +
                                  [guess_path[-1]])
      if os.access(possible_path, os.X_OK):
        path_to_use = possible_path
        break
      // The binary can possibly have _gpu suffix.
      possible_path += "_gpu"
      if os.access(possible_path, os.X_OK):
        path_to_use = possible_path
        break
    if path_to_use is None:
      raise RuntimeError("Cannot determine binary path")
    sys.argv[0] = path_to_use
  // Note that this sets the executable for *all* contexts.
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 6

Instances


Project Name: tensorflow/tensorflow
Commit Name: 3d03ae2086b232cb6803507ae4defd997c256ec9
Time: 2020-11-18
Author: crccw@google.com
File Name: tensorflow/python/distribute/multi_process_lib.py
Class Name:
Method Name: _set_spawn_exe_path


Project Name: coala/coala-bears
Commit Name: e4daf7e39fc5d2db6d3139351f1174fb44fa34ff
Time: 2017-01-21
Author: vijthaaa@gmail.com
File Name: bears/haskell/HaskellLintBear.py
Class Name: HaskellLintBear
Method Name: process_output


Project Name: deepmipt/DeepPavlov
Commit Name: 0066f83bc6f9f3861119db2593c3007796d2056c
Time: 2018-08-30
Author: mary.vikhreva@gmail.com
File Name: deeppavlov/models/seq2seq_go_bot/kb.py
Class Name: KnowledgeBaseEntityNormalizer
Method Name: normalize


Project Name: tensorflow/tensorflow
Commit Name: 3d03ae2086b232cb6803507ae4defd997c256ec9
Time: 2020-11-18
Author: crccw@google.com
File Name: tensorflow/python/distribute/multi_process_lib.py
Class Name:
Method Name: _set_spawn_exe_path