def formatSlurmJobState(stateId):
    """
    Convert the Job State ID from Slurm acctdb to the friendly name
    """
    states = {
        3: 'COMPLETED',
        5: 'FAILED'
    }
    state = states.get(stateId, "UNKNOWN")
    return state