how to implement deque in python