def get_handlers(self, kind=None):
        """
        Retrieves the handlers of the given kind. If kind is None, all handlers
        are returned.

        :param kind: The kind of the handlers to return
        :return: A list of handlers, or an empty list
        """
        with self._lock:
            if kind is not None:
                try:
                    return self._handlers[kind][:]
                except KeyError:
                    return []

            return self.__all_handlers.copy()
Retrieves the handlers of the given kind. If kind is None, all handlers
        are returned.

        :param kind: The kind of the handlers to return
        :return: A list of handlers, or an empty list