Module Import alias Import alias Import alias Import alias Import alias ImportFrom alias alias ClassDef bases NameLoad body Expr Str Assign NameStore Num Assign NameStore Num Assign NameStore Num Assign NameStore Num Assign NameStore Str Assign NameStore Str Assign NameStore NameLoad FunctionDef arguments args NameParam defaults vararg kwarg body Expr Call AttributeLoad Call NameLoad NameLoad NameLoad attr NameLoad NameLoad Expr Call AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body If Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr body Assign NameStore Call NameLoad AttributeLoad NameLoad attr Str Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr orelse Assign AttributeStore NameLoad attr Dict decorator_list FunctionDef arguments args NameParam defaults body Assign NameStore Call NameLoad AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam defaults body Assign NameStore Call AttributeLoad NameLoad attr If CompareGt Call NameLoad NameLoad AttributeLoad NameLoad attr body Expr Call AttributeLoad NameLoad attr BinOpMult ListLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr For NameStore Call NameLoad BinOpSub Call NameLoad NameLoad AttributeLoad NameLoad attr body Expr Yield SubscriptLoad NameLoad Slice NameLoad BinOpAdd BinOpAdd NameLoad AttributeLoad NameLoad attr Num decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam defaults Num NameLoad body Assign NameStore Call NameLoad Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Dict If CompareLt NameLoad NameLoad body Return If UnaryOpNot NameLoad body Assign NameStore Call AttributeLoad NameLoad attr Call AttributeLoad SubscriptLoad AttributeLoad NameLoad attr Index NameLoad attr Assign NameStore ListLoad For NameStore Call NameLoad AttributeLoad NameLoad attr body Assign NameStore NameLoad Assign NameStore ListLoad For NameStore Call NameLoad NameLoad body If CompareEq SubscriptLoad NameLoad Index Num AttributeLoad NameLoad attr body Break Expr Call AttributeLoad NameLoad attr SubscriptLoad NameLoad Index Num TryExcept body Assign NameStore BinOpAdd SubscriptLoad NameLoad Slice Num TupleLoad Call AttributeLoad NameLoad attr SubscriptLoad SubscriptLoad AttributeLoad NameLoad attr Index NameLoad Index NameLoad handlers ExceptHandler type NameLoad body Break If CompareGt Call NameLoad NameLoad Call NameLoad NameLoad body Assign NameStore Call NameLoad NameLoad Return Call AttributeLoad Str attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam defaults body Assign NameStore SubscriptLoad Call AttributeLoad Call AttributeLoad NameLoad attr Str Str attr Slice Num If CompareNotEq NameLoad AttributeLoad AttributeLoad NameLoad attr attr body Return Call AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam defaults body If AttributeLoad NameLoad attr body Return AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Return Call AttributeLoad NameLoad attr Str Str Call AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam defaults body Assign NameStore SubscriptLoad NameLoad Slice Num Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Dict If Call AttributeLoad NameLoad attr Str body Return TryExcept body Assign NameStore BoolOpOr Call AttributeLoad NameLoad attr NameLoad BoolOpAnd CompareNotEq NameLoad AttributeLoad AttributeLoad NameLoad attr attr CompareLt Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr handlers ExceptHandler type NameLoad body Assign NameStore NameLoad Assign NameStore ListLoad Assign NameStore NameLoad If Call AttributeLoad NameLoad attr NameLoad body Assign NameStore Call AttributeLoad NameLoad attr NameLoad For NameStore Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr NameLoad body Assign NameStore Call NameLoad SubscriptLoad NameLoad Slice Num If CompareIn NameLoad AttributeLoad NameLoad attr body Expr Call AttributeLoad SubscriptLoad SubscriptLoad AttributeLoad NameLoad attr Index NameLoad Index NameLoad attr SubscriptLoad NameLoad Index Num orelse Assign SubscriptStore SubscriptLoad AttributeLoad NameLoad attr Index NameLoad Index NameLoad ListLoad SubscriptLoad NameLoad Index Num If BoolOpAnd CompareNotIn AttributeLoad NameLoad attr NameLoad NameLoad body For NameStore AttributeLoad NameLoad attr body If CompareEq NameLoad NameLoad body Continue If CompareIn NameLoad SubscriptLoad AttributeLoad NameLoad attr Index NameLoad body Assign NameStore Call AttributeLoad NameLoad attr NameLoad keyword NameLoad If NameLoad body Expr Call AttributeLoad NameLoad attr TupleLoad NameLoad NameLoad If Call NameLoad NameLoad body Assign TupleStore AttributeStore NameLoad attr NameStore Call AttributeLoad NameLoad attr NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Assign NameStore Call NameLoad NameLoad Str Assign NameStore Call AttributeLoad NameLoad attr Str For NameStore Call AttributeLoad NameLoad attr body Assign NameStore Call AttributeLoad NameLoad attr NameLoad If NameLoad body Assign TupleStore NameStore NameStore Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr NameLoad NameLoad Str NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Assign NameStore Call NameLoad NameLoad Str For NameStore Call AttributeLoad NameLoad attr body Expr Call AttributeLoad NameLoad attr NameLoad NameLoad Str NameLoad NameLoad decorator_list FunctionDef arguments args NameParam defaults body Return TupleLoad Call AttributeLoad NameLoad attr Str AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Str AttributeLoad NameLoad attr TupleLoad Str AttributeLoad NameLoad attr decorator_list decorator_list Assign NameStore Str Assign NameStore Num Assign NameStore Str Assign NameStore Call NameLoad NameLoad NameLoad NameLoad Assign NameStore Call NameLoad NameLoad If BoolOpAnd CompareGt Call NameLoad AttributeLoad NameLoad attr Num CompareEq SubscriptLoad AttributeLoad NameLoad attr Index Num Str body If CompareEq Call NameLoad AttributeLoad NameLoad attr Num body Expr Call AttributeLoad NameLoad attr SubscriptLoad AttributeLoad NameLoad attr Index Num orelse If Call NameLoad AttributeLoad NameLoad attr body Expr Call AttributeLoad NameLoad attr SubscriptLoad AttributeLoad NameLoad attr Index Num SubscriptLoad AttributeLoad NameLoad attr Index Num orelse Expr Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Str TryExcept body Expr Call AttributeLoad NameLoad attr handlers ExceptHandler body Pass Expr Call AttributeLoad NameLoad attr
N/A N/A os N/A pickle N/A random N/A re N/A sys irc IRCBot IRCConnection MarkovBot N/A IRCBot N/A N/A 
    Hacking on a markov chain bot - based on:
    http://code.activestate.com/recipes/194364-the-markov-chain-algorithm/
    http://github.com/ericflo/yourmomdotcom
     N/A messages_to_generate 5 N/A chattiness 0.01 N/A max_words 15 N/A chain_length 2 N/A stop_word N/A filename markov.db N/A last None __init__ N/A N/A self N/A args kwargs N/A N/A N/A N/A N/A super MarkovBot self __init__ args kwargs N/A N/A N/A self load_data N/A load_data N/A N/A self N/A N/A N/A N/A N/A N/A os path exists N/A self filename N/A N/A fh N/A open N/A self filename rb N/A N/A self word_table N/A N/A pickle loads N/A N/A fh read N/A N/A N/A fh close N/A N/A N/A self word_table N/A N/A save_data N/A N/A self N/A N/A N/A fh N/A open N/A self filename w N/A N/A N/A fh write N/A N/A pickle dumps N/A self word_table N/A N/A N/A fh close N/A split_message N/A N/A self message N/A N/A N/A words N/A N/A message split N/A N/A N/A len words N/A self chain_length N/A N/A N/A N/A words extend N/A N/A N/A self stop_word N/A self chain_length N/A i N/A range N/A N/A len words N/A self chain_length N/A N/A N/A N/A words N/A i N/A N/A i N/A self chain_length 1 N/A generate_message N/A N/A self person size seed_key N/A 15 None N/A N/A person_words N/A len N/A N/A N/A self word_table get person N/A N/A N/A person_words size N/A N/A N/A N/A seed_key N/A N/A seed_key N/A N/A random choice N/A N/A N/A N/A self word_table N/A person keys N/A message N/A N/A i N/A xrange N/A self messages_to_generate N/A N/A words seed_key N/A gen_words N/A N/A i N/A xrange size N/A N/A N/A N/A words N/A 0 N/A self stop_word N/A N/A N/A N/A N/A gen_words append N/A words N/A 0 N/A N/A N/A words N/A N/A words N/A 1 N/A N/A N/A random choice N/A N/A N/A self word_table N/A person N/A words N/A N/A N/A KeyError N/A N/A N/A N/A N/A len gen_words N/A len message N/A N/A message N/A list gen_words N/A N/A N/A join message N/A imitate N/A N/A self sender message channel N/A N/A N/A person N/A N/A N/A N/A N/A message replace imitate  strip N/A 10 N/A N/A person N/A N/A self conn nick N/A N/A N/A N/A self generate_message person N/A cite N/A N/A self sender message channel N/A N/A N/A N/A self last N/A N/A N/A self last N/A sanitize_message N/A N/A self message N/A N/A N/A Convert to lower-case and strip out all quotation marks N/A N/A N/A re sub ["'] N/A N/A message lower N/A log N/A N/A self sender message channel N/A N/A N/A sender N/A sender N/A 10 N/A N/A N/A N/A self word_table setdefault sender N/A N/A N/A N/A message startswith / N/A N/A N/A N/A N/A say_something N/A N/A N/A self is_ping message N/A N/A sender N/A N/A self conn nick N/A N/A N/A random random N/A self chattiness N/A N/A N/A AttributeError N/A N/A say_something False N/A messages N/A N/A seed_key None N/A N/A N/A self is_ping message N/A N/A message N/A N/A self fix_ping message N/A words N/A N/A self split_message N/A N/A self sanitize_message message N/A N/A key N/A tuple N/A words N/A -1 N/A N/A key N/A self word_table N/A N/A N/A N/A N/A N/A N/A self word_table N/A sender N/A key append N/A words N/A -1 N/A N/A N/A N/A N/A self word_table N/A sender N/A key N/A N/A words N/A -1 N/A N/A N/A N/A self stop_word key say_something N/A N/A person N/A self word_table N/A N/A N/A person sender N/A N/A N/A N/A key N/A N/A self word_table N/A person N/A N/A generated N/A N/A self generate_message person seed_key key N/A generated N/A N/A N/A N/A messages append N/A person generated N/A N/A len messages N/A N/A N/A N/A self last message N/A N/A random choice messages N/A message N/A load_log_file N/A N/A self filename N/A N/A N/A fh N/A open filename r N/A logline_re N/A N/A re compile <\s*(\w+)>[^\]]+\]\s([^
]+)[
] N/A line N/A N/A fh readlines N/A N/A match N/A N/A logline_re search line N/A match N/A N/A N/A sender message N/A N/A match groups N/A N/A N/A self log sender message False None N/A load_text_file N/A N/A self filename sender N/A N/A N/A fh N/A open filename r N/A line N/A N/A fh readlines N/A N/A N/A N/A self log sender line False None N/A command_patterns N/A N/A self N/A N/A N/A N/A N/A N/A self ping ^imitate \S+ N/A self imitate N/A N/A self ping ^cite N/A self cite N/A .* N/A self log N/A N/A N/A host irc.freenode.net N/A port 6667 N/A nick whatyousay N/A conn N/A IRCConnection host port nick N/A markov_bot N/A MarkovBot conn N/A N/A N/A N/A len N/A sys argv 1 N/A N/A N/A sys argv N/A 1 -log N/A N/A N/A N/A len N/A sys argv 3 N/A N/A N/A N/A markov_bot load_log_file N/A N/A sys argv N/A 2 N/A N/A N/A len N/A sys argv N/A N/A N/A N/A markov_bot load_text_file N/A N/A sys argv N/A 2 N/A N/A sys argv N/A 3 N/A N/A N/A N/A conn connect N/A N/A N/A conn join #botwars N/A N/A N/A N/A N/A conn enter_event_loop N/A N/A N/A N/A N/A N/A N/A markov_bot save_data