o
    0c                     @   sd  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rtd 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yl   d dlmZ Y nw eZeZeZn+d 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rdddZ!erg dZ"dS g Z"dS )    )unicode_literalsN)PY2PY3exec_)Mappingc                 O   s   | |i |S N )fargskwr   r   _/var/www/html/portale_awareness/portale-venv/lib/python3.10/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              
      sx  t  trt trtdzUt  tjr5t r5t tjs*tdjtdt t	r2W dS W dS t tjr[tr[t  tjsPtdjt dt  t	rXW dS W dS  k k  W S  ty;    krrY dS td	tjt
ttttfg}d	 }}t|D ]\}}t  |r|}t |r|}qt||dkr4t  trt trt 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
r4t tkrtt t Y S t fdd D }
t fddD }|
|kr)t|
| Y S t |
 |  Y S t|| Y S 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   s,    | ]}|vs | | kr|V  qd S r   r   ).0axyr   r   	<genexpr>X      * zcmp.<locals>.<genexpr>c                 3   s,    | ]}| vs | | kr|V  qd S r   r   )r   br   r   r   r   Y   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_keyr   r   r   r-      sl   






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   r?   b   s   r?   )reloadc                 C   s   |du rt  d }|d j}|d j}n|du r|}t|ts$tdt|ts-tdt| d}| }W d   n1 sAw   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coder   r   r   execfile   s   



rR   )
r   r   r-   rR   r;   	raw_inputrA   unichrunicodexrange)NN)#
__future__r   rD   r%   r#   future.utilsr   r   r   collectionsr   collections.abcr>   r   past.builtinsr   r   r   r-   sysr;   r?   inputrS   	importlibrA   ImportErrorimprU   rT   rangerV   __builtin__rR   __all__r   r   r   r   <module>   sX    C
