python (3.11.7)
    e                     &   d Z ddlZd Zd Zd Zd Zd ZdZd	 Zd
 Z	d Z
d Zd
 Zd Z
d Z G d dej                  Z G d dej                  Z G d dej                  Z G d deej                  Z G d deej                  Zd ZdS )uY    Codec for the Punicode encoding, as specified in RFC 3492
Written by Martin v. Löwis.
    Nc                    t                      }t                      }| D ]M}t          |          dk     r#|                    t          |                     8|                    |           Nt          |          }t
          |          |fS )z 3.1 Basic code point segregation   )	bytearraysetordappendaddsortedbytes)strbaseextendedcs       F/BuggyBox/python/3.11.7/bootstrap/lib/python3.11/encodings/punycode.py	segregater   
   s|    ;;DuuH
  q66C<<KKALLOOOOhH;;      c                 D    d}| D ]}t          |          |k     r|dz
  }|S )z@Return the length of str, considering only characters below max.r      )r   )r   maxresr   s       r   
selective_lenr      s4    
C
  q66C<<1HCJr   c                 ~    t          |           }	 |dz
  }||k    rdS | |         }||k    r|dz   |fS ||k     r|dz
  }.)a  Return a pair (index, pos), indicating the next occurrence of
    char in str. index is the position of the character considering
    only ordinals up to and including char, and pos is the position in
    the full string. index/pos is the starting position in the full
    string.r   )r   )len)r   charindexposlr   s         r   selective_findr      sb     	CAq!888H997C<
XXQJEr   c                     d}g }d}|D ]t}dx}}t          |          }t          | |          }	|	dz   ||z
  z  }
	 t          | |||          \  }}|dk    rn%|
||z
  z
  }
|                    |
dz
             |}d}
A|}u|S )3.2 Insertion unsort codingr   r   r   r   )r   r   r   r   )r   r   oldcharresultoldindexr   r   r   r   curlendeltas              r   insertion_unsortr'