MCPcopy Create free account
hub / github.com/deepspeedai/DeepSpeed / command_exists

Function command_exists

setup.py:161–169  ·  view source on GitHub ↗
(cmd)

Source from the content-addressed store, hash-verified

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

Callers 1

setup.pyFile · 0.85

Calls 1

waitMethod · 0.45

Tested by

no test coverage detected