MCPcopy
hub / github.com/deepspeedai/DeepSpeed / command_exists

Function command_exists

setup.py:160–168  ·  view source on GitHub ↗
(cmd)

Source from the content-addressed store, hash-verified

158
159
160def command_exists(cmd):
161 if sys.platform == "win32":
162 safe_cmd = shlex.split(f'{cmd}')
163 result = subprocess.Popen(safe_cmd, stdout=subprocess.PIPE)
164 return result.wait() == 1
165 else:
166 safe_cmd = shlex.split(f"bash -c type {cmd}")
167 result = subprocess.Popen(safe_cmd, stdout=subprocess.PIPE)
168 return result.wait() == 0
169
170
171def op_envvar(op_name):

Callers 1

setup.pyFile · 0.85

Calls 1

waitMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…