def METHOD_NAME(cmd: Sequence[str], exit_on_error: bool = True, silent: bool = False) -> int:
    if not silent:
        print(" ".join([str(x) for x in cmd]))
    # Flush to ensure correct order output on Windows.
    sys.stdout.flush()
    sys.stderr.flush()
    if silent:
        retcode = subprocess.METHOD_NAME(cmd, stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)
    else:
        retcode = subprocess.METHOD_NAME(cmd)
    if exit_on_error and retcode != 0:
        sys.exit(retcode)
    return retcode