HEX
Server: Apache
System: Linux server2.voipitup.com.au 4.18.0-553.104.1.lve.el8.x86_64 #1 SMP Tue Feb 10 20:07:30 UTC 2026 x86_64
User: posscale (1027)
PHP: 8.2.29
Disabled: exec,passthru,shell_exec,system
Upload Files
File: //lib64/python3.6/site-packages/zmq/eventloop/minitornado/__pycache__/util.cpython-36.pyc
3

VS�_	�@s�dZddlmZmZmZmZddlZeded��sDdd�Z	e
Ze
Zndd�Z	e
ZeZd	d
�ZeZejdkrted�ned
�dd�ZGdd�de�Zdd�ZdS)a�Miscellaneous utility functions and classes.

This module is used internally by Tornado.  It is not necessarily expected
that the functions and classes defined here will be useful to other
applications, but they are documented here in case they are.

The one public-facing part of this module is the `Configurable` class
and its `~Configurable.configure` method, which becomes a part of the
interface of its subclasses, including `.AsyncHTTPClient`, `.IOLoop`,
and `.Resolver`.
�)�absolute_import�division�print_function�with_statementN��cCs|S)N�)�srr�/usr/lib64/python3.6/util.py�usrcCs
|jd�S)NZunicode_escape)�decode)r	rrr
rscCs�t|t�rttk	r|jd�}|jd�dkr6t|dd�S|jd�}tdj|dd��dd|dgd�}yt||d	�St	k
r�t
d|d
��YnXdS)aImports an object by name.

    import_object('x') is equivalent to 'import x'.
    import_object('x.y.z') is equivalent to 'from x.y import z'.

    >>> import tornado.escape
    >>> import_object('tornado.escape') is tornado.escape
    True
    >>> import_object('tornado.escape.utf8') is tornado.escape.utf8
    True
    >>> import_object('tornado') is tornado
    True
    >>> import_object('tornado.missing_module')
    Traceback (most recent call last):
        ...
    ImportError: No module named missing_module
    zutf-8�.rN�zNo module named %s���rrr)�
isinstance�unicode_type�str�encode�count�
__import__�split�join�getattr�AttributeError�ImportError)�name�parts�objrrr
�
import_object%s

$r�z�
def raise_exc_info(exc_info):
    raise exc_info[1].with_traceback(exc_info[2])

def exec_in(code, glob, loc=None):
    if isinstance(code, str):
        code = compile(code, '<string>', 'exec', dont_inherit=True)
    exec(code, glob, loc)
ah
def raise_exc_info(exc_info):
    raise exc_info[0], exc_info[1], exc_info[2]

def exec_in(code, glob, loc=None):
    if isinstance(code, basestring):
        # exec(string) inherits the caller's future imports; compile
        # the string first to prevent that.
        code = compile(code, '<string>', 'exec', dont_inherit=True)
    exec code in glob, loc
cCs(t|d�r|jS|jr |jdSdSdS)aLProvides the errno from an Exception object.

    There are cases that the errno attribute was not set so we pull
    the errno out of the args but if someone instantiates an Exception
    without any args you will get a tuple error. So this function
    abstracts all that behavior to give you a safe way to get the
    errno.
    �errnorN)�hasattrr �args)�errr
�errno_from_exceptionas



r$csxeZdZdZdZdZ�fdd�Zedd��Zedd��Z	d	d
�Z
edd��Zed
d��Zedd��Z
edd��Z�ZS)�Configurablea�Base class for configurable interfaces.

    A configurable interface is an (abstract) class whose constructor
    acts as a factory function for one of its implementation subclasses.
    The implementation subclass as well as optional keyword arguments to
    its initializer can be set globally at runtime with `configure`.

    By using the constructor as the factory method, the interface
    looks like a normal class, `isinstance` works as usual, etc.  This
    pattern is most useful when the choice of implementation is likely
    to be a global decision (e.g. when `~select.epoll` is available,
    always use it instead of `~select.select`), or when a
    previously-monolithic class has been split into specialized
    subclasses.

    Configurable subclasses must define the class methods
    `configurable_base` and `configurable_default`, and use the instance
    method `initialize` instead of ``__init__``.
    Ncs^|j�}i}||kr0|j�}|jr4|j|j�n|}|j|�tt|�j|�}|j||�|S)N)�configurable_base�configured_class�_Configurable__impl_kwargs�update�superr%�__new__�
initialize)�clsr"�kwargs�baseZinit_kwargs�impl�instance)�	__class__rr
r+�s
zConfigurable.__new__cCs
t��dS)z�Returns the base class of a configurable hierarchy.

        This will normally return the class in which it is defined.
        (which is *not* necessarily the same as the cls classmethod parameter).
        N)�NotImplementedError)r-rrr
r&�szConfigurable.configurable_basecCs
t��dS)zBReturns the implementation class to be used if none is configured.N)r3)r-rrr
�configurable_default�sz!Configurable.configurable_defaultcCsdS)z�Initialize a `Configurable` subclass instance.

        Configurable classes should use `initialize` instead of ``__init__``.

        .. versionchanged:: 4.2
           Now accepts positional arguments in addition to keyword arguments.
        Nr)�selfrrr
r,�szConfigurable.initializecKsN|j�}t|ttf�rt|�}|dk	r>t||�r>td|��||_||_dS)z�Sets the class to use when the base class is instantiated.

        Keyword arguments will be saved and added to the arguments passed
        to the constructor.  This can be used to set global defaults for
        some parameters.
        NzInvalid subclass of %s)	r&rr�bytesr�
issubclass�
ValueError�_Configurable__impl_classr()r-r0r.r/rrr
�	configure�szConfigurable.configurecCs"|j�}|jdkr|j�|_|jS)z'Returns the currently configured class.N)r&r9r4)r-r/rrr
r'�s

zConfigurable.configured_classcCs|j�}|j|jfS)N)r&r9r()r-r/rrr
�_save_configuration�sz Configurable._save_configurationcCs |j�}|d|_|d|_dS)Nrr)r&r9r()r-Zsavedr/rrr
�_restore_configuration�s
z#Configurable._restore_configuration)�__name__�
__module__�__qualname__�__doc__r9r(r+�classmethodr&r4r,r:r'r;r<�
__classcell__rr)r2r
r%ss		r%cCs&|j|j|jdddtd�S)z<Equivalent to td.total_seconds() (introduced in python 2.7).�i�
�i@Bi@B)ZmicrosecondsZsecondsZdays�float)Ztdrrr
�timedelta_to_seconds�srG)r)r@Z
__future__rrrr�sysr�typerrrZbasestring_typeZunicodeZ
basestringrr6Z
bytes_type�version_info�execr$�objectr%rGrrrr
�<module>s&"

c