code: def set_pre_handler(self, handler):
          '''set pre handler'''
          with self._lock:
              if self._handler_ctx is not None:
                  return self._handler_ctx.set_pre_handler(handler)
          return RET_ERROf set_pre_handler(self, handler):
          '''set pre handler'''
          with self._lock:
              if self._handler_ctx is not None:
                  return self._handler_ctx.set_pre_handler(handler)
          return RET_ERROR
docs: set pre handler