Module Expr Str Import alias Import alias Import alias ImportFrom alias alias alias alias alias alias alias alias alias alias alias alias alias ClassDef bases AttributeLoad NameLoad attr body Expr Str FunctionDef arguments args NameParam defaults body Expr Str Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr keyword Num Assign AttributeStore NameLoad attr Str decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Call NameLoad TupleLoad Str Str AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr NameLoad Str Assign NameStore Call NameLoad TupleLoad Str Str Expr Call AttributeLoad NameLoad attr NameLoad Str decorator_list FunctionDef arguments args NameParam defaults body Expr Str Expr Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Call NameLoad Str Str AttributeLoad NameLoad attr Num Expr Call AttributeLoad NameLoad attr Call NameLoad Str Str AttributeLoad NameLoad attr Num decorator_list FunctionDef arguments args NameParam defaults body Expr Str Expr Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Call NameLoad Str AttributeLoad NameLoad attr Num Expr Call AttributeLoad NameLoad attr Call NameLoad Str AttributeLoad NameLoad attr Num decorator_list FunctionDef arguments args NameParam defaults body Expr Str Expr Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Call NameLoad Str AttributeLoad NameLoad attr Num Expr Call AttributeLoad NameLoad attr Call NameLoad Str AttributeLoad NameLoad attr Num decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore ListLoad Str Str Str Str Assign NameStore ListLoad Str Str Str Str Assign NameStore ListLoad Str Str Str Str Expr Call NameLoad NameLoad AttributeLoad NameLoad attr keyword Str Expr Call AttributeLoad NameLoad attr Call AttributeLoad AttributeLoad NameLoad attr attr Str Str Num Expr Call AttributeLoad NameLoad attr Call AttributeLoad AttributeLoad NameLoad attr attr Str Str Num Expr Call NameLoad NameLoad AttributeLoad NameLoad attr keyword Str Expr Call AttributeLoad NameLoad attr Call AttributeLoad AttributeLoad NameLoad attr attr Str Str Num Expr Call AttributeLoad NameLoad attr Call AttributeLoad AttributeLoad NameLoad attr attr Str Str Num Expr Call AttributeLoad NameLoad attr Call AttributeLoad AttributeLoad NameLoad attr attr Str Str Num Expr Call AttributeLoad NameLoad attr Call AttributeLoad AttributeLoad NameLoad attr attr Str Str Num Expr Call NameLoad NameLoad AttributeLoad NameLoad attr keyword Str Expr Call AttributeLoad NameLoad attr Call AttributeLoad AttributeLoad NameLoad attr attr Str Str Num Expr Call AttributeLoad NameLoad attr Call AttributeLoad AttributeLoad NameLoad attr attr Str Str Num decorator_list FunctionDef arguments args NameParam defaults body Expr Str Expr Call AttributeLoad NameLoad attr Assign NameStore ListLoad Str Str Str Str Assign NameStore ListLoad Str Str Str Str Assign NameStore ListLoad Str Str Str Str Expr Call AttributeLoad NameLoad attr Call NameLoad NameLoad AttributeLoad NameLoad attr keyword AttributeLoad NameLoad attr Num Expr Call AttributeLoad NameLoad attr Call NameLoad NameLoad AttributeLoad NameLoad attr keyword AttributeLoad NameLoad attr BinOpDiv Num Num Expr Call AttributeLoad NameLoad attr Call NameLoad NameLoad AttributeLoad NameLoad attr keyword AttributeLoad NameLoad attr BinOpDiv Num Num decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore ListLoad Str Str Str Str Assign TupleStore NameStore NameStore Call NameLoad NameLoad Num Num AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr NameLoad Str Expr Call AttributeLoad NameLoad attr NameLoad Str Assign TupleStore NameStore NameStore Call NameLoad NameLoad Num Num AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr NameLoad Str Expr Call AttributeLoad NameLoad attr NameLoad Str Assign TupleStore NameStore NameStore Call NameLoad NameLoad Num Num AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr NameLoad Str Expr Call AttributeLoad NameLoad attr NameLoad Str Assign TupleStore NameStore NameStore Call NameLoad NameLoad Num Num AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr NameLoad Str Expr Call AttributeLoad NameLoad attr NameLoad AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Expr Str Expr Call AttributeLoad NameLoad attr Assign NameStore Call NameLoad AttributeLoad NameLoad attr keyword AttributeLoad NameLoad attr keyword Num Assert CompareGtE Call NameLoad NameLoad Num Assert CompareLtE Call NameLoad NameLoad Num Assign NameStore Call NameLoad AttributeLoad NameLoad attr keyword ListLoad Str Str keyword AttributeLoad NameLoad attr keyword Num Assert CompareEq SubscriptLoad NameLoad Index Num Str Assert CompareNotIn Str NameLoad Assign NameStore Call NameLoad AttributeLoad NameLoad attr keyword ListLoad Str keyword AttributeLoad NameLoad attr Assert CompareIn Str NameLoad Assign NameStore Call NameLoad AttributeLoad NameLoad attr keyword ListLoad Str keyword AttributeLoad NameLoad attr Assert CompareIn Str NameLoad Assign NameStore Call NameLoad AttributeLoad NameLoad attr keyword ListLoad Str keyword AttributeLoad NameLoad attr Assert CompareEq Call NameLoad NameLoad Num decorator_list FunctionDef arguments args NameParam defaults body Expr Str Expr Call AttributeLoad NameLoad attr Assign TupleStore NameStore NameStore Call NameLoad AttributeLoad NameLoad attr keyword ListLoad Str keyword AttributeLoad NameLoad attr Assert CompareIn Str NameLoad Assign TupleStore NameStore NameStore Call NameLoad AttributeLoad NameLoad attr keyword ListLoad Str keyword AttributeLoad NameLoad attr Assert CompareEq NameLoad ListLoad Assert CompareIs NameLoad NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Expr Call AttributeLoad NameLoad attr Assign TupleStore NameStore NameStore Call NameLoad AttributeLoad NameLoad attr keyword AttributeLoad NameLoad attr Assert CompareEq Call NameLoad NameLoad Num Assert CompareNotIn AttributeLoad NameLoad attr NameLoad Assert CompareIn AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Expr Call AttributeLoad NameLoad attr Assign TupleStore NameStore NameStore Call NameLoad AttributeLoad NameLoad attr keyword AttributeLoad NameLoad attr If CompareNotIn NameLoad NameLoad body Assert CompareIsNot Call NameLoad AttributeLoad NameLoad attr NameLoad NameLoad orelse Assert CompareIs Call NameLoad AttributeLoad NameLoad attr NameLoad NameLoad Assign NameStore Str Assert CompareIn Call NameLoad AttributeLoad NameLoad attr NameLoad ListLoad Str Str Assert CompareEq Call NameLoad AttributeLoad NameLoad attr NameLoad keyword ListLoad Str Str Assert CompareIs Call NameLoad AttributeLoad NameLoad attr NameLoad keyword ListLoad Str Str NameLoad Assert CompareEq Call NameLoad AttributeLoad NameLoad attr NameLoad keyword ListLoad Str Str decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr BinOpAdd AttributeLoad NameLoad attr Str For NameStore NameLoad body Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad decorator_list decorator_list ClassDef bases AttributeLoad NameLoad attr body Expr Str FunctionDef arguments args NameParam defaults body Assign AttributeStore NameLoad attr Call NameLoad keyword Str keyword Num decorator_list FunctionDef arguments args NameParam defaults body Assign NameStore ListLoad Str Str Str Str Assign NameStore ListLoad Str Str Str Str Assign NameStore ListLoad Str Str Str Str Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Expr Call AttributeLoad NameLoad attr Call AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr Str Str Num Expr Call AttributeLoad NameLoad attr Call AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr Str Str Num decorator_list FunctionDef arguments args NameParam defaults body Expr Call AttributeLoad NameLoad attr Assign NameStore ListLoad Str Str Str Str Expr Call AttributeLoad NameLoad attr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Num decorator_list FunctionDef arguments args NameParam defaults body Expr Call AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr keyword Num Assert CompareGtE Call NameLoad NameLoad Num Assert CompareLtE Call NameLoad NameLoad Num Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr keyword ListLoad Str Str keyword Num Assert CompareIn Str NameLoad Assert CompareNotIn Str NameLoad decorator_list FunctionDef arguments args NameParam defaults body Assign NameStore Call NameLoad keyword Str keyword Num Assign NameStore Call NameLoad keyword Str keyword Num Assign NameStore ListLoad Str Str Str Str Assign NameStore ListLoad Str Str Str Str Assign NameStore ListLoad Str Str Str Str Expr Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr NameLoad Assign NameStore ListLoad Str Str Str Str Expr Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr keyword Num Assert CompareEq Call NameLoad Call AttributeLoad NameLoad attr Str Num Assert CompareEq Call NameLoad Call AttributeLoad NameLoad attr Str Num Expr Call AttributeLoad NameLoad attr keyword Str Assert CompareEq Call NameLoad Call AttributeLoad NameLoad attr Str Num Assert CompareEq Call NameLoad Call AttributeLoad NameLoad attr Str Num Expr Call AttributeLoad NameLoad attr keyword Str Assert CompareEq Call NameLoad Call AttributeLoad NameLoad attr Str Num Assert CompareEq Call NameLoad Call AttributeLoad NameLoad attr Str Num decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Call AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr BinOpAdd AttributeLoad AttributeLoad NameLoad attr attr Str For NameStore NameLoad body Expr Call AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr NameLoad decorator_list decorator_list
N/A N/A 
Tests for the markov package
 N/A redis N/A unittest N/A markov markov Markov add_line_to_index make_key max_for_key min_for_key score_for_completion score_for_line get_key_and_completion generate get_relevant_key_and_seed get_random_key_and_seed get_completion STOP TestMarkovFunctions N/A N/A unittest TestCase N/A N/A 
    Test our markov chain construction and phrase scoring functions
     setUp N/A N/A self N/A N/A N/A 
        Create a redis client and define a prefix space for this test
         N/A N/A self client N/A N/A redis Redis db 11 N/A N/A self prefix test N/A test_make_key N/A N/A self N/A N/A N/A 
        Test that the make_key function behaves as expected
         N/A key N/A make_key N/A foo bar N/A self prefix N/A N/A N/A self assertEqual key test:foo:bar N/A key N/A make_key N/A foo bar N/A N/A N/A self assertEqual key foo:bar N/A test_score_for_completion N/A N/A self N/A N/A N/A 
        Test that score_for_completion scores completions according to our model
         N/A N/A N/A self test_add_line_to_index N/A N/A N/A self assertEqual N/A score_for_completion test:i:ate a N/A self client 100 N/A N/A N/A self assertEqual N/A score_for_completion test:i:ate one N/A self client 50 N/A test_max_for_key N/A N/A self N/A N/A N/A 
        Test that max_for_key correctly finds the frequency of the most common completion
         N/A N/A N/A self test_add_line_to_index N/A N/A N/A self assertEqual N/A max_for_key test:i:ate N/A self client 2 N/A N/A N/A self assertEqual N/A max_for_key test:stupidkey N/A self client 0 N/A test_min_for_key N/A N/A self N/A N/A N/A 
        Test that min_for_key correctly finds the frequency of the least common completion
         N/A N/A N/A self test_add_line_to_index N/A N/A N/A self assertEqual N/A min_for_key test:i:ate N/A self client 1 N/A N/A N/A self assertEqual N/A min_for_key test:stupidkey N/A self client 0 N/A test_add_line_to_index N/A N/A self N/A N/A N/A 
        Test that adding lines behaves as expected
         N/A line N/A i ate a peach N/A line1 N/A i ate one peach N/A line2 N/A i ate a sandwich N/A N/A add_line_to_index line N/A self client prefix test N/A N/A N/A self assertEqual N/A N/A N/A self client zscore test:i:ate a 1.0 N/A N/A N/A self assertEqual N/A N/A N/A self client zscore test:ate:a peach 1.0 N/A N/A add_line_to_index line1 N/A self client prefix test N/A N/A N/A self assertEqual N/A N/A N/A self client zscore test:i:ate a 1.0 N/A N/A N/A self assertEqual N/A N/A N/A self client zscore test:ate:a peach 1.0 N/A N/A N/A self assertEqual N/A N/A N/A self client zscore test:ate:one peach 1.0 N/A N/A N/A self assertEqual N/A N/A N/A self client zscore test:i:ate one 1.0 N/A N/A add_line_to_index line2 N/A self client prefix test N/A N/A N/A self assertEqual N/A N/A N/A self client zscore test:i:ate a 2 N/A N/A N/A self assertEqual N/A N/A N/A self client zscore test:ate:a sandwich 1.0 N/A test_score_for_line N/A N/A self N/A N/A N/A 
        Ensure that score_for_line rates lines according to our model
         N/A N/A N/A self test_add_line_to_index N/A line N/A i ate a peach N/A line2 N/A i ate a pizza N/A line3 N/A i ate one sandwich N/A N/A N/A self assertEqual N/A score_for_line line N/A self client prefix N/A self prefix 100 N/A N/A N/A self assertEqual N/A score_for_line line2 N/A self client prefix N/A self prefix N/A 100.0 3 N/A N/A N/A self assertEqual N/A score_for_line line3 N/A self client prefix N/A self prefix N/A 50.0 3 N/A test_get_key_and_completion N/A N/A self N/A N/A N/A 
        Ensure that get_key_and_completion finds the expected keys and completions based
        on key_length and completion_length
         N/A line N/A i ate a peach N/A N/A key completion N/A get_key_and_completion line 2 1 N/A self prefix N/A N/A N/A self assertEqual key test:i:ate N/A N/A N/A self assertEqual completion a N/A N/A key completion N/A get_key_and_completion line 2 2 N/A self prefix N/A N/A N/A self assertEqual key test:i:ate N/A N/A N/A self assertEqual completion a:peach N/A N/A key completion N/A get_key_and_completion line 3 2 N/A self prefix N/A N/A N/A self assertEqual key test:i:ate:a N/A N/A N/A self assertEqual completion peach N/A N/A key completion N/A get_key_and_completion line 4 1 N/A self prefix N/A N/A N/A self assertEqual key test:i:ate:a:peach N/A N/A N/A self assertEqual completion N/A markov STOP N/A test_generate N/A N/A self N/A N/A N/A 
        Test the generate function
         N/A N/A N/A self test_add_line_to_index N/A generated N/A generate N/A self client prefix N/A self prefix max_words 3 N/A N/A N/A len generated 2 N/A N/A N/A len generated 3 N/A generated N/A generate N/A self client seed N/A ate one prefix N/A self prefix max_words 3 N/A N/A N/A generated N/A 2 peach N/A N/A sandwich generated N/A generated N/A generate N/A self client relevant_terms N/A peach prefix N/A self prefix N/A N/A peach generated N/A generated N/A generate N/A self client relevant_terms N/A sandwich prefix N/A self prefix N/A N/A sandwich generated N/A generated N/A generate N/A self client relevant_terms N/A pizza prefix N/A self prefix N/A N/A N/A len generated 0 N/A test_get_relevant_key_and_seed N/A N/A self N/A N/A N/A 
        Test that get_relevant_key_and_seed functions as expected
         N/A N/A N/A self test_add_line_to_index N/A N/A key seed N/A get_relevant_key_and_seed N/A self client relevant_terms N/A sandwich prefix N/A self prefix N/A N/A sandwich seed N/A N/A key seed N/A get_relevant_key_and_seed N/A self client relevant_terms N/A pizza prefix N/A self prefix N/A N/A seed N/A N/A N/A key None N/A test_get_random_key_and_seed N/A N/A self N/A N/A N/A 
        Test that get_random_key_and_seed functions as expected
         N/A N/A N/A self test_add_line_to_index N/A N/A key seed N/A get_random_key_and_seed N/A self client prefix N/A self prefix N/A N/A N/A len seed 2 N/A N/A N/A self prefix seed N/A N/A N/A self prefix key N/A test_get_completion N/A N/A self N/A N/A N/A 
        Test the get_completion method
         N/A N/A N/A self test_add_line_to_index N/A N/A key seed N/A get_random_key_and_seed N/A self client prefix N/A self prefix N/A N/A STOP seed N/A N/A N/A N/A get_completion N/A self client key None N/A N/A N/A N/A get_completion N/A self client key None N/A key test:i:ate N/A N/A N/A get_completion N/A self client key N/A a one N/A N/A N/A get_completion N/A self client key exclude N/A a one N/A N/A N/A get_completion N/A self client key exclude N/A a one None N/A N/A N/A get_completion N/A self client key relevant_terms N/A one one N/A tearDown N/A N/A self N/A N/A N/A 
        clean up our redis keys
         N/A keys N/A N/A N/A self client keys N/A N/A self prefix * N/A key keys N/A N/A N/A N/A N/A self client delete key N/A N/A TestMarkovClass N/A N/A unittest TestCase N/A N/A 
    Test that the Markov wrapper class behaves as expected
     setUp N/A N/A self N/A N/A N/A N/A self markov N/A Markov prefix testclass db 11 N/A test_add_line_to_index N/A N/A self N/A N/A N/A line N/A i ate a peach N/A line1 N/A i ate one peach N/A line2 N/A i ate a sandwich N/A N/A N/A N/A self markov add_line_to_index line N/A N/A N/A N/A self markov add_line_to_index line1 N/A N/A N/A N/A self markov add_line_to_index line2 N/A N/A N/A self assertEqual N/A N/A N/A N/A self markov client zscore testclass:i:ate a 2.0 N/A N/A N/A self assertEqual N/A N/A N/A N/A self markov client zscore testclass:ate:a peach 1.0 N/A test_score_for_line N/A N/A self N/A N/A N/A N/A N/A self test_add_line_to_index N/A line N/A i ate a peach N/A N/A N/A self assertEqual N/A N/A N/A self markov score_for_line line 100 N/A test_generate N/A N/A self N/A N/A N/A N/A N/A self test_add_line_to_index N/A generated N/A N/A N/A self markov generate max_words 3 N/A N/A N/A len generated 2 N/A N/A N/A len generated 3 N/A generated N/A N/A N/A self markov generate seed N/A ate one max_words 3 N/A N/A peach generated N/A N/A sandwich generated N/A test_flush N/A N/A self N/A N/A N/A m1 N/A Markov prefix one db 5 N/A m2 N/A Markov prefix two db 5 N/A line N/A i ate a peach N/A line1 N/A i ate one peach N/A line2 N/A i ate a sandwich N/A N/A N/A m1 add_line_to_index line N/A N/A N/A m1 add_line_to_index line1 N/A N/A N/A m1 add_line_to_index line2 N/A important_line N/A we all have phones N/A N/A N/A m2 add_line_to_index important_line N/A r N/A N/A redis Redis db 5 N/A N/A N/A len N/A N/A r keys one:* 6 N/A N/A N/A len N/A N/A r keys two:* 3 N/A N/A N/A m1 flush prefix one N/A N/A N/A len N/A N/A r keys one:* 0 N/A N/A N/A len N/A N/A r keys two:* 3 N/A N/A N/A m2 flush prefix two N/A N/A N/A len N/A N/A r keys one:* 0 N/A N/A N/A len N/A N/A r keys two:* 0 N/A tearDown N/A N/A self N/A N/A N/A 
        clean up our redis keys
         N/A keys N/A N/A N/A N/A self markov client keys N/A N/A N/A self markov prefix * N/A key keys N/A N/A N/A N/A N/A N/A self markov client delete key N/A N/A