def format_term_stat(term_stat):
    """Turn term_stat dict from get_run_info into something human-readable."""
    if term_stat['timed_out']:
        desc = 'Killed by timeout; '
    else:
        desc = 'Ran to completion; '
    if term_stat['bad_retcode']:
        desc += 'signalled error on termination'
        if term_stat['timed_out']:
            desc += ", but probably just because it was SIGKILL'd after " \
                    "timeout"
    else:
        desc += 'did not signal error'
    return desc