def ImportStateName(state):
 return {STATE_READ: 'READ', STATE_GETTING: 'SENDING', STATE_GOT: 'SENT', STATE_NOT_SENT: 'NOT_SENT'}[state]

def ImportStateName ( state ) : return { STATE_READ : 'READ' , STATE_GETTING : 'SENDING' , STATE_GOT : 'SENT' , STATE_NOT_SENT : 'NOT_SENT' } [ state ]
converts a numeric state identifier to a string .