Current Path: > > opt > alt > python34 > lib64 > python3.4 > lib2to3 > __pycache__
Operation : Linux premium131.web-hosting.com 4.18.0-553.44.1.lve.el8.x86_64 #1 SMP Thu Mar 13 14:29:12 UTC 2025 x86_64 Software : Apache Server IP : 162.0.232.56 | Your IP: 216.73.216.111 Domains : 1034 Domain(s) Permission : [ 0755 ]
Name | Type | Size | Last Modified | Actions |
---|---|---|---|---|
__init__.cpython-34.pyc | File | 136 bytes | April 17 2024 17:10:10. | |
__init__.cpython-34.pyo | File | 136 bytes | April 17 2024 17:10:10. | |
__main__.cpython-34.pyc | File | 233 bytes | April 17 2024 17:10:10. | |
__main__.cpython-34.pyo | File | 233 bytes | April 17 2024 17:10:10. | |
btm_matcher.cpython-34.pyc | File | 5340 bytes | April 17 2024 17:10:10. | |
btm_matcher.cpython-34.pyo | File | 5340 bytes | April 17 2024 17:10:10. | |
btm_utils.cpython-34.pyc | File | 6845 bytes | April 17 2024 17:10:10. | |
btm_utils.cpython-34.pyo | File | 6845 bytes | April 17 2024 17:10:10. | |
fixer_base.cpython-34.pyc | File | 6537 bytes | April 17 2024 17:10:10. | |
fixer_base.cpython-34.pyo | File | 6537 bytes | April 17 2024 17:10:10. | |
fixer_util.cpython-34.pyc | File | 13415 bytes | April 17 2024 17:10:10. | |
fixer_util.cpython-34.pyo | File | 13415 bytes | April 17 2024 17:10:10. | |
main.cpython-34.pyc | File | 9243 bytes | April 17 2024 17:10:10. | |
main.cpython-34.pyo | File | 9204 bytes | April 17 2024 17:10:06. | |
patcomp.cpython-34.pyc | File | 6372 bytes | April 17 2024 17:10:10. | |
patcomp.cpython-34.pyo | File | 6075 bytes | April 17 2024 17:10:06. | |
pygram.cpython-34.pyc | File | 1259 bytes | April 17 2024 17:10:10. | |
pygram.cpython-34.pyo | File | 1259 bytes | April 17 2024 17:10:10. | |
pytree.cpython-34.pyc | File | 26998 bytes | April 17 2024 17:10:10. | |
pytree.cpython-34.pyo | File | 26142 bytes | April 17 2024 17:10:06. | |
refactor.cpython-34.pyc | File | 22925 bytes | April 17 2024 17:10:10. | |
refactor.cpython-34.pyo | File | 22883 bytes | April 17 2024 17:10:06. |
� j f� � @ s� d Z d Z d d l Z d d l Z d d l m Z d d l m Z d d l m Z Gd d � d e � Z Gd d � d e � Z i a d d � Z d S)a� A bottom-up tree matching algorithm implementation meant to speed up 2to3's matching process. After the tree patterns are reduced to their rarest linear path, a linear Aho-Corasick automaton is created. The linear automaton traverses the linear paths from the leaves to the root of the AST and returns a set of nodes for further matching. This reduces significantly the number of candidate nodes.z+George Boutsioukis <gboutsioukis@gmail.com>� N)�defaultdict� )�pytree)�reduce_treec @ s. e Z d Z d Z e j � Z d d � Z d S)�BMNodez?Class for a node of the Aho-Corasick automaton used in matchingc C s1 i | _ g | _ t t j � | _ d | _ d S)N� )�transition_table�fixers�nextr �count�id�content)�self� r �8/opt/alt/python34/lib64/python3.4/lib2to3/btm_matcher.py�__init__ s zBMNode.__init__N)�__name__� __module__�__qualname__�__doc__� itertoolsr r r r r r r s r c @ sR e Z d Z d Z d d � Z d d � Z d d � Z d d � Z d d � Z d S) � BottomMatcherzgThe main matcher class. After instantiating the patterns should be added using the add_fixer methodc C sF t � | _ t � | _ | j g | _ g | _ t j d � | _ d S)NZRefactoringTool) �set�matchr �rootZnodesr �loggingZ getLoggerZlogger)r r r r r s zBottomMatcher.__init__c C sh | j j | � t | j � } | j � } | j | d | j �} x | D] } | j j | � qJ Wd S)z�Reduces a fixer's pattern tree to a linear path and adds it to the matcher(a common Aho-Corasick automaton). The fixer is appended on the matching states and called when they are reached�startN)r �appendr Zpattern_treeZget_linear_subpattern�addr )r �fixerZtreeZlinear�match_nodesZ match_noder r r � add_fixer% s zBottomMatcher.add_fixerc C s | s | g St | d t � r� g } x[ | d D]O } | j | d | �} x1 | D]) } | j | j | d d � | � � qS Wq1 W| S| d | j k r� t � } | | j | d <n | j | d } | d d � r� | j | d d � d | �} n | g } | Sd S)z5Recursively adds a linear pattern to the AC automatonr r r N)� isinstance�tupler �extendr r )r �patternr r ZalternativeZ end_nodes�endZ next_noder r r r 1 s"