HEX
Server: Apache/2.4.52 (Ubuntu)
System: Linux spn-python 5.15.0-89-generic #99-Ubuntu SMP Mon Oct 30 20:42:41 UTC 2023 x86_64
User: arjun (1000)
PHP: 8.1.2-1ubuntu2.20
Disabled: NONE
Upload Files
File: //home/arjun/projects/env/lib/python3.10/site-packages/kombu/utils/__pycache__/text.cpython-310.pyc
o

'we��@s�dZddlmZddlmZddlmZmZddlm	Z	d'dd�Z
d(d)dd�Zd(d*dd�Zd+dd�Z
				d,d-d!d"�Zd.d/d$d%�Zd&S)0zText Utilities.�)�annotations)�SequenceMatcher)�Iterable�Iterator)�version_info_t�csd��fdd�|D��S)z2Escape string for use within a regular expression.rc3s8�|]}|��s|�vr|n	|dkrdnd|VqdS)�z\000�\N)�isalnum)�.0�c��white��I/home/arjun/projects/env/lib/python3.10/site-packages/kombu/utils/text.py�	<genexpr>s��
�zescape_regex.<locals>.<genexpr>)�join)�prrr
r�escape_regex
s�r�333333�?�needle�str�haystack�
Iterable[str]�	min_ratio�float�return�Iterator[tuple[float, str]]ccs2�|D]}td||���}||kr||fVqdS)zVFuzzy match: iteratively.

    Yields
    ------
        Tuple: of ratio and key.
    N)r�ratio)rrr�keyrrrr�fmatch_iters�
��r �
str | NonecCs4ztt|||�dd�ddWStyYdSw)z'Fuzzy match - Find best match (scalar).T)�reverser�N)�sortedr �
IndexError)rrrrrr�fmatch_best#s����r&�srcCsvt|�d��}t|jt�rt|j|jgt|dd���R�}|j	s9|j
r9d|j
vr9tt|dd��|j
�d��}|S)z-Convert version string to version info tuple.�.�N�-r�)�_unpack_version�split�
isinstance�microrr�major�minor�_splitmicro�serial�releaselevel�list)r'�vrrr�version_string_as_tuple-s" r7r0r1�	str | intr/r4r3cCstt|�t|�|||�S)N)r�int)r0r1r/r4r3rrrr,9sr,�tuple[int, str, str]cCsNt|�D]
\}}|��sn
qt|pd�||fSt|d|��||d�|fS)Nr)�	enumerate�isdigitr9)r/r4r3�index�charrrrr2Cs�r2N)r)r)rrrrrrrr)rrrrrrrr!)r'rrr)rrrr)r0rr1r8r/r8r4rr3rrr)rr)r/rr4rr3rrr:)�__doc__�
__future__r�difflibr�typingrr�komburrr r&r7r,r2rrrr�<module>s
	

�