| Server IP : 162.19.112.25 / Your IP : 216.73.216.88 Web Server : LiteSpeed System : Linux qamar.tasjeel.ae 5.14.0-611.55.1.el9_7.x86_64 #1 SMP PREEMPT_DYNAMIC Tue May 19 15:19:29 EDT 2026 x86_64 User : archiart ( 1428) PHP Version : 8.2.33 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /proc/self/root/opt/alt/python37/lib64/python3.7/lib2to3/__pycache__/ |
Upload File : |
B
��� (�� @ s| d Z ddlmZ ddlmZmZ ddlmZmZ eZ eZ
ejZeZ
dZdZdZG dd � d e�Zddd�Zd
d� Zdd� Zd
S )z0Utility functions used by the btm_matcher module� )�pytree)�grammar�token)�pattern_symbols�python_symbols���������c @ s: e Zd ZdZd
dd�Zdd� Zdd� Zd d
� Zdd� ZdS )�MinNodez�This class serves as an intermediate representation of the
pattern tree during the conversion to sets of leaf-to-root
subpatternsNc C s. || _ || _g | _d| _d | _g | _g | _d S )NF)�type�name�children�leaf�parent�alternatives�group)�selfr r � r �6/opt/alt/python37/lib64/python3.7/lib2to3/btm_utils.py�__init__ s zMinNode.__init__c C s t | j�d t | j� S )N� )�strr r )r r r r �__repr__ s zMinNode.__repr__c C s� | }g }x�|r�|j tkr`|j�|� t|j�t|j�krTt|j�g}g |_|j}q
n|j}d}P |j tkr�|j �|� t|j �t|j�kr�t
|j �}g |_ |j}q
n|j}d}P |j tjkr�|j
r�|�|j
� n|�|j � |j}q
W |S )z�Internal method. Returns a characteristic path of the
pattern tree. This method must be run for all leaves until the
linear subpatterns are merged into a singleN)r �TYPE_ALTERNATIVESr �append�lenr
�tupler �
TYPE_GROUPr �get_characteristic_subpattern�token_labels�NAMEr )r �node�subpr r r �leaf_to_root! s8
zMinNode.leaf_to_rootc C s&