<s> '''<STR_LIT>''' <EOL> import insights . plugins . database . rethink as database <EOL> import insights . plugins . mobile as mobile <EOL> import insights . plugins . hipchat as hipchat <EOL> import insights . plugins . messaging as msg <EOL> def common_middlewares ( properties , identity ) : <EOL> middlewares = [ ] <EOL> if properties . get ( '<STR_LIT>' ) : <EOL> middlewares . append ( msg . RedisProtocol ( identity ) . check ) <EOL> device = properties . get ( '<STR_LIT>' ) <EOL> if device : <EOL> middlewares . append ( mobile . AndroidPush ( device ) . notify ) <EOL> if properties . get ( '<STR_LIT>' ) : <EOL> middlewares . append ( database . RethinkdbFinance ( <EOL> table = identity , db = '<STR_LIT>' , reset = True ) <EOL> . save_portfolio ) <EOL> hipchat_room = properties . get ( '<STR_LIT>' ) <EOL> if hipchat_room : <EOL> middlewares . append ( hipchat . Bot ( <EOL> hipchat_room , name = identity ) . notify ) <EOL> return middlewares </s>
