import signal


def translate_exit_code(exit_code):
    """ @brief Check exit code and convert it to a human readable string
    
    @param exit_code The exit code from a program

    @return tuple containing a human readeable representation of the exit code
            and a boolean value indicating succcess of the exit code, in that
            order
    """
    hr_str = ''
    success = False

    if exit_code == None:
        hr_str = 'Process timed out'
        success = True
    elif exit_code == 0:
        hr_str = 'Process exited with code 0'
        success = True
    elif exit_code < 0:
        signal_name = signal.Signals(abs(exit_code)).name
        hr_str = 'Process exited with Signal ' + signal_name
        success = False
    else:
        hr_str = 'Process exited with a non-zero exit code ' + str(exit_code)
        success = False

    return hr_str, success