OwlCyberSecurity - MANAGER
Edit File: __init__.cpython-37.pyc
B �����A�[eO���������������-���@���s���d�Z�ddlZddlZddlZddlZddlZddlZejd�dkZejdd��dkZ ejdd��dkZ ejd�dkZejdd��dkZejdd��dkZ eed �Zd d��Zdd ��Zer�dd��Zdd��Zdd��ZefZefZefZeZeZn8dd��Zdd��Zdd��ZefZeefZeej fZe!ZeZe�r2dd��Z"ndd��Z"de"_�e�rfdzdd�Z#d{dd�Z$d|d d!�Z%nd}d"d�Z#d~d#d�Z$dd%d!�Z%d&e#_�e�r�d'd(��Z&d)d*��Z'd+d,��Z(d-d.��Z)n ddl*Z*e*j+Z&e*j,Z'e*j-Z(e*j.Z)d�d0d1�Z/d2d3��Z0d4d5��Z1d6d7��Z2d8d9��Z3d:d;��Z4d<d=��Z5d>d?��Z6d@dA��Z7dBdC��Z8dDdE��Z9e�rRdFdG��Z:d�dHdI�Z;e<fdJdK�Z=ndLdG��Z:e>dM�?����dNe=_�e;Z@dOdP��ZAe�r�dQdR��ZBndSdR��ZBdTdU��ZCdVdW��ZDeZEeZFdXdY��ZGdZd[��ZHd\d]��ZId^d_��ZJd`da��ZKe�r�ddlLZLeMeLdb�ZNn d�dcdd�ZNdedf��ZOd�dgdh�ZPy eQj3�W�n&�eRk �r6���didj��ZSdkdl��ZTY�nX�dmdj��ZSdndl��ZTe�rXdodp��ZUndqdp��ZUdrdsdtdudhd?ddddUdpdddvdAdPdWd[d1d_d]dYd9d;d=d.dldjd,d(d*dadwdxddfddIdKdyd!dd3d5d7d g-ZVdS�)�a;�� A selection of cross-compatible functions for Python 2 and 3. This module exports useful functions for 2/3 compatible code: * bind_method: binds functions to classes * ``native_str_to_bytes`` and ``bytes_to_native_str`` * ``native_str``: always equal to the native platform string object (because this may be shadowed by imports from future.builtins) * lists: lrange(), lmap(), lzip(), lfilter() * iterable method compatibility: - iteritems, iterkeys, itervalues - viewitems, viewkeys, viewvalues These use the original method if available, otherwise they use items, keys, values. * types: * text_type: unicode in Python 2, str in Python 3 * binary_type: str in Python 2, bytes in Python 3 * string_types: basestring in Python 2, str in Python 3 * bchr(c): Take an integer and make a 1-character byte string * bord(c) Take the result of indexing on a byte string and make an integer * tobytes(s) Take a text string, a byte string, or a sequence of characters taken from a byte string, and make a byte string. * raise_from() * raise_with_traceback() This module also defines these decorators: * ``python_2_unicode_compatible`` * ``with_metaclass`` * ``implements_iterator`` Some of the functions in this module come from the following sources: * Jinja2 (BSD licensed: see https://github.com/mitsuhiko/jinja2/blob/master/LICENSE) * Pandas compatibility module pandas.compat * six.py by Benjamin Peterson * Django �����N��������)r�������)r�������)r���r���)r�������Zpypy_translation_infoc�������������C���s���t�s|�j|�_dd��|�_|�S�)u��� A decorator that defines __unicode__ and __str__ methods under Python 2. Under Python 3, this decorator is a no-op. To support Python 2 and 3 with a single code base, define a __str__ method returning unicode text and apply this decorator to the class, like this:: >>> from future.utils import python_2_unicode_compatible >>> @python_2_unicode_compatible ... class MyClass(object): ... def __str__(self): ... return u'Unicode string: 孔子' >>> a = MyClass() Then, after this import: >>> from future.builtins import str the following is ``True`` on both Python 3 and 2:: >>> str(a) == a.encode('utf-8').decode('utf-8') True and, on a Unicode-enabled terminal with the right fonts, these both print the Chinese characters for Confucius:: >>> print(a) >>> print(str(a)) The implementation comes from django.utils.encoding. c�������������S���s���|������d�S�)Nzutf-8)�__unicode__�encode)�self��r ����F/opt/alt/python37/lib/python3.7/site-packages/future/utils/__init__.py�<lambda>h��������z-python_2_unicode_compatible.<locals>.<lambda>)�PY3�__str__r���)�clsr ���r ���r����python_2_unicode_compatibleC���s����# r���c����������������s"���G����fdd�d��}|ddi��S�)a��� Function from jinja2/_compat.py. License: BSD. Use it like this:: class BaseForm(object): pass class FormType(type): pass class Form(with_metaclass(FormType, BaseForm)): pass This requires a bit of explanation: the basic idea is to make a dummy metaclass for one level of class instantiation that replaces itself with the actual metaclass. Because of internal type checks we also need to make sure that we downgrade the custom metaclass for one level to something closer to type (that's why __call__ and __init__ comes back from type etc.). This has the advantage over six.with_metaclass of not introducing dummy classes into the final MRO. c�������������������s&���e�Zd�ZejZejZ���fdd�ZdS�)z!with_metaclass.<locals>.metaclassc����������������s$���|d�krt��|�|d|�S��|��|�S�)Nr ���)�type�__new__)r����name� this_bases�d)�bases�metar ���r���r�������s����z)with_metaclass.<locals>.metaclass.__new__N)�__name__� __module__�__qualname__r����__call__�__init__r���r ���)r���r���r ���r���� metaclass����s���r����temporary_classNr ���)r���r���r���r ���)r���r���r����with_metaclassl���s����r ���c�������������C���s ���t�|�g�S�)N)�bytes)�sr ���r ���r����bchr����s����r#���c�������������C���s ���t�|�t�rt|�d�S�t|��S�d�S�)Nzlatin-1)� isinstance�strr!���)r"���r ���r ���r����bstr����s���� r&���c�������������C���s���|�S�)Nr ���)r"���r ���r ���r����bord����s����r'���c�������������C���s���t�|��S�)N)�chr)r"���r ���r ���r���r#�������s����c�������������C���s���t�|��S�)N)r%���)r"���r ���r ���r���r&�������s����c�������������C���s���t�|��S�)N)�ord)r"���r ���r ���r���r'�������s����c�������������C���s.���t�|�t�r|�S�t�|�t�r"|��d�S�t|��S�d�S�)Nzlatin-1)r$���r!���r%���r���)r"���r ���r ���r����tobytes����s ���� r*���c�������������C���s"���t�|�t�r|��d�S�d�|��S�d�S�)Nzlatin-1��)r$����unicoder����join)r"���r ���r ���r���r*�������s���� zS Encodes to latin-1 (where the first 256 chars are the same as ASCII.) �utf-8c�������������C���s ���|���|�S�)N)r���)r"����encodingr ���r ���r����native_str_to_bytes����s����r0���c�������������C���s ���|���|�S�)N)�decode)�br/���r ���r ���r����bytes_to_native_str����s����r3���c�������������C���s���|�S�)Nr ���)�tr/���r ���r ���r����text_to_native_str����s����r5���c�������������C���s���ddl�m}�||��S�)Nr���)�newbytes)Zfuture.typesr6���)r"���r/���r6���r ���r ���r���r0�������s����c�������������C���s���t�|��S�)N)�native)r2���r/���r ���r ���r���r3�������s�����asciic�������������C���s���t�|���|�S�)z} Use this to create a Py2 native string when "from __future__ import unicode_literals" is in effect. )r,���r���)r4���r/���r ���r ���r���r5�������s����zu On Py3, returns an encoded string. On Py2, returns a newbytes type, ignoring the ``encoding`` argument. c��������������O���s���t�t|�|��S�)N)�list�range)�args�kwargsr ���r ���r����lrange����s����r=���c��������������O���s���t�t|�|��S�)N)r9����zip)r;���r<���r ���r ���r����lzip����s����r?���c��������������O���s���t�t|�|��S�)N)r9����map)r;���r<���r ���r ���r����lmap����s����rA���c��������������O���s���t�t|�|��S�)N)r9����filter)r;���r<���r ���r ���r����lfilter����s����rC���Fc�������������C���sL���|rt�dd��|��d�D���S�tr(|����S�ddl}|�d�}t|�|���S�dS�)zE A function equivalent to the str.isidentifier method on Py3 c�������������s���s���|�]}t�|�V��qd�S�)N)�isidentifier)�.0�ar ���r ���r���� <genexpr>��s����zisidentifier.<locals>.<genexpr>�.r���Nz[a-zA-Z_][a-zA-Z0-9_]*$)�all�splitr���rD����re�compile�bool�match)r"���ZdottedrK���Z_name_rer ���r ���r���rD�������s���� rD���c�������������K���s ���t�|�dd�}|s|�j}|f�|�S�)z� Function for iterating over dictionary items with the same set-like behaviour on Py2.7 as on Py3. Passes kwargs to method.� viewitemsN)�getattr�items)�objr<����funcr ���r ���r���rO��� ��s����rO���c�������������K���s ���t�|�dd�}|s|�j}|f�|�S�)z� Function for iterating over dictionary keys with the same set-like behaviour on Py2.7 as on Py3. Passes kwargs to method.�viewkeysN)rP����keys)rR���r<���rS���r ���r ���r���rT�����s����rT���c�������������K���s ���t�|�dd�}|s|�j}|f�|�S�)z� Function for iterating over dictionary values with the same set-like behaviour on Py2.7 as on Py3. Passes kwargs to method.� viewvaluesN)rP����values)rR���r<���rS���r ���r ���r���rV���"��s����rV���c�������������K���s ���t�|�dd�}|s|�j}|f�|�S�)zsUse this only if compatibility with Python versions before 2.7 is required. Otherwise, prefer viewitems(). � iteritemsN)rP���rQ���)rR���r<���rS���r ���r ���r���rX���.��s����rX���c�������������K���s ���t�|�dd�}|s|�j}|f�|�S�)zrUse this only if compatibility with Python versions before 2.7 is required. Otherwise, prefer viewkeys(). �iterkeysN)rP���rU���)rR���r<���rS���r ���r ���r���rY���8��s����rY���c�������������K���s ���t�|�dd�}|s|�j}|f�|�S�)ztUse this only if compatibility with Python versions before 2.7 is required. Otherwise, prefer viewvalues(). � itervaluesN)rP���rW���)rR���r<���rS���r ���r ���r���rZ���B��s����rZ���c�������������C���s,���t�st|�|t�|d|����nt|�||��dS�)a/��Bind a method to class, python 2 and python 3 compatible. Parameters ---------- cls : type class to receive bound method name : basestring name of method on class instance func : function function to be bound as method Returns ------- None N)r����setattr�types� MethodType)r���r���rS���r ���r ���r����bind_methodL��s����r^���c���������������C���s���t����d�S�)N����)�sys�exc_infor ���r ���r ���r����getexceptiond��s����rb���c��������������C���s(���t����d�}�|�d�j}|�d�j}||fS�)zr Returns the globals and locals of the calling frame. Is there an alternative to frame hacking here? r���r���)�inspect�stack� f_globals�f_locals)Zcaller_frame� myglobals�mylocalsr ���r ���r����_get_caller_globals_and_localsh��s���� ri���c�������������C���s0���t�|��}|�d�r(|�d�r(|dd��S�|S�dS�)zA Returns the string without any initial or final quotes. �'r_������N)�repr� startswith�endswith)Zmystring�rr ���r ���r����_repr_stript��s����rp���c�������������C���s6���t���\}}|���}|�|d<�||d<�d}t|||��dS�)zn Equivalent to: raise EXCEPTION from CAUSE on Python 3. (See PEP 3134). Z__python_future_raise_from_excZ __python_future_raise_from_causezJraise __python_future_raise_from_exc from __python_future_raise_from_causeN)ri����copy�exec)�exc�causerg���rh���Zexecstrr ���r ���r���� raise_from���s���� ru���c�������������C���sL���|dk rt�|�t�rtd��|dk r,|�|�}n|�}|j|k rD|�|��|�dS�)z� A function that matches the Python 2.x ``raise`` statement. This allows re-raising exceptions with the cls value and traceback on Python 2 and 3. Nz0instance exception may not have a separate value)r$���� Exception� TypeError� __traceback__�with_traceback)�tp�value�tbrs���r ���r ���r����raise_���s���� r}���c�������������C���s$���|t�krt���\}}}|��|��d�S�)N)�Ellipsisr`���ra���ry���)rs���� traceback�_r ���r ���r����raise_with_traceback���s����r����c�������������C���s����t�|�t�rt|�t�r|���}n|�}d|_t�|t�rJt|t�rJ|��|_d|_n6|dkr`d|_d|_n t�|t�rx||_d|_ntd��t� ��d�|_ |�dS�)zn Equivalent to: raise EXCEPTION from CAUSE on Python 3. (See PEP 3134). FTNz/exception causes must derive from BaseExceptionr_���)r$���r���� issubclassrv����__suppress_context__� __cause__� BaseExceptionrw���r`���ra����__context__)rs���rt����er ���r ���r���ru������s ���� z� def raise_(tp, value=None, tb=None): raise tp, value, tb def raise_with_traceback(exc, traceback=Ellipsis): if traceback == Ellipsis: _, _, traceback = sys.exc_info() raise exc, None, traceback zjRaise exception with existing traceback. If traceback is not passed, uses sys.exc_info() to get traceback.c�������������C���s���t�r|�S�|�j|�_|�`|�S�dS�)a�� From jinja2/_compat.py. License: BSD. Use as a decorator like this:: @implements_iterator class UppercasingIterator(object): def __init__(self, iterable): self._iter = iter(iterable) def __iter__(self): return self def __next__(self): return next(self._iter).upper() N)r����__next__�next)r���r ���r ���r����implements_iterator���s ����r����c�������������C���s���|�j�S�)N)r����)�xr ���r ���r���r������r ���r���c�������������C���s���|�j�S�)N)r����)r����r ���r ���r���r������r ���c�������������C���s$���t�r|�S�t|�t�r|��d�S�|�S�d�S�)Nzutf-8)r���r$���r,���r���)�filenamer ���r ���r����encode_filename���s ���� r����c�������������C���s ���t�|�d�odt|��kpt�|�d�S�)a�� Python 2.7 has both new-style and old-style classes. Old-style classes can be pesky in some circumstances, such as when using inheritance. Use this function to test for whether a class is new-style. (Python 3 only has new-style classes.) � __class__�__dict__� __slots__)�hasattr�dir)r���r ���r ���r����is_new_style��s����r����c�������������C���s���t�|�td��S�)z Deprecated. Use:: >>> isinstance(obj, str) after this import: >>> from future.builtins import str r+���)r$���r���)rR���r ���r ���r����istext��s����r����c�������������C���s���t�|�td��S�)z� Deprecated. Use:: >>> isinstance(obj, bytes) after this import: >>> from future.builtins import bytes r ���)r$���r���)rR���r ���r ���r����isbytes��s����r����c�������������C���s���ddl�m}�t|��|kS�)z� Equivalent to the result of ``isinstance(obj, newbytes)`` were ``__instancecheck__`` not overridden on the newbytes subclass. In other words, it is REALLY a newbytes instance, not a Py2 native str object? r���)r6���)�future.types.newbytesr6���r���)rR���r6���r ���r ���r���� isnewbytes)��s���� r����c�������������C���s���t�|�tj�S�)a_�� Deprecated. Tests whether an object is a Py3 ``int`` or either a Py2 ``int`` or ``long``. Instead of using this function, you can use: >>> from future.builtins import int >>> isinstance(obj, int) The following idiom is equivalent: >>> from numbers import Integral >>> isinstance(obj, Integral) )r$����numbers�Integral)rR���r ���r ���r����isint6��s����r����c�������������C���s���t�|�d�r|����S�|�S�dS�)aO�� On Py3, this is a no-op: native(obj) -> obj On Py2, returns the corresponding native Py2 types that are superclasses for backported objects from Py3: >>> from builtins import str, bytes, int >>> native(str(u'ABC')) u'ABC' >>> type(native(str(u'ABC'))) unicode >>> native(bytes(b'ABC')) b'ABC' >>> type(native(bytes(b'ABC'))) bytes >>> native(int(10**20)) 100000000000000000000L >>> type(native(int(10**20))) long Existing native types on Py2 will be returned unchanged: >>> type(native(u'ABC')) unicode � __native__N)r����r����)rR���r ���r ���r���r7���I��s���� r7���rr���c�������������C���sB���|dkr*t��d�}|j}|dkr&|j}~n|dkr6|}td��dS�)zExecute code in a namespace.Nr_���zexec code in globs, locs)r`���� _getframere���rf���rr���)�codeZglobsZlocs�framer ���r ���r����exec_q��s���� r����c�������������C���s,���t�|�tj�r t�|tj�r |�|�S�|�|�S�dS�)z� DEPRECATED: import ``old_div`` from ``past.utils`` instead. Equivalent to ``a / b`` on Python 2 without ``from __future__ import division``. TODO: generalize this to other objects (like arrays etc.) N)r$���r����r����)rF���r2���r ���r ���r����old_div��s���� r����c����������������s ���t�rdd��S���fdd�}|S�dS�)a~�� A decorator to turn a function or method call that returns text, i.e. unicode, into one that returns a native platform str. Use it as a decorator like this:: from __future__ import unicode_literals class MyClass(object): @as_native_str(encoding='ascii') def __repr__(self): return next(self._iter).upper() c�������������S���s���|�S�)Nr ���)�fr ���r ���r���r������r ���zas_native_str.<locals>.<lambda>c����������������s���t��������fdd��}|S�)Nc�����������������s����|�|�j���d�S�)N)r/���)r���)r;���r<���)r/���r����r ���r����wrapper���s����z/as_native_str.<locals>.encoder.<locals>.wrapper)� functools�wraps)r����r����)r/���)r����r����encoder���s����zas_native_str.<locals>.encoderN)r���)r/���r����r ���)r/���r���� as_native_str���s����r����c�������������C���s���t�|�����S�)N)r9���rW���)r���r ���r ���r���� listvalues���s����r����c�������������C���s���t�|�����S�)N)r9���rQ���)r���r ���r ���r���� listitems���s����r����c�������������C���s���|�����S�)N)rW���)r���r ���r ���r���r�������s����c�������������C���s���|�����S�)N)rQ���)r���r ���r ���r���r�������s����c�������������C���s���|�S�)Nr ���)rR���r ���r ���r����ensure_new_type���s����r����c�������������C���s����ddl�m}�ddlm}�ddlm}�ddlm}�tt |���}t |t|���r�|tkrZ||��S�|tkrj||��S�|t krz||��S�|tkr�||��S�|tkr�||��S�|�S�nt|��||gks�t�|�S�d�S�)Nr���)r6���)�newstr)�newint)�newdict)r����r6���Zfuture.types.newstrr����Zfuture.types.newintr����Zfuture.types.newdictr����r���r7���r����r%���r,����int�long�dict�AssertionError)rR���r6���r����r����r����Znative_typer ���r ���r���r�������s&�����PY2�PY26r����PYPY�get_next�native_bytes� native_str�reraise)r.���)r.���)N)N)N)r8���)F)NN)NN)r.���)W�__doc__r\���r`���r����r����rq���rc����version_infor���Z PY35_PLUSZ PY36_PLUSr����r����ZPY27r����r����r���r ���r#���r&���r'���r%����string_typesr����Z integer_typesr���Zclass_typesZ text_typer!���Zbinary_type� basestringr����Z ClassTyper,���r*���r0���r3���r5���r=���r?���rA���rC���Z__builtin__r:���r>���r@���rB���rD���rO���rT���rV���rX���rY���rZ���r^���rb���ri���rp���ru���r}���r~���r����rr����stripr����r����r����r����r����r����r����r����r����r����r����r7����builtinsrP���r����r����r����r�����AttributeErrorr����r����r�����__all__r ���r ���r ���r����<module>0���s���� )$ " $