<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def search(self, query, delegate, args=None, extra_args=None):
 """Perform a search query. Results are given one at a time to the delegate. An example delegate may look like this: def exampleDelegate(entry):
 print entry.title"""

        if args is None:
            args = {}
        args['q'] = query
        return self.__doDownloadPage(self.search_url + '?' + self._urlencode(args),
            txml.Feed(delegate, extra_args), agent=self.agent)