def ExportStateName(state):
 return {STATE_READ: 'READ', STATE_GETTING: 'GETTING', STATE_GOT: 'GOT', STATE_ERROR: 'NOT_GOT'}[state]

def ExportStateName ( state ) : return { STATE_READ : 'READ' , STATE_GETTING : 'GETTING' , STATE_GOT : 'GOT' , STATE_ERROR : 'NOT_GOT' } [ state ]
converts a numeric state identifier to a string .