def search_gen(self, search_query, **params):
        """Returns a generator of tweets that match a specified query.

        Documentation: https://dev.twitter.com/docs/api/1.1/get/search/tweets

        :param search_query: Query you intend to search Twitter for
        :param \*\*params: Extra parameters to send with your search request
        :rtype: generator

        Usage::

          >>> from twython import Twython
          >>> twitter = Twython(APP_KEY, APP_SECRET, OAUTH_TOKEN, OAUTH_TOKEN_SECRET)

          >>> search = twitter.search_gen('python')
          >>> for result in search:
          >>>   print result

        """
        content = self.search(q=search_query, **params)

        if not content.get('statuses'):
            raise StopIteration

        for tweet in content['statuses']:
            yield tweet

        try:
            if not 'since_id' in params:
                params['since_id'] = (int(content['statuses'][0]['id_str']) + 1)
        except (TypeError, __HOLE__):
            raise TwythonError('Unable to generate next page of search results, `page` is not a number.')

        for tweet in self.search_gen(search_query, **params):
            yield tweet
dataset/ETHPy150Open splunk/splunk-app-twitter/twitter2/bin/twython/api.py/Twython.search_gen