def determine_class(tweet, keyword):
    tweet_text = unicode(tweet['text'])
    GREEN_COLOUR = '\033[92m'
    END_COLOUR = '\033[0m'
    coloured_keyword = GREEN_COLOUR + keyword + END_COLOUR  # colour the keyword green
    #coloured_tweet_text = tweet_text.replace(keyword, coloured_keyword)

    import re
    sub = re.compile(re.escape(keyword), re.IGNORECASE)
    coloured_tweet_text = sub.sub(coloured_keyword, tweet_text)
    print("--------")
    print(tweet_text)
    print(coloured_tweet_text)
    inp = raw_input("0 for out-of-class, {}1 for in-class (i.e. this is the brand){},\n<return> to ignore (e.g. for non-English or irrelevant tweets):".format(GREEN_COLOUR, END_COLOUR))
    cls = sql_convenience.CLASS_UNKNOWN
    if inp.strip() == "0":
        print("out of class")
        cls = sql_convenience.CLASS_OUT
    if inp.strip() == "1":
        print("in class")
        cls = sql_convenience.CLASS_IN
    #print("Put into class", cls)
    return cls
Start the pixmap transition.
dataset/ETHPy150Open ianozsvald/social_media_brand_disambiguator/tweet_annotator.py/determine_class--crossover with--dataset/ETHPy150Open ContinuumIO/ashiba/enaml/enaml/qt/q_pixmap_transition.py/QPixmapTransition.start