def run(cmd: str,
        *paths: str,
        cwd: str = '.',
        mute: bool = False,
        filters: typing.Optional[typing.Union[typing.Iterable[str], str]] = None,
        failure_ok: bool = False,
        timeout: float = _DEFAULT_PROCESS_TIMEOUT,
        ) -> typing.Tuple[str, int]:
    """
    Executes a command and returns the result

    Args:
        cmd: command to execute
        paths: paths to search executable in
        cwd: working directory (defaults to ".")
        mute: if true, output will not be printed
        filters: gives a list of partial strings to filter out from the output (stdout or stderr)
        failure_ok: if False (default), a return code different than 0 will exit the application
        timeout: sub-process timeout

    Returns: command output
    """

    filters = _sanitize_filters(filters)

    exe_path, args_list = _parse_cmd(cmd, *paths)

    context = RunContext(  # type: ignore
        exe_path=exe_path,
        capture=sarge.Capture(),
        failure_ok=failure_ok,
        mute=mute,
        args_list=args_list,
        paths=paths,
        cwd=cwd,
        timeout=timeout,
        filters=filters,
    )

    if mute:
        context.result_buffer += f'{context.cmd_as_string}'
    else:
        _LOGGER_PROCESS.info('%s: running', context.cmd_as_string)

    context.start_process()
    monitor_running_process(context)
    check_error(context)

    return context.process_output_as_str, context.return_code
Executes a command and returns the result

    Args:
        cmd: command to execute
        paths: paths to search executable in
        cwd: working directory (defaults to ".")
        mute: if true, output will not be printed
        filters: gives a list of partial strings to filter out from the output (stdout or stderr)
        failure_ok: if False (default), a return code different than 0 will exit the application
        timeout: sub-process timeout

    Returns: command output