def execute(cmd, verbosityThreshold = <NUM_LIT:1>, **kwargs):
global exectue_defaults<EOL>opts = merge(exectue_defaults, kwargs)              <EOL>subopts = filterKWArgsForFunc(opts, subprocess.Popen)<EOL>formattedCmd = cmd.format(**getFormatBindings(cmd,<NUM_LIT:1>))<EOL>shouldPrint = opts['<STR_LIT>'] >= verbosityThreshold<EOL>isDryrun = opts['<STR_LIT>']<EOL>if shouldPrint:<EOL><INDENT>msg = "<STR_LIT>" if isDryrun else "<STR_LIT>"<EOL>pre = "<STR_LIT:(>"+subopts['<STR_LIT>']+"<STR_LIT:)>" if (subopts['<STR_LIT>'] != exectue_defaults['<STR_LIT>']) else "<STR_LIT>"<EOL>print("<STR_LIT>".format(pre=pre, formattedCmd=formattedCmd, msg=msg))<EOL><DEDENT>if isDryrun:<EOL><INDENT>return (<NUM_LIT:0>, None, None)<EOL><DEDENT>printStdOut = shouldPrint and opts['<STR_LIT>']<EOL>printStdErr = shouldPrint and opts['<STR_LIT>']<EOL>returnCode = <NUM_LIT:0><EOL>if opts['<STR_LIT>']:<EOL><INDENT>(returnCode, stdOut, stdErr) = _AsynchronouslyGetProcessOutput(formattedCmd, printStdOut, printStdErr, **subopts)    <EOL><DEDENT>else:<EOL><INDENT>subopts['<STR_LIT>'] = None if printStdOut else subprocess.PIPE<EOL>subopts['<STR_LIT>'] = None if printStdErr else subprocess.PIPE<EOL>process = subprocess.Popen(formattedCmd, **subopts)<EOL>res = process.communicate()<EOL>returnCode = process.returncode<EOL>stdOut = res[<NUM_LIT:0>]<EOL>stdErr = res[<NUM_LIT:1>]<EOL><DEDENT>if returnCode and not opts['<STR_LIT>']:<EOL><INDENT>print(colored('<STR_LIT>'.format(cmd, returnCode),'<STR_LIT>'))<EOL>sys.exit(returnCode)<EOL><DEDENT>return (returnCode, stdOut, stdErr)<EOL>
execute the passed in command in the shell