<s> import torndb <EOL> import redis <EOL> from tornado . options import define , options <EOL> define ( "<STR_LIT>" , default = "<STR_LIT>" , help = "<STR_LIT>" ) <EOL> define ( "<STR_LIT>" , default = "<STR_LIT>" , help = "<STR_LIT>" ) <EOL> define ( "<STR_LIT>" , default = "<STR_LIT>" , help = "<STR_LIT>" ) <EOL> define ( "<STR_LIT>" , default = "<STR_LIT>" , help = "<STR_LIT>" ) <EOL> db = torndb . Connection ( <EOL> host = options . mysql_host , database = options . mysql_database , <EOL> user = options . mysql_user , password = options . mysql_password ) <EOL> rd = redis . StrictRedis ( host = '<STR_LIT:localhost>' , port = <NUM_LIT> , db = <NUM_LIT:0> ) <EOL> for status_key in rd . keys ( "<STR_LIT>" ) : <EOL> status_id = status_key . split ( "<STR_LIT::>" ) [ - <NUM_LIT:1> ] <EOL> comments = db . query ( "<STR_LIT>" , status_id ) <EOL> rd . hset ( status_key , '<STR_LIT>' , len ( comments ) ) </s>
