def MapStateMessage(state):
 return {STATE_READ: 'Batch read from file.', STATE_GETTING: 'Querying for batch from server', STATE_GOT: 'Batch successfully fetched.', STATE_ERROR: 'Error while fetching or mapping.'}[state]

def MapStateMessage ( state ) : return { STATE_READ : 'Batch read from file.' , STATE_GETTING : 'Querying for batch from server' , STATE_GOT : 'Batch successfully fetched.' , STATE_ERROR : 'Error while fetching or mapping.' } [ state ]
converts a numeric state identifier to a status message .