class StreamListener(tweepy.StreamListener):

    def __init__(self, keyword, api=None):
        super(StreamListener, self).__init__(api)
self.keyword = keyword

def on_status(self, tweet):
    print('Ran on_status')

def on_error(self, status_code):
    print('Error: ' + repr(status_code))
filtering of tweets received from statuses/filter (streaming API)