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/fuzzywuzzy/__pycache__/utils.cpython-310.pyc
o

we#
�@s�ddlmZddlZddlZddlmZejddkZdd�Zdd�Z	d	d
�Z
dd�Zed
��
dd�edd�D��ZerGedd�eD��ZeZdd�Zdd�Zdd�Zddd�Zdd�ZdS) �)�unicode_literalsN)�StringProcessor�cCs$zt|�dkWStyYdSw)zn
    Check input has length and that length > 0

    :param s:
    :return: True if len(s) > 0 else False
    rF)�len�	TypeError��s�r	�I/home/arjun/projects/env/lib/python3.10/site-packages/fuzzywuzzy/utils.py�validate_strings
�rc�t����fdd��}|S)Ncs"|d|dkr
dS�|i|��S)Nr��dr	��args�kwargs��funcr	r
�	decoratorsz(check_for_equivalence.<locals>.decorator��	functools�wraps�rrr	rr
�check_for_equivalence�rcr)Ncs*|ddus|ddurdS�|i|��S�Nrr
r	rrr	r
r"sz!check_for_none.<locals>.decoratorrrr	rr
�check_for_none!rrcr)Ncs2t|d�dkst|d�dkrdS�|i|��Sr)rrrr	r
r+s z%check_empty_string.<locals>.decoratorrrr	rr
�check_empty_string*rr�cCsg|]}t|��qSr	)�chr)�.0�ir	r	r
�
<listcomp>3sr"��ccs�|]	}t|�dfVqdS�N)�ord)r �cr	r	r
�	<genexpr>5s�r(cCstr|�t�S|�dt�Sr%)�PY3�	translate�translation_table�	bad_charsrr	r	r
�	asciionly9s
r-cCs<t|�tur
t|�St|�turt|�dd��Stt|��S)N�ascii�ignore)�type�strr-�unicode�encode�asciidammitrr	r	r
r4@s
r4cCsHt|t�rt|t�r||fSt|t�rt|t�r||fSt|�t|�fS)zTIf both objects aren't either both string or unicode instances force them to unicode)�
isinstancer1r2)�s1�s2r	r	r
�make_type_consistentIs
r8FcCs.|rt|�}t�|�}t�|�}t�|�}|S)z�Process string by
        -- removing all but letters and numbers
        -- trim whitespace
        -- force to lower case
        if force_ascii == True, force convert to ascii)r4r�/replace_non_letters_non_numbers_with_whitespace�
to_lower_case�strip)r�force_ascii�
string_outr	r	r
�full_processUs


r>cCstt|��S)z#Returns a correctly rounded integer)�int�round)�nr	r	r
�intrgsrB)F)�
__future__r�sysr�fuzzywuzzy.string_processingr�version_infor)rrrrr1�join�ranger,�dictr+r2r-r4r8r>rBr	r	r	r
�<module>s$