def with_filter(self, filter):
res = copy.deepcopy(self)<EOL>old_filter = self._filter<EOL>def new_filter(request):<EOL><INDENT>return filter(request, old_filter)<EOL><DEDENT>res._filter = new_filter<EOL>return res<EOL>
Returns a new service which will process requests with the specified
filter. Filtering operations can include logging, automatic retrying,
etc... The filter is a lambda which receives the HTTPRequest and
another lambda. The filter can perform any pre-processing on the
request, pass it off to the next lambda, and then perform any
post-processing on the response.

:param function(request) filter: A filter function.
:return: A new service using the specified filter.
:rtype: a subclass of :class:`StorageClient`