def unregister(self, token_to_remove):
        """
        Unregister a filter function.

        :param token_to_remove: The token as returned by :meth:`register`.

        Unregister a function from the filter chain using the token returned by
        :meth:`register`.
        """
        for i, (_, token, _) in enumerate(self._filter_order):
            if token == token_to_remove:
                break
        else:
            raise ValueError("unregistered token: {!r}".format(
                token_to_remove))
        del self._filter_order[i]