CasperSecurity

Current Path : /lib/python3/dist-packages/babel/__pycache__/
Upload File :
Current File : //lib/python3/dist-packages/babel/__pycache__/util.cpython-310.pyc

o

V��\��@sdZddlZddlZddlmZmZddlZddlZddlZddl	m
Z
mZddlZ
ddlmZe�Zdd�Ze�dej�Zd	d
�Ze�d�Zdd
d�Zdd�ZGdd�dej�Zddd�ZejZGdd�de�Ze
jZ ej!Z!ej"Z"ej#Z#ej$Z$ej%Z%ej&Z&dS)z�
    babel.util
    ~~~~~~~~~~

    Various utility classes and functions.

    :copyright: (c) 2013-2019 by the Babel Team.
    :license: BSD, see LICENSE for more details.
�N)�	timedelta�tzinfo)�izip�imap)�	localtimeccs2�t�}t|�D]}||vr|V|�|�qdS)a�Yield all items in an iterable collection that are distinct.

    Unlike when using sets for a similar effect, the original ordering of the
    items in the collection is preserved by this function.

    >>> print(list(distinct([1, 2, 1, 3, 4, 4])))
    [1, 2, 3, 4]
    >>> print(list(distinct('foobar')))
    ['f', 'o', 'b', 'a', 'r']

    :param iterable: the iterable collection providing the data
    N)�set�iter�add)�iterable�seen�item�r
�,/usr/lib/python3/dist-packages/babel/util.py�distincts�

��rs([ \t\f]* \# .* coding[=:][ \t]*([-\w.]+)c
Cs|��}|�d�zw|��}|�tj�}|r|ttj�d�}t�|�}|sJzddl	}|�
|�d��Wntt
tfy@Yn
w|��}t�|�}|ri|ra|�d��d�}|dkrat
d�|���W|�|�dS|ry|�d��d�W|�|�SW|�|�dS|�|�w)a/Deduce the encoding of a source file from magic comment.

    It does this in the same way as the `Python interpreter`__

    .. __: https://docs.python.org/3.4/reference/lexical_analysis.html#encoding-declarations

    The ``fp`` argument should be a seekable file object.

    (From Jeff Dairiki)
    rN�latin-1�zutf-8zencoding problem: {0} with BOM)�tell�seek�readline�
startswith�codecs�BOM_UTF8�len�PYTHON_MAGIC_COMMENT_re�match�parser�suite�decode�ImportError�SyntaxError�UnicodeEncodeError�group�format)�fp�pos�line1�has_bom�mr�line2�magic_comment_encodingr
r
r�parse_encoding1sB

�
����r*z'from\s+__future__\s+import\s+\(*(.+)\)*rc
	Cs�ddl}|��}|�d�d}zK|���|�}t�dd|�}t�dd|�}t�dd|�}t�|�D]!}d	d
�|�	d��
d�D�}|D]}t||d�}	|	rQ||	jO}qBq1W|�|�|S|�|�w)
zRParse the compiler flags by :mod:`__future__` from the given Python
    code.
    rNzimport\s*\([\r\n]+zimport (z,\s*[\r\n]+z, z\\\s*[\r\n]+� cSsg|]	}|���d��qS)z())�strip)�.0�xr
r
r�
<listcomp>}sz&parse_future_flags.<locals>.<listcomp>r�,)
�
__future__rr�readr�re�sub�PYTHON_FUTURE_IMPORT_re�finditerr!�split�getattr�
compiler_flag)
r#�encodingr1r$�flags�bodyr'�names�name�featurer
r
r�parse_future_flagsgs*

���
�r@cCs�ddddddd�}|�d�rdg}|d	d
�}n|�d�r'dg}|dd
�}ng}tt�d
|��D]\}}|drA|�||�q1|rK|�t�|��q1t�d�|�d|�t	j
d��}|d
uS)a�Extended pathname pattern matching.

    This function is similar to what is provided by the ``fnmatch`` module in
    the Python standard library, but:

     * can match complete (relative or absolute) path names, and not just file
       names, and
     * also supports a convenience pattern ("**") to match files at any
       directory level.

    Examples:

    >>> pathmatch('**.py', 'bar.py')
    True
    >>> pathmatch('**.py', 'foo/bar/baz.py')
    True
    >>> pathmatch('**.py', 'templates/index.html')
    False

    >>> pathmatch('./foo/**.py', 'foo/bar/baz.py')
    True
    >>> pathmatch('./foo/**.py', 'bar/baz.py')
    False

    >>> pathmatch('^foo/**.py', 'foo/bar/baz.py')
    True
    >>> pathmatch('^foo/**.py', 'bar/baz.py')
    False

    >>> pathmatch('**/templates/*.html', 'templates/index.html')
    True
    >>> pathmatch('**/templates/*.html', 'templates/foo/bar.html')
    False

    :param pattern: the glob pattern
    :param filename: the path name of the file to match against
    z[^/]z[^/]/z[^/]+z[^/]+/z	(?:.+/)*?z(?:.+/)*?[^/]+)�?z?/�*z*/z**/z**�^rNz./�z	([?*]+/?)��$�/)r�	enumerater3r7�append�escaper�join�replace�os�sep)�pattern�filename�symbols�buf�idx�partrr
r
r�	pathmatch�s,'�
	
� rUc@seZdZe�d�ZdS)�TextWrapperz((\s+|(?<=[\w\!\"\'\&\.\,\?])-{2,}(?=\w))N)�__name__�
__module__�__qualname__r3�compile�
wordsep_rer
r
r
rrV�s�rV�FrEcCst|||dd�}|�|�S)a�Simple wrapper around the ``textwrap.wrap`` function in the standard
    library. This version does not wrap lines on hyphens in words.

    :param text: the text to wrap
    :param width: the maximum line width
    :param initial_indent: string that will be prepended to the first line of
                           wrapped output
    :param subsequent_indent: string that will be prepended to all lines save
                              the first of wrapped output
    F)�width�initial_indent�subsequent_indent�break_long_words)rV�wrap)�textr]r^r_�wrapperr
r
r�wraptext�s
�
rdc@sBeZdZdZddd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dS)�FixedOffsetTimezonez&Fixed offset in minutes east from UTC.NcCs&t|d�|_|durd|}||_dS)N)�minutesz
Etc/GMT%+d)r�_offset�zone)�self�offsetr>r
r
r�__init__�s
zFixedOffsetTimezone.__init__cC�|jS�N�rh�rir
r
r�__str__��zFixedOffsetTimezone.__str__cCsd|j|jfS)Nz<FixedOffset "%s" %s>)rhrgror
r
r�__repr__�szFixedOffsetTimezone.__repr__cCrlrm)rg�ri�dtr
r
r�	utcoffset�rqzFixedOffsetTimezone.utcoffsetcCrlrmrnrsr
r
r�tzname�rqzFixedOffsetTimezone.tznamecCstSrm)�ZEROrsr
r
r�dst�szFixedOffsetTimezone.dstrm)
rWrXrY�__doc__rkrprrrurvrxr
r
r
rre�s
re)r)r\rErE)'ryr�collections�datetimerrrMr3�textwrap�
babel._compatrr�pytz�_pytz�babelr�object�missingrrZ�VERBOSErr*r5r@rUrVrd�OrderedDict�odictre�utc�UTC�LOCALTZ�
get_localzone�	STDOFFSET�	DSTOFFSET�DSTDIFFrwr
r
r
r�<module>s@
�2�
 A


Hacker Blog, Shell İndir, Sql İnjection, XSS Attacks, LFI Attacks, Social Hacking, Exploit Bot, Proxy Tools, Web Shell, PHP Shell, Alfa Shell İndir, Hacking Training Set, DDoS Script, Denial Of Service, Botnet, RFI Attacks, Encryption
Telegram @BIBIL_0DAY