<s> '''<STR_LIT>''' <EOL> from __future__ import division , print_function <EOL> from tribeflow . mycollections . llist import MarkovianMemory <EOL> from numpy . testing import assert_equal <EOL> from numpy . testing import assert_array_equal <EOL> import numpy as np <EOL> def test_insert ( ) : <EOL> mm = MarkovianMemory ( <NUM_LIT:4> ) <EOL> assert_equal ( <NUM_LIT:0> , mm . _size ( <NUM_LIT:0> ) ) <EOL> assert_equal ( <NUM_LIT:0> , mm . _size ( <NUM_LIT:1> ) ) <EOL> assert_equal ( <NUM_LIT:0> , mm . _size ( <NUM_LIT:2> ) ) <EOL> assert_equal ( <NUM_LIT:0> , mm . _size ( <NUM_LIT:3> ) ) <EOL> mm . _append_last ( <NUM_LIT:0> , <NUM_LIT:1> , <NUM_LIT> ) <EOL> mm . _append_last ( <NUM_LIT:0> , <NUM_LIT:2> , <NUM_LIT> ) <EOL> mm . _append_last ( <NUM_LIT:2> , <NUM_LIT:2> , <NUM_LIT:1.0> ) <EOL> assert_equal ( <NUM_LIT:2> , mm . _size ( <NUM_LIT:0> ) ) <EOL> assert_equal ( <NUM_LIT:0> , mm . _size ( <NUM_LIT:1> ) ) <EOL> assert_equal ( <NUM_LIT:1> , mm . _size ( <NUM_LIT:2> ) ) <EOL> assert_equal ( <NUM_LIT:0> , mm . _size ( <NUM_LIT:3> ) ) <EOL> l = mm . _to_list ( <NUM_LIT:0> ) <EOL> assert_array_equal ( [ ( <NUM_LIT:1> , <NUM_LIT> ) , ( <NUM_LIT:2> , <NUM_LIT> ) ] , l ) <EOL> l = mm . _to_list ( <NUM_LIT:1> ) <EOL> assert_array_equal ( [ ] , l ) <EOL> l = mm . _to_list ( <NUM_LIT:2> ) <EOL> assert_array_equal ( [ ( <NUM_LIT:2> , <NUM_LIT:1.0> ) ] , l ) </s>
