def get_return_value(answer, gateway_client, target_id=None, name=None):
 if is_error(answer)[0]:
  if (len(answer) > 1):
   type = answer[1]
   value = OUTPUT_CONVERTER[type](answer[2:], gateway_client)
   if (answer[1] == REFERENCE_TYPE):
    raise Py4JJavaError(u'An error occurred while calling {0}{1}{2}.\n'.format(target_id, u'.', name), value)
   else:
    raise Py4JError(u'An error occurred while calling {0}{1}{2}. Trace:\n{3}\n'.format(target_id, u'.', name, value))
  else:
   raise Py4JError(u'An error occurred while calling {0}{1}{2}'.format(target_id, u'.', name))
 else:
  type = answer[1]
  if (type == VOID_TYPE):
   return
  else:
   return OUTPUT_CONVERTER[type](answer[2:], gateway_client)

def get_return_value ( answer , gateway_client , target_id = None , name = None ) : if is_error ( answer ) [ 0 ] : if ( len ( answer ) > 1 ) : type = answer [ 1 ] value = OUTPUT_CONVERTER [ type ] ( answer [ 2 : ] , gateway_client ) if ( answer [ 1 ] == REFERENCE_TYPE ) : raise Py4JJavaError ( u'An error occurred while calling {0}{1}{2}.\n' . format ( target_id , u'.' , name ) , value ) else : raise Py4JError ( u'An error occurred while calling {0}{1}{2}. Trace:\n{3}\n' . format ( target_id , u'.' , name , value ) ) else : raise Py4JError ( u'An error occurred while calling {0}{1}{2}' . format ( target_id , u'.' , name ) ) else : type = answer [ 1 ] if ( type == VOID_TYPE ) : return else : return OUTPUT_CONVERTER [ type ] ( answer [ 2 : ] , gateway_client )
converts an answer received from the java gateway into a python object .