+
     hj  c                   sR    R t ^ RIt^ RIHtHt R R ltR R ltR R ltR	 R
 ltR# )a	  
Given a list of integers, made up of (hopefully) a small number of long runs
of consecutive integers, compute a representation of the form
((start1, end1), (start2, end2) ...). Then answer the question "was x present
in the original list?" in time O(log(# runs)).
N)ListTuplec                s`    V ^8  d   QhR\         \        ,          R\        \        R3,          /# )   list_return.)r    intr   Zformat   "3/usr/lib/python3.14/site-packages/idna/intranges.py__annotate__r	      s&      tCy U38_     c                sh   \        V 4      p. pRp\        \        V4      4       F  pV^,           \        V4      8  d$   W,          W^,           ,          ^,
          8X  d   K=  W^,           V^,            pVP                  \	        V^ ,          VR,          ^,           4      4       TpK  	  \        V4      # )a  Represent a list of integers as a sequence of ranges:
((start_0, end_0), (start_1, end_1), ...), such that the original
integers are exactly those x such that start_i <= x < end_i for some i.

Ranges are encoded as single integers (start << 32 | end), not as tuples.
i)ZsortedZrangelenZappend_encode_rangeZtuple)r   Zsorted_listrangesZ
last_writeZiZcurrent_ranges   &     r   intranges_from_listr      s     -KFJ3{#$q53{##~U!3a!77#NQU;mM!$4mB6G!6KLM
 % =r
   c                s<    V ^8  d   QhR\         R\         R\         /# )r   startendr   )r   r   r   r   r	   r	   "   s!       3 3 r
   c                 s"    V ^ ,          V,          # )     )r   r   s   &&r   r   r   "   s    RK3r
   c                sR    V ^8  d   QhR\         R\        \         \         3,          /# )r   rr   )r   r   r   r   r   r	   r	   &   s"     , ,S ,U38_ ,r
   c                 s&    V ^ ,	          V R,          3# )r   l    r   )r   s   &r   _decode_ranger   &   s    GqM*++r
   c                sV    V ^8  d   QhR\         R\        \         R3,          R\        /# )r   int_r   .r   )r   r   Zboolr   r   r   r	   r	   *   s)      C sCx T r
   c                s   \        V ^ 4      p\        P                  ! W4      pV^ 8  d-   \        W^,
          ,          4      w  rEY@u;8:  d
   V8  d    R#  V\	        V4      8  d   \        W,          4      w  rFW@8X  d   R# R# )z=Determine if `int_` falls into one of the ranges in `ranges`.TF)r   bisectZbisect_leftr   r   )r   r   Ztuple_ZposZleftZrightZ_s   &&     r   intranges_containr   *   ss    4#F


V
,C Qw#F7O4%   S[,<r
   )	Z__doc__r   Ztypingr    r   r   r   r   r   r   r
   r   <module>r      s&     ,,r
   