
    d                        d dl mZ d dlZd dlZd dlZd dlmZmZmZ erd dl	m
Z
 nd dlm
Z
 erDd dlZd dlm
Z
 d Zd dlmZ d Zd Zd d	lmZ d
 ZeZ	 d dlmZ n# e$ r	 d dlmZ Y nw xY weZeZeZnWd dl Z d dl	m
Z
 e j        Ze j        Ze j        Ze j!        Z!e j        Ze j        Ze j        Ze j        Ze j        Ze j        Ze j        ZerddZ!erg dZ"dS g Z"dS )    )unicode_literalsN)PY2PY3exec_)Mappingc                      | |i |S N )fargskws      2lib/python3.11/site-packages/past/builtins/misc.pyapplyr      s    q$~"~~    )strc                 <    t          t          | f                    S )zU
        Return a byte-string of one character with ordinal i; 0 <= i <= 256
        )oldstrbytes)is    r   chrr      s     eQDkk"""r   c                     t           t                    r$t          t                    rt          d          	 t           t          j                  rwt          j                   rct          t          j                  s0t          d                    t                                        t          t                    rdS dS t          t          j                  rwt          j                  rct           t          j                  s0t          d                    t                                         t           t                    rdS dS  k     k     z
  S # t          $ r_  k    rY dS t          d	          t          j        t          t          t          t          t          fg}d	x}}t          |          D ])\  }}t           |          r|}t          |          r|}*t          ||          dk    rt           t                    r:t          t                    r%t                               d
                    cY S t          t                    r:t           t                    r%t                               d
                    cY S t           t                    r5t#                     D ]!\  }}t          ||          }	|	dk    r|	c cY S "Y dS t           t                    rt%                     t%                    k    r,t          t%                     t%                              cY S t'           fd D                       }
t'           fdD                       }|
|k    rt          |
|          cY S t           |
         |                   cY S t          ||          cY S w xY w)z
        cmp(x, y) -> integer

        Return negative if x<y, zero if x==y, positive if x>y.
        Python2 had looser comparison allowing cmp None and non Numerical types and collections.
        Try to match the old behavior
        zcannot compare sets using cmp()z.cannot compare float("nan"), {type_y} with cmp)type_y   z.cannot compare {type_x}, float("nan") with cmp)type_xr   Nasciic              3   H   K   | ]}|vs|         |         k    |V  d S r	   r
   ).0axys     r   	<genexpr>zcmp.<locals>.<genexpr>X   =      #O#O!AQJ#O!A$!A$,#OA#O#O#O#O#O#Or   c              3   H   K   | ]}|vs|         |         k    |V  d S r	   r
   )r   br    r!   s     r   r"   zcmp.<locals>.<genexpr>Y   r#   r   )
isinstanceset	TypeErrornumbersNumbermathisnanformattypeintdictlistr   r   	enumeratecmpdecodeziplenmin)r    r!   
type_orderx_type_indexy_type_indexr   
type_matchx_elemy_elemelem_cmp_valx_keyy_keys   ``          r   r3   r3      s    a 	@*Q"4"4 	@=???7	3!W^,, A !!W^44 m#$T$[$[cghicjcj$[$k$kllla%% 12!W^,, A !!W^44 m#$T$[$[cghicjcj$[$k$kllla%% 21Ea!e$$ '	3 '	3 '	3Av qqT

deJ +/.L<!*:!6!6 % %:a,, %#$La,, %#$L<..!3 ;a'' 5Jq#,>,> 5qxx00!44444a'' ;Jq#,>,> ;q!((7"3"3444444(( ;*-a)) 0 0'*66':':'1, 0#//////0 114(( 	;1vvQ' ;"3q663q6622222 ##O#O#O#O#Oq#O#O#O O O ##O#O#O#O#Oq#O#O#O O O E> ;#&ue#4#4444#&qx5#:#::::|\22222O'	3sT   BE, BE, E, ,O COAO*AO0O4AOAO%OOO)internc                 @    dt          j        |           dd         z   S )zUoct(number) -> string

        Return the octal representation of an integer
        0   N)builtinsoct)numbers    r   rF   rF   b   s"    
 X\&))!""---r   )reloadc                    |4t          j                    d         }|d         j        }|d         j        }n||}t	          |t
                    st          d          t	          |t
                    st          d          t          | d          5 }|                                }ddd           n# 1 swxY w Y   t          || d          }t          |||           dS )z
        Read and execute a Python script from a file in the given namespaces.
        The globals and locals are dictionaries, defaulting to the current
        globals and locals. If only globals is given, locals defaults to it.
        Nr   r   zglobals must be a mappingzlocals must be a mappingrbexec)inspectstack	f_globalsf_localsr&   r   r(   openreadcompiler   )filename	myglobalsmylocalscaller_framefinsourcecodes          r   execfilerZ      s     	!"=??1-L$Q1I#A/HH 	! H)W-- 	97888(G,, 	86777(D!! 	 SXXZZF	  	  	  	  	  	  	  	  	  	  	  	  	  	  	 vx00dIx(((((s   B44B8;B8)
r   r   r3   rZ   rA   	raw_inputrH   unichrunicodexrange)NN)#
__future__r   rL   r+   r)   future.utilsr   r   r   collectionsr   collections.abcrE   r   past.builtinsr   r   r   r3   sysrA   rF   inputr[   	importlibrH   ImportErrorimpr]   r\   ranger^   __builtin__rZ   __all__r
   r   r   <module>rl      s-   ' ' ' ' ' '    ( ( ( ( ( ( ( ( ( ( (#######'''''' s OOO''''''   ,+++++# # #A3 A3 A3F . . . I$$$$$$$    GFFF######E
/C
/C#HF
/C%IF!GFF  )) ) ) )0  8 8 8GGG GGGs   A A('A(