def ImportStateMessage(state):
 return {STATE_READ: 'Batch read from file.', STATE_SENDING: 'Sending batch to server.', STATE_SENT: 'Batch successfully sent.', STATE_NOT_SENT: 'Error while sending batch.'}[state]

def ImportStateMessage ( state ) : return { STATE_READ : 'Batch read from file.' , STATE_SENDING : 'Sending batch to server.' , STATE_SENT : 'Batch successfully sent.' , STATE_NOT_SENT : 'Error while sending batch.' } [ state ]
converts a numeric state identifier to a status message .