<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def stream_filter(self, delegate, follow=None, track=None, locations=None, stall_warnings=None):
 """ Streams public messages filtered by various parameters. https://dev.twitter.com/docs/api/1.1/post/statuses/filter At least one of ``follow``, ``track``, or ``locations`` must be provided. See the API documentation linked above for details on these parameters and the various limits on this API. :param delegate: A delegate function that will be called for each message in the stream and will be passed the message dict as the only parameter. The message dicts passed to this function may represent any message type and the delegate is responsible for any dispatch that may be required. (:mod:`txtwitter.messagetools` may be helpful here.) :param list follow: A list of user IDs, indicating the users to return statuses for in the stream. :param list track: List of keywords to track. :param list locations: List of location bounding boxes to track. XXX: Currently unsupported. :param bool stall_warnings: Specifies whether stall warnings should be delivered. :returns: An unstarted :class:`TwitterStreamService`. """

        params = {}
        if follow is not None:
            params['follow'] = ','.join(follow)
        if track is not None:
            params['track'] = ','.join(track)
        if locations is not None:
            raise NotImplementedError(
                "The `locations` parameter is not yet supported.")
        set_bool_param(params, 'stall_warnings', stall_warnings)

        svc = TwitterStreamService(
            lambda: self._post_stream('statuses/filter.json', params),
            delegate)
        return svc