U
    h                  
   @   sr  d dl mZ d dlZd dlZd dlZd dlZd dlmZmZm	Z	 erRd 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ejdkrd dlmZ nd dlmZ 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rJdddZ!erjd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   D/var/www/html/venv/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>Z   s       zcmp.<locals>.<genexpr>c                 3   s*   | ]"}| ks | | kr|V  qd S r   r   )r   br   r   r   r   [   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   d   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mylocalsZcaller_frameZfinsourcecoder   r   r   execfile   s    


rD   r/   	raw_inputr7   unichrunicodexrange)NN)#
__future__r   r:   sysr"   r    Zfuture.utilsr   r   r   collectionsr   collections.abcr2   r   Zpast.builtinsr   r   r   r*   r/   r3   inputrE   version_info	importlibr7   imprG   rF   rangerH   __builtin__rD   __all__r   r   r   r   <module>   s^   C

   