a
    0c                     @   sf  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y   d dlmZ Y n0 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rNdddZ!er^g dZ"ng Z"dS )    )unicode_literalsN)PY2PY3exec_)Mappingc                 O   s   | |i |S N )fargskwr   r   [/var/www/html/stable-diffusion-webui/venv/lib/python3.9/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y    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rvt trvt 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rft|
| Y S t |
 |  Y S t|| Y S 0 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*   | ]"}|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   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+      sf    




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   r4   b   s    r4   )reloadc                 C   s   |du r*t  d }|d j}|d j}n|du r6|}t|tsHtdt|tsZtdt| d}| }W d   n1 s0    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   )filenameZ	myglobalsZmylocalsZcaller_frameZfinsourcecoder   r   r   execfile   s    


&rC   )
r   r   r+   rC   r0   	raw_inputr6   unichrunicodexrange)NN)#
__future__r   r9   r#   r!   Zfuture.utilsr   r   r   collectionsr   collections.abcr3   r   Zpast.builtinsr   r   r   r+   sysr0   r4   inputrD   	importlibr6   ImportErrorimprF   rE   rangerG   __builtin__rC   __all__r   r   r   r   <module>   sT   C

