HEX
Server: LiteSpeed
System: Linux php-prod-1.spaceapp.ru 5.15.0-157-generic #167-Ubuntu SMP Wed Sep 17 21:35:53 UTC 2025 x86_64
User: xnsbb3110 (1041)
PHP: 8.1.33
Disabled: NONE
Upload Files
File: //usr/local/CyberCP/lib/python3.10/site-packages/validators/__pycache__/finance.cpython-310.pyc
o

�h��@sfdZddlmZdefdd�Zdefdd�Zedefd	d��Zedefd
d��Zedefdd
��ZdS)zFinance.�)�	validator�cusipcCs�d\}}td�D]g}||}|dkr|dkrt|�td�}n>|dkr2|dkr2dt|�td�}n+|dkrE|d	krEdt|�td�}n|d
krLd}n|dkrSd
}n
|dkrZd}ndS|d@re||7}||d|d}q|ddkS)N��N�	�0�9�A�Z�
�a�z�*�$�@�%�#�&Frr��range�ord)r�check�val�idx�c�r�E/usr/local/CyberCP/lib/python3.10/site-packages/validators/finance.py�_cusip_checksums(r�valuecCs�d\}}td�D]L}||}|dkr#|dkr#|dkr#t|�td�}n)|dkr6|dkr6dt|�td�}n|d	krI|d
krIdt|�td	�}ndS|d@rT||7}q|ddkS)
Nr�rrrr	r
rrr
Frr)rrrrrrrr�_isin_checksum"s�r cC�t|�dko	t|�S)a�Return whether or not given value is a valid CUSIP.

    Checks if the value is a valid [CUSIP][1].
    [1]: https://en.wikipedia.org/wiki/CUSIP

    Examples:
        >>> cusip('037833DP2')
        True
        >>> cusip('037833DP3')
        ValidationFailure(func=cusip, ...)

    Args:
        value: CUSIP string to validate.

    Returns:
        (Literal[True]): If `value` is a valid CUSIP string.
        (ValidationError): If `value` is an invalid CUSIP string.
    r)�lenr�rrrrr6�cCr!)a�Return whether or not given value is a valid ISIN.

    Checks if the value is a valid [ISIN][1].
    [1]: https://en.wikipedia.org/wiki/International_Securities_Identification_Number

    Examples:
        >>> isin('037833DP2')
        True
        >>> isin('037833DP3')
        ValidationFailure(func=isin, ...)

    Args:
        value: ISIN string to validate.

    Returns:
        (Literal[True]): If `value` is a valid ISIN string.
        (ValidationError): If `value` is an invalid ISIN string.
    r)r"r r#rrr�isinMr$r%cCs�t|�dkrdSgd�}d}td�D]>}||}|dvrdSd}|dkr2|dkr2t|�td�}n|d	krE|d
krEdt|�td	�}ndS||||7}q|ddkS)a�Return whether or not given value is a valid SEDOL.

    Checks if the value is a valid [SEDOL][1].
    [1]: https://en.wikipedia.org/wiki/SEDOL

    Examples:
        >>> sedol('2936921')
        True
        >>> sedol('29A6922')
        ValidationFailure(func=sedol, ...)

    Args:
        value: SEDOL string to validate.

    Returns:
        (Literal[True]): If `value` is a valid SEDOL string.
        (ValidationError): If `value` is an invalid SEDOL string.
    �F)r�rr&r'rrr�AEIOUNrrr	r
r)r"rr)r�weightsrrrrrrr�sedolds r*N)	�__doc__�utilsr�strrr rr%r*rrrr�<module>s