<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha1/dist/css/bootstrap.min.css" rel="stylesheet"
        integrity="sha384-GLhlTQ8iRABdZLl6O3oVMWSktQOp6b7In1Zl3/Jr59b6EGGoI1aFkw7cmDA6j6gD" crossorigin="anonymous">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.3.0/css/all.min.css"
        integrity="sha512-SzlrxWUlpfuzQ+pcUCosxcglQRNAq/DZjVsC0lE40xsADsfeQoEypE+enwcOiGjk/bSuGGKHEyjSoQ1zVisanQ=="
        crossorigin="anonymous" referrerpolicy="no-referrer" />
</head>
</html>
U
    if                     @   sJ   d dl mZ d dlmZmZmZmZmZmZ dZ	dZ
G dd dejZdS )   )
fixer_base)CallCommaNameNode	BlankLinesymsz0(n='!=' | '==' | 'is' | n=comp_op< 'is' 'not' >)z(power< 'type' trailer< '(' x=any ')' > >c                       sP   e Zd ZdZdeeeef Z fddZdd Zdd Z	d	d
 Z
dd Z  ZS )	FixIdiomsTa  
        isinstance=comparison< %s %s T=any >
        |
        isinstance=comparison< T=any %s %s >
        |
        while_stmt< 'while' while='1' ':' any+ >
        |
        sorted=any<
            any*
            simple_stmt<
              expr_stmt< id1=any '='
                         power< list='list' trailer< '(' (not arglist<any+>) any ')' > >
              >
              '\n'
            >
            sort=
            simple_stmt<
              power< id2=any
                     trailer< '.' 'sort' > trailer< '(' ')' >
              >
              '\n'
            >
            next=any*
        >
        |
        sorted=any<
            any*
            simple_stmt< expr_stmt< id1=any '=' expr=any > '\n' >
            sort=
            simple_stmt<
              power< id2=any
                     trailer< '.' 'sort' > trailer< '(' ')' >
              >
              '\n'
            >
            next=any*
        >
    c                    s8   t t| |}|r4d|kr4|d |d kr0|S d S |S )NsortedZid1Zid2)superr	   match)selfnoder	__class__ =/opt/alt/python38/lib64/python3.8/lib2to3/fixes/fix_idioms.pyr   O   s    zFixIdioms.matchc                 C   sH   d|kr|  ||S d|kr(| ||S d|kr<| ||S tdd S )N
isinstancewhiler
   zInvalid match)transform_isinstancetransform_whiletransform_sortRuntimeError)r   r   resultsr   r   r   	transformZ   s    zFixIdioms.transformc                 C   sh   |d   }|d   }d|_d|_ttd|t |g}d|kr\d|_ttjtd|g}|j|_|S )NxT  r   nnot)cloneprefixr   r   r   r   r   Znot_test)r   r   r   r   r   Ztestr   r   r   r   d   s    zFixIdioms.transform_isinstancec                 C   s    |d }| td|jd d S )Nr   Truer#   )replacer   r#   )r   r   r   Zoner   r   r   r   p   s    zFixIdioms.transform_whilec                 C   s   |d }|d }| d}| d}|r>|td|jd n8|rn| }d|_|ttd|g|jd ntd|  |j}d	|kr|r|d	d
 |d
 jf}	d		|	|d
 _n"t
 }
|j|
 |d	d
 |
_d S )Nsortnextlistexprr
   r%   r   zshould not have reached here
    )getr&   r   r#   r"   r   r   remove
rpartitionjoinr   parentZappend_child)r   r   r   Z	sort_stmtZ	next_stmtZ	list_callZsimple_exprnewZbtwnZprefix_linesZend_liner   r   r   r   t   s,    


zFixIdioms.transform_sort)__name__
__module____qualname__ZexplicitTYPECMPZPATTERNr   r   r   r   r   __classcell__r   r   r   r   r	   %   s   %
'
r	   N)r   r   Z
fixer_utilr   r   r   r   r   r   r7   r6   ZBaseFixr	   r   r   r   r   <module>   s    