def run_commands(commands, settings):
sprint = settings["<STR_LIT>"]<EOL>quiet = settings["<STR_LIT>"]<EOL>error = settings["<STR_LIT:error>"]<EOL>enhanced_errors = True<EOL>the_shell = None<EOL>if settings["<STR_LIT>"]:<EOL><INDENT>enhanced_errors = False<EOL><DEDENT>if "<STR_LIT>" in settings:<EOL><INDENT>the_shell = settings["<STR_LIT>"]<EOL><DEDENT>windows_p = sys.platform == "<STR_LIT:win32>"<EOL>STDOUT = None<EOL>STDERR = None<EOL>if quiet:<EOL><INDENT>STDOUT = PIPE<EOL>STDERR = PIPE<EOL><DEDENT>commands = commands.rstrip()<EOL>sprint("<STR_LIT>".format(commands), level="<STR_LIT>")<EOL>if not quiet:<EOL><INDENT>sprint(commands)<EOL><DEDENT>if the_shell:<EOL><INDENT>tmp = shlex.split(the_shell)<EOL>the_shell = tmp[<NUM_LIT:0>]<EOL>tmp = tmp[<NUM_LIT:1>:]<EOL>if enhanced_errors and not windows_p:<EOL><INDENT>tmp.append("<STR_LIT>")<EOL><DEDENT>tmp.append(commands)<EOL>commands = tmp<EOL><DEDENT>else:<EOL><INDENT>if enhanced_errors and not windows_p:<EOL><INDENT>commands = ["<STR_LIT>", commands]<EOL><DEDENT><DEDENT>p = Popen(commands, shell=True, stdout=STDOUT, stderr=STDERR,<EOL>executable=the_shell)<EOL>out, err = p.communicate()<EOL>if p.returncode:<EOL><INDENT>if quiet:<EOL><INDENT>error(err.decode(locale.getpreferredencoding()))<EOL><DEDENT>error("<STR_LIT>")<EOL>sys.exit(<NUM_LIT:1>)<EOL><DEDENT>
Runs the commands supplied as an argument
It will exit the program if the commands return a
non-zero code

Args:
    the commands to run
    The settings dictionary