[ADD] porting note: must setup environment's localcontext to use the new API in new threads or python repl