U
    ~d                  
   @   sx  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rJd dl	m
Z
 nd dlm
Z
 erd dlZd dlm
Z
 dd Zd dlmZ dd	 Zd
d Zd dlmZ dd ZeZzd dlmZ W n  ek
r   d dlmZ Y nX eZeZeZnVd 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rPdddZ!erpdd	ddddddddg
Z"ng Z"dS )    )unicode_literalsN)PY2PY3exec_)Mappingc                 O   s
   | ||S N )fargskwr   r   O/var/www/html/myproject/myenv/lib/python3.8/site-packages/past/builtins/misc.pyapply   s    r   )strc                 C   s   t t| fS )zU
        Return a byte-string of one character with ordinal i; 0 <= i <= 256
        )oldstrbytes)ir   r   r   chr   s    r   c              
      s  t  trt trtdzt  tjrjt rjt tjsTtdjtdt t	rdW dS W dS t tjrtrt  tjstdjt dt  t	rW dS W dS  k k  W S  tk
r    krY dS td	tjt
ttttfg}d	 }}t|D ]*\}}t  |r(|}t |r|}qt||dkr~t  trxt trxt d
 Y S t trt  trt d
 Y S t  trt D ]*\}}t||}	|	dkr|	   Y S qY dS t  t
r~t tkr tt t Y S t fdd D }
t fddD }|
|krht|
| Y S t |
 |  Y S t|| Y S X d	S )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)Ztype_y   z.cannot compare {type_x}, float("nan") with cmp)Ztype_xr   Nasciic                 3   s*   | ]"}|ks | | kr|V  qd S r   r   ).0axyr   r   	<genexpr>X   s       zcmp.<locals>.<genexpr>c                 3   s*   | ]"}| ks | | kr|V  qd S r   r   )r   br   r   r   r   Y   s       )
isinstanceset	TypeErrornumbersNumbermathisnanformattypeintdictlistr   r   	enumeratecmpdecodeziplenmin)r   r   Z
type_orderZx_type_indexZy_type_indexr   Z
type_matchZx_elemZy_elemZelem_cmp_valZx_keyZy_keyr   r   r   r*      sh    

 


r*   )internc                 C   s   dt | dd  S )zUoct(number) -> string

        Return the octal representation of an integer
        0   N)builtinsoct)numberr   r   r   r3   b   s    r3   )reloadc              	   C   s   |dkr*t  d }|d j}|d j}n|dkr6|}t|tsHtdt|tsZtdt| d}| }W 5 Q R X 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   )filenameZ	myglobalsZmylocalscaller_frameZfinsourcecoder   r   r   execfile   s    


rC   r/   	raw_inputr5   unichrunicodexrange)NN)#
__future__r   r8   r"   r    Zfuture.utilsr   r   r   collectionsr   collections.abcr2   r   Zpast.builtinsr   r   r   r*   sysr/   r3   inputrD   	importlibr5   ImportErrorimprF   rE   rangerG   __builtin__rC   __all__r   r   r   r   <module>   s^   C
   