1c6f1efa8b297f73bde09f8bcbc876439b8edf4e,tools/nni_gpu_tool/gpu_metrics_collector.py,,check_ready_to_run,#,13

Before Change


        pgrep_output = subprocess.check_output("pgrep -fxu "$(whoami)" \"python3 -m nni_gpu_tool.gpu_metrics_collector\"", shell=True)
        pidList = []
        for pid in pgrep_output.splitlines():
            pidList.append(int(pid))
        pidList.remove(os.getpid())
        return not pidList

After Change


        pidList = []
        for pid in pgrep_output.splitlines():
            pid = pid.decode()
            if "pgrep " in pid or pid.startswith("%s " % os.getpid()) or pid.startswith("%s " % os.getppid()):
                continue
            pidList.append(pid)
        return not pidList

Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 3

Instances


Project Name: Microsoft/nni
Commit Name: 1c6f1efa8b297f73bde09f8bcbc876439b8edf4e
Time: 2020-04-26
Author: 27178119+squirrelsc@users.noreply.github.com
File Name: tools/nni_gpu_tool/gpu_metrics_collector.py
Class Name:
Method Name: check_ready_to_run


Project Name: NervanaSystems/nlp-architect
Commit Name: f2889ca90ddd60b19070b7e8fbcb0867ae4c47ed
Time: 2019-05-01
Author: peter.izsak@intel.com
File Name: setup.py
Class Name:
Method Name:


Project Name: home-assistant/home-assistant
Commit Name: 04aa4e898a31e459a4f478989ea13c6d6f3efd97
Time: 2016-12-11
Author: glance@acc.umu.se
File Name: homeassistant/components/media_player/denon.py
Class Name: DenonDevice
Method Name: update