<s> import collections <EOL> from python_toolbox import nifty_collections <EOL> from python_toolbox . cute_iter_tools import ( iterate_pop , iterate_popitem , <EOL> iterate_popleft ) <EOL> def test ( ) : <EOL> deque = collections . deque ( range ( <NUM_LIT:10> ) ) <EOL> assert tuple ( iterate_pop ( deque ) ) == tuple ( range ( <NUM_LIT:9> , - <NUM_LIT:1> , - <NUM_LIT:1> ) ) <EOL> assert not deque <EOL> deque = collections . deque ( range ( <NUM_LIT:10> ) ) <EOL> assert tuple ( iterate_popleft ( deque ) ) == tuple ( range ( <NUM_LIT:10> ) ) <EOL> assert not deque <EOL> dict_ = { <NUM_LIT:1> : <NUM_LIT:2> , <NUM_LIT:3> : <NUM_LIT:4> , <NUM_LIT:5> : <NUM_LIT:6> , } <EOL> assert dict ( iterate_popitem ( dict_ ) ) == { <NUM_LIT:1> : <NUM_LIT:2> , <NUM_LIT:3> : <NUM_LIT:4> , <NUM_LIT:5> : <NUM_LIT:6> , } <EOL> assert not dict_ <EOL> lazy_tuple = iterate_pop ( list ( range ( <NUM_LIT:5> ) ) , lazy_tuple = True ) <EOL> assert isinstance ( lazy_tuple , nifty_collections . LazyTuple ) </s>
