code: def unwrapHandler(handler, nt):
      
      def dounwrap(code, msg, val):
          _log.debug("Handler (%s, %s, %s) -> %s", code, msg, LazyRepr(val), handler)
          try:
              if code == 0:
                  handler(RemoteError(msg))
              elif code == 1:
                  handler(Cancelled())
              else:
                  if val is not None:
                      val = nt.unwrap(val)
                  handler(val)
          except:
              _log.exception("Exception in Operation handler")
      return dounwrap
docs: Wrap get/rpc handler to unwrap Value