@staticmethod<EOL><INDENT>def run(command, input=None, exit=<NUM_LIT:0>, shell=False):<DEDENT>
if isinstance(input, str):<EOL><INDENT>input = input.encode()<EOL><DEDENT>stdin = {} if input is None else {"<STR_LIT>": subprocess.PIPE}<EOL>try:<EOL><INDENT>child = subprocess.Popen(command, stdout=subprocess.PIPE,<EOL>stderr=subprocess.PIPE, **stdin)<EOL><DEDENT>except FileNotFoundError as e:<EOL><INDENT>name = command.split('<STR_LIT:U+0020>', <NUM_LIT:1>)[<NUM_LIT:0>] if isinstance(command, str) else command[<NUM_LIT:0>]<EOL>raise DependencyError(name)<EOL><DEDENT>stdout, _ = child.communicate(input=input)<EOL>if exit is not None and child.returncode != exit:<EOL><INDENT>raise Error("<STR_LIT>")<EOL><DEDENT>return stdout.decode()<EOL>
Run `command` passing it stdin from `input`, throwing a DependencyError if comand is not found.
Throws Error if exit code of command is not `exit` (unless `exit` is None).