ó
ŠwÛjc           @   s”  d  d l  m Z d  d l Z d  d l m Z m Z d  d l Z d  d l Z d  d l Z d  d l	 Z
 d  d l Z d  d l Z d Z d „  Z d f  d „  ƒ  YZ d f  d	 „  ƒ  YZ d
 e j f d „  ƒ  YZ d e j f d „  ƒ  YZ d e f d „  ƒ  YZ d e f d „  ƒ  YZ d e j f d „  ƒ  YZ d e f d „  ƒ  YZ d e j f d „  ƒ  YZ d Z i e d 6Z e d „ Z e d k r�e d e ƒ n  d S(   iÿÿÿÿ(   t   dequeN(   t   test_supportt	   seq_testsi † c           c   s   t  ‚ d Vd  S(   Ni   (   t   SyntaxError(    (    (    s…   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_deque.pyt   fail   s    t   BadCmpc           B   s   e  Z d  „  Z RS(   c         C   s
   t  ‚ d  S(   N(   t   RuntimeError(   t   selft   other(    (    s…   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_deque.pyt   __eq__   s    (   t   __name__t
   __module__R	   (    (    (    s…   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_deque.pyR      s   t	   MutateCmpc           B   s   e  Z d  „  Z d „  Z RS(   c         C   s   | |  _  | |  _ d  S(   N(   R    t   result(   R   R    R   (    (    s…   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_deque.pyt   __init__   s    	c         C   s   |  j  j ƒ  |  j S(   N(   R    t   clearR   (   R   R   (    (    s…   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_deque.pyR	      s    (   R
   R   R   R	   (    (    (    s…   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_deque.pyR      s   	t	   TestBasicc           B   s^  e  Z d  „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z	 d „  Z
 d	 „  Z d
 „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z  d „  Z! d  „  Z" d! „  Z# d" „  Z$ e% j& Z& e% j' d# „  ƒ Z( RS($   c         C   sy  t  t d d ƒ ƒ } | j t d ƒ ƒ x$ t d d ƒ D] } | j | ƒ q8 Wx* t t d d ƒ ƒ D] } | j | ƒ qe W|  j t | ƒ t d d ƒ ƒ |  j t	 | ƒ d ƒ g  t d ƒ D] } | j
 ƒ  ^ q¾ } |  j | t d d	 ƒ ƒ |  j t | ƒ t d	 d ƒ ƒ g  t d ƒ D] } | j ƒ  ^ q} | j ƒ  |  j | t d
 d ƒ ƒ |  j t | ƒ t d	 d
 ƒ ƒ d  S(   NiûëÿÿixìÿÿiÈ   i�  i8ÿÿÿi    iX  iú   i2   i–   (   R    t   xrangeR   t   appendt   reversedt
   appendleftt   assertEqualt   listt   ranget   lent   popleftt   popt   reverse(   R   t   dt   it   leftt   right(    (    s…   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_deque.pyt   test_basics   s    %%
c         C   sÉ  |  j  t t d d ƒ |  j  t t d d ƒ t t d ƒ ƒ } t | d d ƒ} |  j t | ƒ g  ƒ |  j t | ƒ d ƒ |  j t | ƒ t d d ƒ ƒ |  j | t t d ƒ d ƒ ƒ | j d ƒ |  j t | ƒ t d	 d
 ƒ ƒ | j	 d ƒ |  j t | ƒ t d d ƒ ƒ | j
 d d
 g ƒ |  j t | ƒ t d d ƒ ƒ | j d	 d g ƒ |  j t | ƒ t d d ƒ ƒ t t d ƒ d d ƒ} | j | ƒ t j t j ƒ t t j d ƒ } zF | | I| j ƒ  t t j d ƒ } |  j | j ƒ  t | ƒ ƒ Wd  | j ƒ  t j t j ƒ Xt t d ƒ d d  ƒ} |  j t | ƒ d ƒ t t j d ƒ } zF | | I| j ƒ  t t j d ƒ } |  j | j ƒ  t | ƒ ƒ Wd  | j ƒ  t j t j ƒ Xd  S(   Nt   abciÿÿÿÿiþÿÿÿi
   t   maxleni   s   deque([7, 8, 9], maxlen=3)i   i   i   i	   i   iÈ   t   wbt   rbs%   deque([0, 1, 2, 3, 4, 5, 6, 7, 8, 9])(   t   assertRaisest
   ValueErrorR    t   iterR   R   R   t   reprR   R   t   extendt
   extendleftR   R   t   unlinkt   TESTFNt   opent   closet   readt   None(   R   t   itR   t   fo(    (    s…   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_deque.pyt   test_maxlen2   sJ    

 


 
c         C   sÄ   t  t d ƒ ƒ } t | d d ƒ|  j t | ƒ g  ƒ t  t d ƒ ƒ } t d d ƒ } | j | ƒ |  j t | ƒ g  ƒ t  t d ƒ ƒ } t d d ƒ } | j | ƒ |  j t | ƒ g  ƒ d  S(   Nid   R"   i    (   R'   R   R    R   R   R)   R*   (   R   R1   R   (    (    s…   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_deque.pyt   test_maxlen_zero\   s    c         C   s»   |  j  t ƒ  j d  ƒ |  j  t d ƒ j d  ƒ |  j  t d d d ƒj d ƒ |  j  t d d d ƒj d ƒ |  j  t d d d ƒj d ƒ |  j t ƒ � t d ƒ } d | _ Wd  QXd  S(   NR!   R"   i   i   i    i
   (   R   R    R"   R0   R%   t   AttributeError(   R   R   (    (    s…   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_deque.pyt   test_maxlen_attributek   s    c         C   sð  xv d d d d d f D]] } t  | ƒ } t | ƒ } x< d D]4 } |  j | j | ƒ | j | ƒ | | | f ƒ q= Wq W|  j t | j ƒ |  j t | j d d ƒ d	 d d
 „  ƒ  Y} t d d | ƒ  d g ƒ } |  j t | j d ƒ t d d d g ƒ } |  j t | j | ƒ  ƒ d d d „  ƒ  Y} | ƒ  } t d d d | d d g ƒ } | | _ |  j t | j d ƒ t d  g d ƒ } x' t
 t | ƒ ƒ D] } | j d ƒ q–W| j d ƒ |  j | j d ƒ d ƒ |  j | j d  ƒ d ƒ d  S(   Nt    t   abracadabrat
   simsalabimiô  R!   t   abcdefghijklmnopqrstuvwxyzi   i   t
   BadComparec           B   s   e  Z d  „  Z RS(   c         S   s
   t  ‚ d  S(   N(   t   ArithmeticError(   R   R   (    (    s…   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_deque.pyR	   ~   s    (   R
   R   R	   (    (    (    s…   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_deque.pyR;   }   s   i   t   MutatingComparec           B   s   e  Z d  „  Z RS(   c         S   s   |  j  j ƒ  t S(   N(   R   R   t   True(   R   R   (    (    s…   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_deque.pyR	   …   s    (   R
   R   R	   (    (    (    s…   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_deque.pyR=   „   s   i   i   i   iÿÿÿÿi    (    (    (   R   R    R   t   countR%   t	   TypeErrorR<   R   R   R0   R   R   t   rotate(   R   t   sR   t   letterR;   R=   t   mR   (    (    s…   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_deque.pyt
   test_countu   s.    6		c         C   s^  t  d ƒ } | j ƒ  x³ | t  d ƒ t  d ƒ t  ƒ  t | ƒ g D]‡ } |  j | | k t | ƒ t | ƒ k oƒ t | ƒ t | ƒ k ƒ |  j | | k t | ƒ t | ƒ k oÃ t | ƒ t | ƒ k ƒ qA Wt t  d
 ƒ } x|| D]t} xk| D]c} |  j | | k t | ƒ t | ƒ k | | f ƒ |  j | | k t | ƒ t | ƒ k | | f ƒ |  j | | k  t | ƒ t | ƒ k  | | f ƒ |  j | | k t | ƒ t | ƒ k | | f ƒ |  j | | k t | ƒ t | ƒ k | | f ƒ |  j | | k t | ƒ t | ƒ k | | f ƒ |  j t | | ƒ t t | ƒ t | ƒ ƒ | | f ƒ qï Wqâ Wd  S(   Nt   xabcR!   t   abR7   t   at   bt   bat   xbat   cba(	   R7   RH   RI   RG   RJ   R!   RK   RF   RL   (   R    R   R   R   t   typet   mapt   cmp(   R   R   t   et   argst   xt   y(    (    s…   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_deque.pyt   test_comparisons–   s     
1@E111111c         C   sx   t  d ƒ } |  j t | j d ƒ | j d ƒ |  j t | ƒ t d ƒ ƒ | j | ƒ |  j t | ƒ t d ƒ ƒ d  S(   NRH   i   t   bcdt   abcdt   abcdabcd(   R    R%   R@   R)   R   R   (   R   R   (    (    s…   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_deque.pyt   test_extend§   s    c         C   s\   t  d ƒ } | d 7} |  j t | ƒ t d ƒ ƒ | | 7} |  j t | ƒ t d ƒ ƒ d  S(   NRH   RU   RV   RW   (   R    R   R   (   R   R   (    (    s…   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_deque.pyt	   test_iadd¯   s
    

c         C   sÛ   t  d ƒ } |  j t | j d ƒ | j d ƒ |  j t | ƒ t t d ƒ ƒ ƒ | j | ƒ |  j t | ƒ t d ƒ ƒ t  ƒ  } | j t d ƒ ƒ |  j t | ƒ t t t d ƒ ƒ ƒ ƒ |  j t | j t	 ƒ  ƒ d  S(   NRH   i   RU   RV   t   abcddcbaiè  (
   R    R%   R@   R*   R   R   R   R   R   R   (   R   R   (    (    s…   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_deque.pyt   test_extendleft¶   s    "	(c         C   s2  d } t  t | ƒ ƒ } t | ƒ } xž t | ƒ D]� } | j ƒ  | j d ƒ t j ƒ  d k  r} | j | ƒ | j | ƒ n  xA t d t | ƒ t | ƒ ƒ D]  } | | | | k s� t ‚ q� Wq1 Wt  d ƒ } |  j	 | d d ƒ |  j	 | d d ƒ t  ƒ  } |  j
 t | j d ƒ |  j
 t | j d ƒ d  S(	   NiÈ   i    g      à?i   t   supermanRB   iÿÿÿÿt   n(   R    R   R   R   R   t   randomR   R   t   AssertionErrorR   R%   t
   IndexErrort   __getitem__(   R   R]   R   t   lR   t   j(    (    s…   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_deque.pyt   test_getitemÂ   s"    
&"	c         C   sÓ   d } t  t | ƒ ƒ } x" t | ƒ D] } d | | | <q% W|  j t | ƒ g  t | ƒ D] } d | ^ qY ƒ t | ƒ } x: t d | d d ƒ D]" } d | | | <d | | | <q“ W|  j t | ƒ | ƒ d  S(   NiÈ   i
   i   i    iÿÿÿÿi   (   R    R   R   R   (   R   R]   R   R   Rb   (    (    s…   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_deque.pyt   test_setitemÖ   s    3c         C   sä   d } t  t | ƒ ƒ } |  j t | j | d ƒ |  j t | j | ƒ x~ t | ƒ D]p } |  j t | ƒ | | ƒ t j t | ƒ t | ƒ ƒ } | | } |  j	 | | ƒ | | =|  j
 | | ƒ qV W|  j t | ƒ d ƒ d  S(   Niô  i   i    (   R    R   R%   R`   t   __delitem__R   R   R^   t	   randranget   assertInt   assertNotIn(   R   R]   R   R   Rc   t   val(    (    s…   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_deque.pyt   test_delitemâ   s    
c         C   sÒ   d } g  t  | ƒ D] } t j ƒ  ^ q } xŠ t  | ƒ D]| } t | |  ƒ } | j ƒ  } |  j t | ƒ t t | |  ƒ ƒ ƒ |  j | d  ƒ | j ƒ  |  j t | ƒ | |  ƒ q8 W|  j	 t
 | j d ƒ d  S(   Niô  i   (   R   R^   R    R   R   R   R   t   assertIsR0   R%   R@   (   R   R]   R   t   dataR   t   r(    (    s…   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_deque.pyt   test_reverseð   s    %&
c         C   sû  t  d ƒ } t | ƒ } t | ƒ } | j d ƒ |  j d j | ƒ d ƒ t | ƒ } | j d ƒ |  j d j | ƒ d ƒ | j ƒ  |  j t  | ƒ | ƒ xÈ t | d ƒ D]¶ } t | ƒ } t | ƒ } | j | ƒ x! t | ƒ D] } | j d ƒ qå W|  j t  | ƒ t  | ƒ ƒ | j | ƒ |  j t  | ƒ | ƒ | j | | ƒ |  j t  | ƒ | ƒ q­ WxÈ t | d ƒ D]¶ } t | ƒ } t | ƒ } | j | ƒ x! t | ƒ D] } | j d ƒ q±W|  j t  | ƒ t  | ƒ ƒ | j | ƒ |  j t  | ƒ | ƒ | j | | ƒ |  j t  | ƒ | ƒ qxWt | ƒ } t | ƒ } | j t d ƒ | j } x t t d ƒ D] } | ƒ  quW|  j t  | ƒ t  | ƒ ƒ |  j t	 | j d	 ƒ |  j t	 | j d d
 ƒ t ƒ  } | j ƒ  |  j | t ƒ  ƒ d  S(   Nt   abcdei   R7   t   eabcdiÿÿÿÿt   bcdeai   i   RR   i
   (
   t   tupleR   R    RA   R   t   joinR   t   BIGR%   R@   (   R   RB   R]   R   R   RP   Rc   t   dr(    (    s…   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_deque.pyt   test_rotateü   sX    
		
c         C   sõ   t  d ƒ } |  j t | ƒ d ƒ | j ƒ  |  j t | ƒ d ƒ | j ƒ  |  j t | ƒ d ƒ |  j t | j ƒ |  j t | ƒ d ƒ | j d ƒ |  j t | ƒ d ƒ | j d ƒ |  j t | ƒ d ƒ | j	 ƒ  |  j t | ƒ d ƒ d  S(   NRG   i   i   i    t   cR   (
   R    R   R   R   R   R%   R`   R   R   R   (   R   R   (    (    s…   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_deque.pyt   test_len1  s    


c         C   s3   t  ƒ  } |  j t | j ƒ |  j t | j ƒ d  S(   N(   R    R%   R`   R   R   (   R   R   (    (    s…   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_deque.pyt   test_underflowA  s    	c         C   s‚   t  t d ƒ ƒ } |  j t | ƒ d ƒ | j ƒ  |  j t | ƒ d ƒ |  j t | ƒ g  ƒ | j ƒ  |  j t | ƒ g  ƒ d  S(   Nid   i    (   R    R   R   R   R   R   (   R   R   (    (    s…   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_deque.pyt
   test_clearF  s    

c         C   s]  t  d ƒ } | j d ƒ |  j | t  d ƒ ƒ | j d ƒ |  j | t  d ƒ ƒ |  j t | j d ƒ |  j | t  d ƒ ƒ t  d d t ƒ  d g ƒ } t  | ƒ } |  j t | j d ƒ x0 t | | ƒ D] \ } } |  j | | k ƒ qË Wxh t	 t
 f D]Z } t  d g ƒ } | j t | | ƒ d g ƒ |  j t | j d ƒ |  j | t  ƒ  ƒ qû Wd  S(   Nt   abcdefghcijRx   t
   abdefghcijt	   abdefghijRH   RI   RG   (   R    t   removeR   R%   R&   R   R   t   zipt
   assertTrueR>   t   FalseR)   R   R`   (   R   R   RP   RR   RS   t   match(    (    s…   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_deque.pyt   test_removeO  s"    c         C   sg   t  t d ƒ ƒ } t t | ƒ ƒ } |  j t | ƒ t | ƒ ƒ | j | ƒ |  j d t | ƒ ƒ d  S(   NiÈ   s   ...(   R    R   t   evalR(   R   R   R   Rh   (   R   R   RP   (    (    s…   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_deque.pyt	   test_reprg  s
    c         C   s©   t  t d ƒ ƒ } | j | ƒ t j t j ƒ t t j d ƒ } zF | | I| j ƒ  t t j d ƒ } |  j | j	 ƒ  t
 | ƒ ƒ Wd  | j ƒ  t j t j ƒ Xd  S(   NiÈ   R#   R$   (   R    R   R   R   R+   R,   R-   R.   R   R/   R(   (   R   R   R2   (    (    s…   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_deque.pyt
   test_printn  s    

 
c         C   s0   |  j  t t d d d ƒ |  j  t t d ƒ d  S(   NR!   i   i   i   (   R%   R@   R    (   R   (    (    s…   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_deque.pyt	   test_init|  s    c         C   s   |  j  t t t d ƒ ƒ d  S(   NR!   (   R%   R@   t   hashR    (   R   (    (    s…   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_deque.pyt	   test_hash€  s    c         C   s±   xª d D]¢ } t  t | ƒ ƒ } | j | j } } xQ t | t ƒ D]@ } | | ƒ | ƒ  } | | | k rB |  j | | | ƒ qB qB W|  j t | ƒ t t | t ƒ ƒ q Wd  S(   Ni    i   i   id   iè  (   i    i   i   id   iè  (   R    R   R   R   Ru   R   R   R   (   R   t   sizeR   R   R   R   RR   (    (    s…   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_deque.pyt#   test_long_steadystate_queue_popleftƒ  s    
	c         C   sÃ   x¼ d D]´ } t  t t | ƒ ƒ ƒ } | j | j } } xQ t | t ƒ D]@ } | | ƒ | ƒ  } | | | k rH |  j | | | ƒ qH qH W|  j t t t | ƒ ƒ ƒ t t | t ƒ ƒ q Wd  S(   Ni    i   i   id   iè  (   i    i   i   id   iè  (	   R    R   R   R   R   Ru   R   R   R   (   R   R‹   R   R   R   R   RR   (    (    s…   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_deque.pyt$   test_long_steadystate_queue_poprightŽ  s    
	c         C   s€   t  ƒ  } | j | j } } x t t ƒ D] } | | ƒ q) Wx< t t ƒ D]. } | ƒ  } | | k rJ |  j | | ƒ qJ qJ Wd  S(   N(   R    R   R   R   Ru   R   (   R   R   R   R   R   RR   (    (    s…   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_deque.pyt   test_big_queue_popleft™  s    		c         C   s€   t  ƒ  } | j | j } } x t t ƒ D] } | | ƒ q) Wx< t t ƒ D]. } | ƒ  } | | k rJ |  j | | ƒ qJ qJ Wd  S(   N(   R    R   R   R   Ru   R   (   R   R   R   R   R   RR   (    (    s…   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_deque.pyt   test_big_queue_popright¤  s    		c         C   sœ   t  ƒ  } | j | j } } x t t ƒ D] } | | ƒ q) WxB t t t ƒ ƒ D]. } | ƒ  } | | k rP |  j | | ƒ qP qP W|  j t | ƒ d ƒ d  S(   Ni    (   R    R   R   R   Ru   R   R   R   (   R   R   R   R   R   RR   (    (    s…   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_deque.pyt   test_big_stack_right®  s    		c         C   sœ   t  ƒ  } | j | j } } x t t ƒ D] } | | ƒ q) WxB t t t ƒ ƒ D]. } | ƒ  } | | k rP |  j | | ƒ qP qP W|  j t | ƒ d ƒ d  S(   Ni    (   R    R   R   R   Ru   R   R   R   (   R   R   R   R   R   RR   (    (    s…   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_deque.pyt   test_big_stack_left¹  s    		c         C   sZ   t  t d ƒ ƒ } t  | ƒ } |  j t | ƒ t | ƒ ƒ |  j t | ƒ t | ƒ ƒ d  S(   NiÈ   (   R    R   t   assertNotEqualt   idR   R   (   R   R   RP   (    (    s…   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_deque.pyt   test_roundtrip_iter_initÄ  s    c         C   s�   t  t d ƒ ƒ } xt t t j d ƒ D]_ } t j | | ƒ } t j | ƒ } |  j t | ƒ t | ƒ ƒ |  j	 t
 | ƒ t
 | ƒ ƒ q& Wd  S(   NiÈ   i   (   R    R   R   t   picklet   HIGHEST_PROTOCOLt   dumpst   loadsR’   R“   R   R   (   R   R   R   RB   RP   (    (    s…   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_deque.pyt   test_pickleÊ  s    c         C   s‰   d g } t  | g ƒ } t j | ƒ } |  j t | ƒ t | ƒ ƒ d | d <|  j t | ƒ t | ƒ ƒ |  j t | ƒ t | ƒ ƒ d  S(   Ni
   i   i    (   R    t   copyt   deepcopyR   R   R’   R“   (   R   t   mutR   RP   (    (    s…   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_deque.pyt   test_deepcopyÚ  s    	
c         C   s‰   d g } t  | g ƒ } t j | ƒ } |  j t | ƒ t | ƒ ƒ d | d <|  j t | ƒ t | ƒ ƒ |  j t | ƒ t | ƒ ƒ d  S(   Ni
   i   i    (   R    Rš   R   R   R’   R“   (   R   Rœ   R   RP   (    (    s…   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_deque.pyt	   test_copyã  s    	
c         C   sO   xH d t  d ƒ f D]4 } |  j t t t | ƒ ƒ ƒ t t | ƒ ƒ ƒ q Wd  S(   NRV   iÐ  (   R   R   R   R   R    (   R   RB   (    (    s…   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_deque.pyt   test_reversedì  s    c         C   sG   d d  l  } t ƒ  } x+ t d ƒ D] } | j d ƒ | j ƒ  q" Wd  S(   Niÿÿÿÿid   i   (   t   gcR    R   R   t   collect(   R   R    R   R   (    (    s…   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_deque.pyt   test_gc_doesnt_blowupð  s
    	c         C   sº   d t  f d „  ƒ  Y} x� t d ƒ D]� } | ƒ  } t j | ƒ } | d k rb t | d g ƒ } n t t | d g ƒ ƒ } t | ƒ | _ ~ ~ t j	 ƒ  |  j
 | ƒ  d  k d ƒ q# Wd  S(   Nt   Cc           B   s   e  Z RS(    (   R
   R   (    (    (    s…   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_deque.pyR£   û  s   i   i    i   s   Cycle was not collected(   t   objectR   t   weakreft   refR    R   R'   RR   R    R¡   R�   R0   (   R   R£   R   t   objR¦   t	   container(    (    s…   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_deque.pyt   test_container_iteratorù  s    	
c         C   så   d } t  j d ƒ } t j d | ƒ } |  j t j t ƒ  ƒ | ƒ |  j } | t ƒ  | | ƒ | t d ƒ | | ƒ | t d | d ƒ | | ƒ | t d | d d ƒ | d | ƒ | t d d | ƒ | d | ƒ d  S(	   Ni>   t   2P3PlPPs   %dP2PRH   i   i   i*   i+   (	   R   t   calcobjsizet   structt   calcsizeR   R¤   t
   __sizeof__R    t   check_sizeof(   R   t   BLOCKLENt   basesizet	   blocksizet   check(    (    s…   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_deque.pyt   test_sizeof  s    	'()   R
   R   R    R3   R4   R6   RE   RT   RX   RY   R[   Rd   Re   Rk   Ro   Rw   Ry   Rz   R{   R„   R†   R‡   Rˆ   RŠ   RŒ   R�   RŽ   R�   R�   R‘   R”   R™   R�   Rž   RŸ   R¢   R©   R   R¯   t   cpython_onlyR´   (    (    (    s…   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_deque.pyR      sJ   		*		
	!									5													
													t   TestVariousIteratorArgsc           B   s#   e  Z d  „  Z d „  Z d „  Z RS(   c         C   sí   xæ d d t  d ƒ d	 t d d d ƒ f D]½ } x` t j t j t j t j t j t j f D]4 } |  j	 t
 t | | ƒ ƒ ƒ t
 | | ƒ ƒ ƒ qY W|  j t t t j | ƒ ƒ |  j t t t j | ƒ ƒ |  j t t t j | ƒ ƒ q( Wd  S(
   Nt   123R7   iè  t   dog333333ó?iÐ  i˜  i   (   R¸   g333333ó?(   R   R   R   t   Sequencet   IterFunct   IterGent   IterFuncStopt	   itermultit   iterfuncR   R   R    R%   R@   t   IterNextOnlyt
   IterNoNextt   ZeroDivisionErrort
   IterGenExc(   R   RB   t   g(    (    s…   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_deque.pyt   test_constructor  s    .2c         C   s9   t  d ƒ } t | ƒ } | j ƒ  |  j t | j ƒ d  S(   Nt   abcdefg(   R    R'   R   R%   R   t   next(   R   R   R1   (    (    s…   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_deque.pyt   test_iter_with_altered_data$  s    
c         C   s9   t  ƒ  } t | ƒ } | j d ƒ |  j t | j ƒ d  S(   Ni
   (   R    R'   R   R%   R   RÆ   (   R   R   R1   (    (    s…   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_deque.pyt!   test_runtime_error_on_empty_deque*  s    	(   R
   R   RÄ   RÇ   RÈ   (    (    (    s…   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_deque.pyR¶     s   	
	t   Dequec           B   s   e  Z RS(    (   R
   R   (    (    (    s…   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_deque.pyRÉ   0  s   t   DequeWithBadIterc           B   s   e  Z d  „  Z RS(   c         C   s
   t  ‚ d  S(   N(   R@   (   R   (    (    s…   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_deque.pyt   __iter__4  s    (   R
   R   RË   (    (    (    s…   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_deque.pyRÊ   3  s   t   TestSubclassc           B   s>   e  Z d  „  Z d „  Z d „  Z d „  Z e j d „  ƒ Z RS(   c         C   s–  t  t d ƒ ƒ } | j t d ƒ ƒ x$ t d d ƒ D] } | j | ƒ q5 Wx* t t d d ƒ ƒ D] } | j | ƒ qb W|  j t | ƒ t d d ƒ ƒ |  j t	 | ƒ d ƒ g  t d ƒ D] } | j
 ƒ  ^ q» } |  j | t d d ƒ ƒ |  j t | ƒ t d d ƒ ƒ g  t d ƒ D] } | j ƒ  ^ q} | j ƒ  |  j | t d	 d ƒ ƒ |  j t | ƒ t d d	 ƒ ƒ | j ƒ  |  j t	 | ƒ d ƒ d  S(
   Ni   iÈ   i�  i8ÿÿÿi    iX  iú   i2   i–   (   RÉ   R   R   R   R   R   R   R   R   R   R   R   R   R   (   R   R   R   R   R   (    (    s…   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_deque.pyR    9  s"    %%

c         C   sX  t  d ƒ } | j ƒ  } |  j t | ƒ t | ƒ ƒ |  j t | ƒ t | ƒ ƒ t  | ƒ } |  j t | ƒ t | ƒ ƒ |  j t | ƒ t | ƒ ƒ x� t t j d ƒ D]{ } t j | | ƒ } t j	 | ƒ } |  j
 t | ƒ t | ƒ ƒ |  j t | ƒ t | ƒ ƒ |  j t | ƒ t | ƒ ƒ q¨ Wt  d d d ƒ} | j ƒ  } |  j t | ƒ t | ƒ ƒ |  j t | ƒ t | ƒ ƒ t  | ƒ } |  j t | ƒ t | ƒ ƒ |  j t | ƒ t | ƒ ƒ x� t t j d ƒ D]{ } t j | | ƒ } t j	 | ƒ } |  j
 t | ƒ t | ƒ ƒ |  j t | ƒ t | ƒ ƒ |  j t | ƒ t | ƒ ƒ qÕWd  S(   NR!   i   Rp   R"   i   (   RÉ   t   __copy__R   RM   R   R   R•   R–   R—   R˜   R’   R“   (   R   R   RP   t   protoRB   (    (    s…   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_deque.pyt   test_copy_pickleO  s4     c         C   sT   t  d ƒ } t j | ƒ } |  j t | ƒ t | ƒ ƒ d  } |  j t t | ƒ d  S(   Nt   gallahad(   R    R¥   t   proxyR   t   strR0   R%   t   ReferenceError(   R   R   t   p(    (    s…   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_deque.pyt   test_weakref†  s
    c         C   sN   d t  f d „  ƒ  Y} | d d d g ƒ } | d d d g ƒ } | | k d  S(	   Nt   Xc           B   s   e  Z d  „  Z RS(   c         S   s
   t  g  ƒ S(   N(   R'   (   R   (    (    s…   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_deque.pyRË   �  s    (   R
   R   RË   (    (    (    s…   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_deque.pyRÖ   Ž  s   i   i   i   i   i   i   (   R    (   R   RÖ   t   d1t   d2(    (    s…   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_deque.pyt   test_strange_subclass�  s    c      
   C   s€   d t  f d „  ƒ  Y} | ƒ  } d „  } | | _ |  j t ƒ � | d Wd  QX|  j t ƒ � | t  d d d g ƒ Wd  QXd  S(   NRÖ   c           B   s   e  Z RS(    (   R
   R   (    (    (    s…   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_deque.pyRÖ   š  s   c         _   s   d g S(   Ni*   (    (   t   clsRQ   t   kwargs(    (    s…   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_deque.pyt   bad___new__�  s    i*   i   i   i   (   R    t   __new__R%   R@   (   R   RÖ   R   RÜ   (    (    s…   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_deque.pyt   test_bug_31608–  s    			(	   R
   R   R    RÏ   RÕ   RÙ   R   Rµ   RÞ   (    (    (    s…   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_deque.pyRÌ   7  s
   		7			t   SubclassWithKwargsc           B   s   e  Z d  d „ Z RS(   i   c         C   s   t  j |  ƒ d  S(   N(   R    R   (   R   t   newarg(    (    s…   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_deque.pyR   §  s    (   R
   R   R   (    (    (    s…   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_deque.pyRß   ¦  s   t   TestSubclassWithKwargsc           B   s   e  Z d  „  Z d „  Z RS(   c         C   s   t  d d ƒ d  S(   NRà   i   (   Rß   (   R   (    (    s…   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_deque.pyt   test_subclass_with_kwargs«  s    c         C   s   |  j  d ƒ d  S(   Ns-   Exhausted deque iterator doesn't free a deque(   t   skipTest(   R   (    (    s…   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_deque.pyt   test_free_after_iterating¯  s    (   R
   R   Râ   Rä   (    (    (    s…   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_deque.pyRá   ª  s   	s‘
  
Example from the Library Reference:  Doc/lib/libcollections.tex

>>> from collections import deque
>>> d = deque('ghi')                 # make a new deque with three items
>>> for elem in d:                   # iterate over the deque's elements
...     print elem.upper()
G
H
I
>>> d.append('j')                    # add a new entry to the right side
>>> d.appendleft('f')                # add a new entry to the left side
>>> d                                # show the representation of the deque
deque(['f', 'g', 'h', 'i', 'j'])
>>> d.pop()                          # return and remove the rightmost item
'j'
>>> d.popleft()                      # return and remove the leftmost item
'f'
>>> list(d)                          # list the contents of the deque
['g', 'h', 'i']
>>> d[0]                             # peek at leftmost item
'g'
>>> d[-1]                            # peek at rightmost item
'i'
>>> list(reversed(d))                # list the contents of a deque in reverse
['i', 'h', 'g']
>>> 'h' in d                         # search the deque
True
>>> d.extend('jkl')                  # add multiple elements at once
>>> d
deque(['g', 'h', 'i', 'j', 'k', 'l'])
>>> d.rotate(1)                      # right rotation
>>> d
deque(['l', 'g', 'h', 'i', 'j', 'k'])
>>> d.rotate(-1)                     # left rotation
>>> d
deque(['g', 'h', 'i', 'j', 'k', 'l'])
>>> deque(reversed(d))               # make a new deque in reverse order
deque(['l', 'k', 'j', 'i', 'h', 'g'])
>>> d.clear()                        # empty the deque
>>> d.pop()                          # cannot pop from an empty deque
Traceback (most recent call last):
  File "<pyshell#6>", line 1, in -toplevel-
    d.pop()
IndexError: pop from an empty deque

>>> d.extendleft('abc')              # extendleft() reverses the input order
>>> d
deque(['c', 'b', 'a'])



>>> def delete_nth(d, n):
...     d.rotate(-n)
...     d.popleft()
...     d.rotate(n)
...
>>> d = deque('abcdef')
>>> delete_nth(d, 2)   # remove the entry at d[2]
>>> d
deque(['a', 'b', 'd', 'e', 'f'])



>>> def roundrobin(*iterables):
...     pending = deque(iter(i) for i in iterables)
...     while pending:
...         task = pending.popleft()
...         try:
...             yield task.next()
...         except StopIteration:
...             continue
...         pending.append(task)
...

>>> for value in roundrobin('abc', 'd', 'efgh'):
...     print value
...
a
d
e
b
f
c
g
h


>>> def maketree(iterable):
...     d = deque(iterable)
...     while len(d) > 1:
...         pair = [d.popleft(), d.popleft()]
...         d.append(pair)
...     return list(d)
...
>>> print maketree('abcdefgh')
[[[['a', 'b'], ['c', 'd']], [['e', 'f'], ['g', 'h']]]]

t
   libreftestc         C   sÉ   d d  l  } t t t t f } t j | Œ  |  r¥ t | d ƒ r¥ d d  l } d  g d } xA t
 t | ƒ ƒ D]- } t j | Œ  | j ƒ  | j ƒ  | | <ql W| GHn  d d l m } t j | |  ƒ d  S(   Niÿÿÿÿt   gettotalrefcounti   (   t
   test_deque(   t   sysR   R¶   RÌ   Rá   R   t   run_unittestt   hasattrR    R0   R   R   R¡   Ræ   t   testRç   t   run_doctest(   t   verboseRè   t   test_classesR    t   countsR   Rç   (    (    s…   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_deque.pyt	   test_main  s     	
t   __main__Rí   (   t   collectionsR    t   unittestRë   R   R   R    R¥   Rš   t   cPickleR•   R^   R¬   Ru   R   R   R   t   TestCaseR   R¶   RÉ   RÊ   RÌ   Rß   Rá   Rå   t   __test__R0   Rð   R
   R>   (    (    (    s…   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_deque.pyt   <module>   s2   	ÿ üom