return thread_id;
}
private String execute(String function, Map kwargs) {
Jep jep = get_jep();
try {
jep.set("function", function);
// convert kwargs to a json string
if (kwargs == null) {
jep.set("kwargs", "{}");
}
else {
Writer kwargs_writer = new StringWriter();
mapper.writeValue(kwargs_writer, kwargs);
String kwargs_json = kwargs_writer.toString();
jep.set("kwargs", kwargs_json);
}
// execute the python script
//jep.runScript("./delegator.py");
jep.eval("delegate()");
String ret_val = (String) jep.getValue("ret_val");
return ret_val;
} catch (jep.JepException e) {
System.out.println("Error getting value from Jep");
System.out.println(e);
} catch (IOException e) {