def extract_response(raw_response):
 if (not raw_response):
  raise InvalidResponseError('Empty response')
 try:
  payload = deserialize(raw_response)
 except ValueError as exc:
  raise InvalidResponseError(str(exc))
 status = payload['status']
 if (status == 'success'):
  return payload['retval']
 elif (status == 'failure'):
  raise RemoteExecuteError(payload.get('reason'))
 else:
  raise UnknownStatusError(str(status))

def extract_response ( raw_response ) : if ( not raw_response ) : raise InvalidResponseError ( 'Empty response' ) try : payload = deserialize ( raw_response ) except ValueError as exc : raise InvalidResponseError ( str ( exc ) ) status = payload [ 'status' ] if ( status == 'success' ) : return payload [ 'retval' ] elif ( status == 'failure' ) : raise RemoteExecuteError ( payload . get ( 'reason' ) ) else : raise UnknownStatusError ( str ( status ) )
extract the response text from a raw json response .