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

Function command_exists

setup.py:136–144  ·  view source on GitHub ↗
(cmd)

Source from the content-addressed store, hash-verified

134
135
136def command_exists(cmd):
137 if sys.platform == "win32":
138 safe_cmd = shlex.split(f'{cmd}')
139 result = subprocess.Popen(safe_cmd, stdout=subprocess.PIPE)
140 return result.wait() == 1
141 else:
142 safe_cmd = shlex.split(f"bash -c type {cmd}")
143 result = subprocess.Popen(safe_cmd, stdout=subprocess.PIPE)
144 return result.wait() == 0
145
146
147def op_envvar(op_name):

Callers 1

setup.pyFile · 0.85

Calls 1

waitMethod · 0.45

Tested by

no test coverage detected