o
    y¬´\yÏ  ã                   @   s~  d Z ddlmZ ddlZddlZddlZddlmZ ddlmZ ddlm	Z	 ddlm
Z
 dd	lmZ dd
lmZ ddlmZ ddlmZ ddlmZ i Zdd„ Zdd„ Ze d¡Ze d¡Ze d¡ZG dd„ deƒZG dd„ de
jƒZG dd„ deƒZ	d+dd„Zeƒ ZG dd„ deƒZ G dd „ d eƒZ!G d!d"„ d"eƒZ"G d#d$„ d$eƒZ#G d%d&„ d&eƒZ$G d'd(„ d(eƒZ%G d)d*„ d*eƒZ&dS ),a{  Connection pooling for DB-API connections.

Provides a number of connection pool implementations for a variety of
usage scenarios and thread behavior requirements imposed by the
application, DB-API or database itself.

Also provides a DB-API 2.0 connection proxying mechanism allowing
regular DB-API connect() methods to be transparently managed by a
SQLAlchemy connection pool.
é    )ÚdequeNé   )Úevent)Úexc)Ú
interfaces)Úlog)Úutil)Úchop_traceback)Úmemoized_property)Úqueue)Ú	threadingc              
   K   s6   zt |  W S  ty   t  | t| fi |¤Ž¡ Y S w )aH  Return a proxy for a DB-API module that automatically
    pools connections.

    Given a DB-API 2.0 module and pool management parameters, returns
    a proxy for the module that will automatically pool connections,
    creating new connection pools for each distinct set of connection
    arguments sent to the decorated module's connect() function.

    :param module: a DB-API 2.0 database module

    :param poolclass: the class used by the pool module to provide
      pooling.  Defaults to :class:`.QueuePool`.

    :param \**params: will be passed through to *poolclass*

    )ÚproxiesÚKeyErrorÚ
setdefaultÚ_DBProxy)ÚmoduleÚparams© r   úA/var/www/html/env/lib/python3.10/site-packages/sqlalchemy/pool.pyÚmanage&   s
   
ÿr   c                  C   s"   t  ¡ D ]} |  ¡  qt  ¡  dS )zYRemove all current DB-API 2.0 managers.

    All pools and connections are disposed.
    N)r   ÚvaluesÚcloseÚclear)Úmanagerr   r   r   Úclear_managers=   s   
r   Úreset_rollbackÚreset_commitÚ
reset_nonec                   @   s0   e Zd ZdZdd„ Zdd„ Zdd„ Zdd	„ Zd
S )Ú_ConnDialectzêpartial implementation of :class:`.Dialect`
    which provides DBAPI connection methods.

    When a :class:`.Pool` is combined with an :class:`.Engine`,
    the :class:`.Engine` replaces this with its own
    :class:`.Dialect`.

    c                 C   ó   |  ¡  d S ©N)Úrollback©ÚselfÚdbapi_connectionr   r   r   Údo_rollbackX   ó   z_ConnDialect.do_rollbackc                 C   r   r    )Úcommitr"   r   r   r   Ú	do_commit[   r&   z_ConnDialect.do_commitc                 C   r   r    ©r   r"   r   r   r   Údo_close^   r&   z_ConnDialect.do_closec                 C   s   t dƒ‚)NzJThe ping feature requires that a dialect is passed to the connection pool.©ÚNotImplementedErrorr"   r   r   r   Údo_pinga   s   ÿz_ConnDialect.do_pingN)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r%   r(   r*   r-   r   r   r   r   r   M   s    	r   c                   @   sÄ   e Zd ZdZeƒ Z										d'dd„Zedd	„ ƒZej	d
d	„ ƒZdd„ Z
dd„ Ze dd¡dd„ ƒZdd„ Zdd„ Zd(dd„Zdd„ Zdd„ Zdd„ Zdd „ Zd!d"„ Zd#d$„ Zd%d&„ ZdS ))ÚPoolz)Abstract base class for connection pools.éÿÿÿÿNFTc                 C   s  |r	| | _ | _nd| _tj| |d� t ¡ | _|| _|| _d| _	|| _
|
| _|ddtfv r2t| _n|dddtfv r>t| _n|dtfv rHt| _nt d	| ¡‚|| _|r\| jj|dd
� |	ra|	| _|rq|D ]\}}t | ||¡ qe|r‚t d¡ |D ]	}|  |¡ qzdS dS )a^  
        Construct a Pool.

        :param creator: a callable function that returns a DB-API
          connection object.  The function will be called with
          parameters.

        :param recycle: If set to a value other than -1, number of
          seconds between connection recycling, which means upon
          checkout, if this timeout is surpassed the connection will be
          closed and replaced with a newly opened connection. Defaults to -1.

        :param logging_name:  String identifier which will be used within
          the "name" field of logging records generated within the
          "sqlalchemy.pool" logger. Defaults to a hexstring of the object's
          id.

        :param echo: if True, the connection pool will log
         informational output such as when connections are invalidated
         as well as when connections are recycled to the default log handler,
         which defaults to ``sys.stdout`` for output..   If set to the string
         ``"debug"``, the logging will include pool checkouts and checkins.

         The :paramref:`.Pool.echo` parameter can also be set from the
         :func:`.create_engine` call by using the
         :paramref:`.create_engine.echo_pool` parameter.

         .. seealso::

             :ref:`dbengine_logging` - further detail on how to configure
             logging.

        :param use_threadlocal: If set to True, repeated calls to
          :meth:`connect` within the same application thread will be
          guaranteed to return the same connection object, if one has
          already been retrieved from the pool and has not been
          returned yet.  Offers a slight performance advantage at the
          cost of individual transactions by default.  The
          :meth:`.Pool.unique_connection` method is provided to return
          a consistently unique connection to bypass this behavior
          when the flag is set.

          .. warning::  The :paramref:`.Pool.use_threadlocal` flag
             **does not affect the behavior** of :meth:`.Engine.connect`.
             :meth:`.Engine.connect` makes use of the
             :meth:`.Pool.unique_connection` method which **does not use thread
             local context**.  To produce a :class:`.Connection` which refers
             to the :meth:`.Pool.connect` method, use
             :meth:`.Engine.contextual_connect`.

             Note that other SQLAlchemy connectivity systems such as
             :meth:`.Engine.execute` as well as the orm
             :class:`.Session` make use of
             :meth:`.Engine.contextual_connect` internally, so these functions
             are compatible with the :paramref:`.Pool.use_threadlocal` setting.

          .. seealso::

            :ref:`threadlocal_strategy` - contains detail on the
            "threadlocal" engine strategy, which provides a more comprehensive
            approach to "threadlocal" connectivity for the specific
            use case of using :class:`.Engine` and :class:`.Connection` objects
            directly.

        :param reset_on_return: Determine steps to take on
          connections as they are returned to the pool.
          reset_on_return can have any of these values:

          * ``"rollback"`` - call rollback() on the connection,
            to release locks and transaction resources.
            This is the default value.  The vast majority
            of use cases should leave this value set.
          * ``True`` - same as 'rollback', this is here for
            backwards compatibility.
          * ``"commit"`` - call commit() on the connection,
            to release locks and transaction resources.
            A commit here may be desirable for databases that
            cache query plans if a commit is emitted,
            such as Microsoft SQL Server.  However, this
            value is more dangerous than 'rollback' because
            any data changes present on the transaction
            are committed unconditionally.
          * ``None`` - don't do anything on the connection.
            This setting should generally only be made on a database
            that has no transaction support at all,
            namely MySQL MyISAM; when used on this backend, performance
            can be improved as the "rollback" call is still expensive on
            MySQL.   It is **strongly recommended** that this setting not be
            used for transaction-supporting databases in conjunction with
            a persistent pool such as :class:`.QueuePool`, as it opens
            the possibility for connections still in a transaction to be
            idle in the pool.   The setting may be appropriate in the
            case of :class:`.NullPool` or special circumstances where
            the connection pool in use is not being used to maintain connection
            lifecycle.

          * ``False`` - same as None, this is here for
            backwards compatibility.

        :param events: a list of 2-tuples, each of the form
         ``(callable, target)`` which will be passed to :func:`.event.listen`
         upon construction.   Provided here so that event listeners
         can be assigned via :func:`.create_engine` before dialect-level
         listeners are applied.

        :param listeners: A list of :class:`.PoolListener`-like objects or
          dictionaries of callables that receive events when DB-API
          connections are created, checked out and checked in to the
          pool.

          .. deprecated:: 0.7

                :class:`.PoolListener` is deprecated in favor of the
                :class:`.PoolEvents` listener interface.  The
                :paramref:`.Pool.listeners` parameter will be removed in a
                future release.

        :param dialect: a :class:`.Dialect` that will handle the job
         of calling rollback(), close(), or commit() on DBAPI connections.
         If omitted, a built-in "stub" dialect is used.   Applications that
         make use of :func:`~.create_engine` should not use this parameter
         as it is handled by the engine creation strategy.

         .. versionadded:: 1.1 - ``dialect`` is now a public parameter
            to the :class:`.Pool`.

        :param pre_ping: if True, the pool will emit a "ping" (typically
         "SELECT 1", but is dialect-specific) on the connection
         upon checkout, to test if the connection is alive or not.   If not,
         the connection is transparently re-connected and upon success, all
         other pooled connections established prior to that timestamp are
         invalidated.     Requires that a dialect is passed as well to
         interpret the disconnection error.

         .. versionadded:: 1.2

        N)Úechoflagr   r!   TÚnoneFr'   z'Invalid value for 'reset_on_return': %r)Úonly_propagatez³The 'listeners' argument to Pool and create_engine() is deprecated and will be removed in a future release. Please refer to the PoolEvents class in conjunction with event.listen())Úlogging_nameÚ_orig_logging_namer   Úinstance_loggerr   ÚlocalÚ_threadconnsÚ_creatorÚ_recycleÚ_invalidate_timeÚ_use_threadlocalÚ	_pre_pingr   Ú_reset_on_returnr   r   r   ÚArgumentErrorÚechoÚdispatchÚ_updateÚ_dialectr   Úlistenr   Úwarn_deprecatedÚadd_listener)r#   ÚcreatorÚrecyclerC   Úuse_threadlocalr7   Úreset_on_returnÚ	listenersÚeventsÚdialectÚpre_pingÚ	_dispatchÚfnÚtargetÚlr   r   r   Ú__init__n   sH    
ÿÿøzPool.__init__c                 C   s
   | j d S ©Nr<   )Ú__dict__©r#   r   r   r   r<   /  ó   
zPool._creatorc                 C   s   || j d< |  |¡| _d S rW   )rX   Ú_should_wrap_creatorÚ_invoke_creator)r#   rJ   r   r   r   r<   3  s   
c                    s–   z
t j| jdd�}W n ty   ‡ fdd„ Y S w |d dur&t|d ƒp'd}t|d ƒ| }|d |d fdgd	fkr?ˆ S |d
krEˆ S ‡ fdd„S )zlDetect if creator accepts a single argument, or is sent
        as a legacy style no-arg function.

        T)Úno_selfc                    ó   ˆ ƒ S r    r   ©Úcrec©rJ   r   r   Ú<lambda>A  ó    z+Pool._should_wrap_creator.<locals>.<lambda>é   Nr   Úconnection_recordr    r   c                    r^   r    r   r_   ra   r   r   rb   P  rc   )r   Úget_callable_argspecr<   Ú	TypeErrorÚlen)r#   rJ   ÚargspecÚ	defaultedÚpositionalsr   ra   r   r[   8  s   ÿzPool._should_wrap_creatorc                 C   sH   | j  d|¡ z	| j |¡ W d S  ty#   | j jd|dd� Y d S w )NzClosing connection %rzException closing connection %rT©Úexc_info)ÚloggerÚdebugrF   r*   Ú	ExceptionÚerror)r#   Ú
connectionr   r   r   Ú_close_connectionR  s   ÿÿzPool._close_connectionz0.7z•The :meth:`.Pool.add_listener` method is deprecated and will be removed in a future release.  Please use the :class:`.PoolEvents` listener interface.c                 C   s   t j | |¡ dS )a  Add a :class:`.PoolListener`-like object to this pool.

        ``listener`` may be an object that implements some or all of
        PoolListener, or a dictionary of callables containing implementations
        of some or all of the named methods in PoolListener.

        N)r   ÚPoolListenerÚ_adapt_listener)r#   Úlistenerr   r   r   rI   \  s   zPool.add_listenerc                 C   s
   t  | ¡S )a’  Produce a DBAPI connection that is not referenced by any
        thread-local context.

        This method is equivalent to :meth:`.Pool.connect` when the
        :paramref:`.Pool.use_threadlocal` flag is not set to True.
        When :paramref:`.Pool.use_threadlocal` is True, the
        :meth:`.Pool.unique_connection` method provides a means of bypassing
        the threadlocal context.

        )Ú_ConnectionFairyÚ	_checkoutrY   r   r   r   Úunique_connectionk  s   
zPool.unique_connectionc                 C   ó   t | ƒS )z6Called by subclasses to create a new ConnectionRecord.©Ú_ConnectionRecordrY   r   r   r   Ú_create_connectionx  s   zPool._create_connectionc                 C   sL   t |ddƒ}|r| j|jk rt ¡ | _|r"t |ddƒr$| |¡ dS dS dS )aš  Mark all connections established within the generation
        of the given connection as invalidated.

        If this pool's last invalidate time is before when the given
        connection was created, update the timestamp til now.  Otherwise,
        no action is performed.

        Connections with a start time prior to this pool's invalidation
        time will be recycled upon next checkout.
        Ú_connection_recordNÚis_validF)Úgetattrr>   Ú	starttimeÚtimeÚ
invalidate)r#   rr   Ú	exceptionÚ_checkinÚrecr   r   r   Ú_invalidate}  s   
ÿzPool._invalidatec                 C   ó   t ƒ ‚)a  Return a new :class:`.Pool`, of the same class as this one
        and configured with identical creation arguments.

        This method is used in conjunction with :meth:`dispose`
        to close out an entire :class:`.Pool` and create a new one in
        its place.

        r+   rY   r   r   r   ÚrecreateŽ  s   
zPool.recreatec                 C   rˆ   )zùDispose of this pool.

        This method leaves the possibility of checked-out connections
        remaining open, as it only affects connections that are
        idle in the pool.

        .. seealso::

            :meth:`Pool.recreate`

        r+   rY   r   r   r   Údisposeš  s   zPool.disposec                 C   sP   | j st | ¡S z| j ¡ }W n	 ty   Y n	w |dur!| ¡ S t | | j¡S )zÈReturn a DBAPI connection from the pool.

        The connection is instrumented such that when its
        ``close()`` method is called, the connection will be returned to
        the pool.

        N)r?   rw   rx   r;   ÚcurrentÚAttributeErrorÚ_checkout_existing©r#   r†   r   r   r   Úconnect©  s   
ÿzPool.connectc                 C   s2   | j rz| j`W n	 ty   Y nw |  |¡ dS )zµGiven a _ConnectionRecord, return it to the :class:`.Pool`.

        This method is called when an instrumented DBAPI connection
        has its ``close()`` method called.

        N)r?   r;   r‹   rŒ   Ú_do_return_conn)r#   Úrecordr   r   r   Ú_return_conn¾  s   
ÿzPool._return_connc                 C   rˆ   )z7Implementation for :meth:`get`, supplied by subclasses.r+   rY   r   r   r   Ú_do_getÌ  ó   zPool._do_getc                 C   rˆ   )z?Implementation for :meth:`return_conn`, supplied by subclasses.r+   ©r#   Úconnr   r   r   r�   Ñ  r”   zPool._do_return_connc                 C   rˆ   r    r+   rY   r   r   r   ÚstatusÖ  ó   zPool.status)
r3   NFNTNNNFN)NT)r.   r/   r0   r1   r   rF   rV   Úpropertyr<   Úsetterr[   rs   r   Ú
deprecatedrI   ry   r}   r‡   r‰   rŠ   r�   r’   r“   r�   r—   r   r   r   r   r2   h   sF    
ô B


ÿ


r2   c                   @   sª   e Zd ZdZd dd„ZdZdZdZ	 dZe	j
dd„ ƒZe	j
d	d
„ ƒZedd„ ƒZdd„ Zd!dd„Zedd„ ƒZedd„ ƒZdd„ Zd"dd„Zdd„ Zdd„ Zd!dd„ZdS )#r|   a¡  Internal object which maintains an individual DBAPI connection
    referenced by a :class:`.Pool`.

    The :class:`._ConnectionRecord` object always exists for any particular
    DBAPI connection whether or not that DBAPI connection has been
    "checked out".  This is in contrast to the :class:`._ConnectionFairy`
    which is only a public facade to the DBAPI connection while it is checked
    out.

    A :class:`._ConnectionRecord` may exist for a span longer than that
    of a single DBAPI connection.  For example, if the
    :meth:`._ConnectionRecord.invalidate`
    method is called, the DBAPI connection associated with this
    :class:`._ConnectionRecord`
    will be discarded, but the :class:`._ConnectionRecord` may be used again,
    in which case a new DBAPI connection is produced when the :class:`.Pool`
    next uses this record.

    The :class:`._ConnectionRecord` is delivered along with connection
    pool events, including :meth:`.PoolEvents.connect` and
    :meth:`.PoolEvents.checkout`, however :class:`._ConnectionRecord` still
    remains an internal object whose API and internals may change.

    .. seealso::

        :class:`._ConnectionFairy`

    Tc                 C   s"   || _ |r| jdd� tƒ | _d S )NT)Úfirst_connect_check)Ú_ConnectionRecord__poolÚ_ConnectionRecord__connectr   Úfinalize_callback)r#   Úpoolr�   r   r   r   rV   ù  s   z_ConnectionRecord.__init__Nr   c                 C   ó   i S )aY  The ``.info`` dictionary associated with the DBAPI connection.

        This dictionary is shared among the :attr:`._ConnectionFairy.info`
        and :attr:`.Connection.info` accessors.

        .. note::

            The lifespan of this dictionary is linked to the
            DBAPI connection itself, meaning that it is **discarded** each time
            the DBAPI connection is closed and/or invalidated.   The
            :attr:`._ConnectionRecord.record_info` dictionary remains
            persistent throughout the lifespan of the
            :class:`._ConnectionRecord` container.

        r   rY   r   r   r   Úinfo  s   z_ConnectionRecord.infoc                 C   r¡   )a½  An "info' dictionary associated with the connection record
        itself.

        Unlike the :attr:`._ConnectionRecord.info` dictionary, which is linked
        to the lifespan of the DBAPI connection, this dictionary is linked
        to the lifespan of the :class:`._ConnectionRecord` container itself
        and will remain persistent throughout the life of the
        :class:`._ConnectionRecord`.

        .. versionadded:: 1.1

        r   rY   r   r   r   Úrecord_info!  s   z_ConnectionRecord.record_infoc                    sº   ˆ  ¡ ‰zˆ ¡ }W n+ ty5 } zt ¡ � ˆ |¡ W d   ƒ n1 s&w   Y  W Y d }~nd }~ww ˆ ¡ ‰ t|ˆˆ ƒ}t 	|‡ ‡‡fdd„¡ˆ_
t ˆ¡ ˆ r[ˆj d|¡ |S )Nc                    s   t o	t d ˆˆ| ˆ ƒS r    )Ú_finalize_fairy)Úref©rC   r    r†   r   r   rb   =  s    z,_ConnectionRecord.checkout.<locals>.<lambda>z#Connection %r checked out from pool)r“   Úget_connectionrp   r   Úsafe_reraiseÚ_checkin_failedÚ_should_log_debugrw   Úweakrefr¥   Ú	fairy_refÚ_refsÚaddrn   ro   )Úclsr    r$   ÚerrÚfairyr   r¦   r   Úcheckout1  s*   
ÿ€ÿþ
ÿz_ConnectionRecord.checkoutc                 C   s   | j |d� | jdd� d S )N©ÚeT)Ú_no_fairy_ref)rƒ   Úcheckin)r#   r°   r   r   r   r©   G  s   z!_ConnectionRecord._checkin_failedFc                 C   st   | j d u r|st d|  ¡ d S d | _ | j}| j}| jr(| j ¡ }||ƒ | js|jjr3|j || ¡ | 	| ¡ d S )NzDouble checkin attempted on %s)
r¬   r   Úwarnrr   r�   rŸ   ÚpoprD   r¶   r’   )r#   rµ   rr   r    Ú	finalizerr   r   r   r¶   K  s   
þz_ConnectionRecord.checkinc                 C   s
   | j d uS r    )r¬   rY   r   r   r   Úin_useY  rZ   z_ConnectionRecord.in_usec                 C   ó   | j S r    )r�   rY   r   r   r   Úlast_connect_time]  s   z#_ConnectionRecord.last_connect_timec                 C   s   | j d ur|  ¡  d S d S r    )rr   Ú_ConnectionRecord__closerY   r   r   r   r   a  s   
ÿz_ConnectionRecord.closec                 C   sª   | j du rdS |r| jj | j | |¡ n
| jj | j | |¡ |dur5| jj d|r+dnd| j |jj|¡ n| jj d|r>dnd| j ¡ |rLt	 	¡ | _
dS |  ¡  d| _ dS )až  Invalidate the DBAPI connection held by this :class:`._ConnectionRecord`.

        This method is called for all connection invalidations, including
        when the :meth:`._ConnectionFairy.invalidate` or
        :meth:`.Connection.invalidate` methods are called, as well as when any
        so-called "automatic invalidation" condition occurs.

        :param e: an exception object indicating a reason for the invalidation.

        :param soft: if True, the connection isn't closed; instead, this
         connection will be recycled on next checkout.

         .. versionadded:: 1.0.3

        .. seealso::

            :ref:`pool_connection_invalidation`

        Nz*%sInvalidate connection %r (reason: %s:%s)zSoft Ú z%sInvalidate connection %r)rr   r�   rD   Úsoft_invalidaterƒ   rn   r¢   Ú	__class__r.   r‚   Ú_soft_invalidate_timer½   ©r#   r´   Úsoftr   r   r   rƒ   e  s,   

û
ý
z_ConnectionRecord.invalidatec                 C   sÈ   d}| j d u r| j ¡  |  ¡  nA| jjdkr.t ¡ | j | jjkr.| jj d| j ¡ d}n$| jj	| jkrA| jj d| j ¡ d}n| j
| jkrR| jj d| j ¡ d}|ra|  ¡  | j ¡  |  ¡  | j S )NFr3   z)Connection %r exceeded timeout; recyclingTz=Connection %r invalidated due to pool invalidation; recyclingzCConnection %r invalidated due to local soft invalidation; recycling)rr   r¢   r   rž   r�   r=   r‚   r�   rn   r>   rÁ   r½   )r#   rK   r   r   r   r§   ”  s6   


ÿýý
z _ConnectionRecord.get_connectionc                 C   s>   | j  ¡  | jjjr| jj | j| ¡ | j | j¡ d | _d S r    )rŸ   r   r�   rD   r   rr   rs   rY   r   r   r   Ú__close·  s
   


z_ConnectionRecord.__closec              
   C   s    | j }d | _zt ¡ | _| | ¡}|j d|¡ || _W n ty0 } z|j d|¡ ‚ d }~ww |r@|jj	 
|j¡ | j| ¡ |jjrN|j | j| ¡ d S d S )NzCreated new connection %rzError on connect(): %s)r�   rr   r‚   r�   r\   rn   ro   rp   rD   Úfirst_connectÚ
for_modifyÚ	exec_oncer�   )r#   rœ   r    rr   r´   r   r   r   Ú	__connect¾  s(   


€þÿÿz_ConnectionRecord.__connect)T)F©NF)r.   r/   r0   r1   rV   r¬   r�   rr   rÁ   r   r
   r¢   r£   Úclassmethodr²   r©   r¶   r™   rº   r¼   r   rƒ   r§   r½   rž   r   r   r   r   r|   Ú  s2    







/#r|   c              
   C   s  t  |¡ |dur|j|urdS | du sJ ‚|j} | durx|r(|r(|j d| ¡ z'|p0t| ||ƒ}|j| u s8J ‚| |¡ |sN|jj	rI|j 	| ¡ | 
| ¡ W n( tyw } z|jjddd� |rg|j|d� t|tƒsm‚ W Y d}~nd}~ww |r…|jdur‡| ¡  dS dS dS )zfCleanup for a :class:`._ConnectionFairy` whether or not it's already
    been garbage collected.

    Nz$Connection %r being returned to poolz!Exception during reset or similarTrl   r³   )r­   Údiscardr¬   rr   rn   ro   rw   Ú_resetrD   Úclose_detachedrs   ÚBaseExceptionrq   rƒ   Ú
isinstancerp   r¶   )rr   re   r    r¥   rC   r±   r´   r   r   r   r¤   Õ  sH   

ÿÿ

€ÿ
ÿ€ú	ÿr¤   c                   @   s°   e Zd ZdZdd„ ZdZ	 dZ	 dZ	 ed dd„ƒZ	dd„ Z
d	d
„ ZeZdd„ Zedd„ ƒZedd„ ƒZejdd„ ƒZedd„ ƒZd!dd„Zdd„ Zdd„ Zdd„ Zdd„ ZdS )"rw   aX  Proxies a DBAPI connection and provides return-on-dereference
    support.

    This is an internal object used by the :class:`.Pool` implementation
    to provide context management to a DBAPI connection delivered by
    that :class:`.Pool`.

    The name "fairy" is inspired by the fact that the
    :class:`._ConnectionFairy` object's lifespan is transitory, as it lasts
    only for the length of a specific DBAPI connection being checked out from
    the pool, and additionally that as a transparent proxy, it is mostly
    invisible.

    .. seealso::

        :class:`._ConnectionRecord`

    c                 C   s   || _ || _|| _d S r    )rr   r~   Ú_echo)r#   r$   re   rC   r   r   r   rV     s   
z_ConnectionFairy.__init__Nc                 C   sî  |st  |¡}||_d|_|d urt |¡|_|jd u r!t 	d¡‚| jd7  _|j
js/|jr4|jdkr6|S d}|dkrèz3|jrc|jrK|j d|j¡ |j |j¡}|sc|jr_|j d|j¡ t ¡ ‚|j
 |j|j|¡ |W S  tjyã } zg|jr‘|j d|¡ |j |¡ |j||dd	� n|j d
|j|¡ |j |¡ z|j ¡ |_W n, tyÔ } z t ¡ � |j |¡ W d   ƒ n1 sÅw   Y  W Y d }~nd }~ww |d8 }W Y d }~nd }~ww |dks<|j d¡ | ¡  t 	d¡‚)Nr   zThis connection is closedr   é   zPool pre-ping on connection %sz;Pool pre-ping on connection %s failed, will invalidate poolzoDisconnection detected on checkout, invalidating all pooled connections prior to current timestamp (reason: %r)F)r…   zVDisconnection detected on checkout, invalidating individual connection %s (reason: %r)z+Reconnection attempts exhausted on checkout)r|   r²   Ú_poolÚ_counterr«   r¥   r‹   rr   r   ÚInvalidRequestErrorrD   r@   rÐ   rn   ro   rF   r-   ÚInvalidatePoolErrorr~   ÚDisconnectionErrorÚinvalidate_poolr¢   rƒ   r‡   r§   rp   r   r¨   r©   )r¯   r    Úthreadconnsr±   ÚattemptsÚresultr´   r°   r   r   r   rx   <  s‚   


ÿÿ
ÿý
ÿüüÿ
ÿ€ÿ€æê2
z_ConnectionFairy._checkoutc                 C   s   t j| j| d�S ©N)r±   )rw   rx   rÒ   rY   r   r   r   r�   Œ  s   z#_ConnectionFairy._checkout_existingc                 C   s,   t | j| j| jd | j| d� d | _d | _d S rÛ   )r¤   rr   r~   rÒ   rÐ   rY   r   r   r   r…   �  s   ú
z_ConnectionFairy._checkinc                 C   s¼   |j jr|j  | | j¡ |jtu r4| jr"|j d| j| j	rdnd¡ | j	r,| j	 
¡  d S |j | ¡ d S |jtu r\| jrJ|j d| j| j	rGdnd¡ | j	rT| j	 ¡  d S |j | ¡ d S d S )Nz"Connection %s rollback-on-return%sz, via agentr¾   z Connection %s commit-on-return%s)rD   Úresetr~   rA   r   rÐ   rn   ro   rr   Ú_reset_agentr!   rF   r%   r   r'   r(   )r#   r    r   r   r   rÌ   �  s.   
ý
ýöz_ConnectionFairy._resetc                 C   ó   | j jS r    )rÒ   rn   rY   r   r   r   Ú_logger·  ó   z_ConnectionFairy._loggerc                 C   s
   | j duS )zbReturn True if this :class:`._ConnectionFairy` still refers
        to an active DBAPI connection.N©rr   rY   r   r   r   r   »  s   
z_ConnectionFairy.is_validc                 C   rÞ   )a‹  Info dictionary associated with the underlying DBAPI connection
        referred to by this :class:`.ConnectionFairy`, allowing user-defined
        data to be associated with the connection.

        The data here will follow along with the DBAPI connection including
        after it is returned to the connection pool and used again
        in subsequent instances of :class:`._ConnectionFairy`.  It is shared
        with the :attr:`._ConnectionRecord.info` and :attr:`.Connection.info`
        accessors.

        The dictionary associated with a particular DBAPI connection is
        discarded when the connection itself is discarded.

        )r~   r¢   rY   r   r   r   r¢   Â  s   z_ConnectionFairy.infoc                 C   s   | j r| j jS dS )aŸ  Info dictionary associated with the :class:`._ConnectionRecord
        container referred to by this :class:`.ConnectionFairy`.

        Unlike the :attr:`._ConnectionFairy.info` dictionary, the lifespan
        of this dictionary is persistent across connections that are
        disconnected and/or invalidated within the lifespan of a
        :class:`._ConnectionRecord`.

        .. versionadded:: 1.1

        N)r~   r£   rY   r   r   r   r£   Ô  s   z_ConnectionFairy.record_infoFc                 C   sH   | j du rt d¡ dS | jr| jj||d� |s"d| _ |  ¡  dS dS )aÎ  Mark this connection as invalidated.

        This method can be called directly, and is also called as a result
        of the :meth:`.Connection.invalidate` method.   When invoked,
        the DBAPI connection is immediately closed and discarded from
        further use by the pool.  The invalidation mechanism proceeds
        via the :meth:`._ConnectionRecord.invalidate` internal method.

        :param e: an exception object indicating a reason for the invalidation.

        :param soft: if True, the connection isn't closed; instead, this
         connection will be recycled on next checkout.

         .. versionadded:: 1.0.3

        .. seealso::

            :ref:`pool_connection_invalidation`

        Nz.Can't invalidate an already-closed connection.)r´   rÃ   )rr   r   r·   r~   rƒ   r…   rÂ   r   r   r   rƒ   æ  s   

þz_ConnectionFairy.invalidatec                 O   s   | j j|i |¤ŽS )z˜Return a new DBAPI cursor for the underlying connection.

        This method is a proxy for the ``connection.cursor()`` DBAPI
        method.

        )rr   Úcursor)r#   ÚargsÚkwargsr   r   r   râ     s   z_ConnectionFairy.cursorc                 C   ó   t | j|ƒS r    )r€   rr   ©r#   Úkeyr   r   r   Ú__getattr__  r&   z_ConnectionFairy.__getattr__c                 C   sn   | j dur3| j }t |¡ d|_d|_| j | j ¡ | j ¡ | _d| _ | jj	j
r5| jj	 
| j|¡ dS dS dS )a"  Separate this connection from its Pool.

        This means that the connection will no longer be returned to the
        pool when closed, and will instead be literally closed.  The
        containing ConnectionRecord is separated from the DB-API connection,
        and will create a new connection when next used.

        Note that any overall connection limiting constraints imposed by a
        Pool implementation may be violated after a detach, as the detached
        connection is removed from the pool's knowledge and control.
        N)r~   r­   Úremover¬   rr   rÒ   r�   r¢   ÚcopyrD   ÚdetachrŽ   r   r   r   rë     s   


õ
z_ConnectionFairy.detachc                 C   s(   |  j d8  _ | j dkr|  ¡  d S d S )Nr   r   )rÓ   r…   rY   r   r   r   r   +  s   
ÿz_ConnectionFairy.close)NNrÉ   )r.   r/   r0   r1   rV   rr   r~   rÝ   rÊ   rx   r�   r…   Ú_closerÌ   r™   rß   r   r   r
   r¢   r£   rƒ   râ   rè   rë   r   r   r   r   r   rw     s8    O




	rw   c                   @   sJ   e Zd ZdZddd„Zdd„ Zdd„ Zd	d
„ Zdd„ Zdd„ Z	dd„ Z
dS )ÚSingletonThreadPoola¤  A Pool that maintains one connection per thread.

    Maintains one connection per each thread, never moving a connection to a
    thread other than the one which it was created in.

    .. warning::  the :class:`.SingletonThreadPool` will call ``.close()``
       on arbitrary connections that exist beyond the size setting of
       ``pool_size``, e.g. if more unique **thread identities**
       than what ``pool_size`` states are used.   This cleanup is
       non-deterministic and not sensitive to whether or not the connections
       linked to those thread identities are currently in use.

       :class:`.SingletonThreadPool` may be improved in a future release,
       however in its current status it is generally used only for test
       scenarios using a SQLite ``:memory:`` database and is not recommended
       for production use.


    Options are the same as those of :class:`.Pool`, as well as:

    :param pool_size: The number of threads in which to maintain connections
        at once.  Defaults to five.

    :class:`.SingletonThreadPool` is used by the SQLite dialect
    automatically when a memory-based database is used.
    See :ref:`sqlite_toplevel`.

    é   c                 K   s8   d|d< t j| |fi |¤Ž t ¡ | _tƒ | _|| _d S )NTrL   )r2   rV   r   r:   Ú_connÚsetÚ
_all_connsÚsize)r#   rJ   Ú	pool_sizeÚkwr   r   r   rV   P  s
   

zSingletonThreadPool.__init__c                 C   s:   | j  d¡ | j| j| j| j| j| j| j| j	| j
| jd�	S )NúPool recreating)ró   rK   rC   r7   rL   rM   rR   rP   )rn   r¢   rÀ   r<   rò   r=   rC   r8   r?   rA   rD   rF   rY   r   r   r   r‰   W  s   ÷zSingletonThreadPool.recreatec              	   C   s8   | j D ]}z| ¡  W q ty   Y qw | j  ¡  dS )zDispose of this pool.N)rñ   r   rp   r   r•   r   r   r   rŠ   e  s   
ýzSingletonThreadPool.disposec                 C   s:   t | jƒ| jkr| j ¡ }| ¡  t | jƒ| jksd S d S r    )rh   rñ   rò   r¸   r   ©r#   Úcr   r   r   Ú_cleanupr  s   
þzSingletonThreadPool._cleanupc                 C   s   dt | ƒt| jƒf S )Nz"SingletonThreadPool id:%d size: %d)Úidrh   rñ   rY   r   r   r   r—   w  s   þzSingletonThreadPool.statusc                 C   ó   d S r    r   r•   r   r   r   r�   }  ó   z#SingletonThreadPool._do_return_connc                 C   sj   z| j  ¡ }|r|W S W n	 ty   Y nw |  ¡ }t |¡| j _t| jƒ| jkr-|  	¡  | j 
|¡ |S r    )rï   r‹   rŒ   r}   r«   r¥   rh   rñ   rò   rø   r®   rö   r   r   r   r“   €  s   
ÿÿzSingletonThreadPool._do_getN)rî   )r.   r/   r0   r1   rV   r‰   rŠ   rø   r—   r�   r“   r   r   r   r   rí   1  s    
rí   c                   @   st   e Zd ZdZ	ddd„Zdd„ Zd	d
„ Zdd„ Zdd„ Zdd„ Z	dd„ Z
dd„ Zdd„ Zdd„ Zdd„ Zdd„ ZdS )Ú	QueuePoolzÝA :class:`.Pool` that imposes a limit on the number of open connections.

    :class:`.QueuePool` is the default pooling implementation used for
    all :class:`.Engine` objects, unless the SQLite dialect is in use.

    rî   é
   é   c                 K   sD   t j| |fi |¤Ž t |¡| _d| | _|| _|| _t 	¡ | _
dS )aÿ  
        Construct a QueuePool.

        :param creator: a callable function that returns a DB-API
          connection object, same as that of :paramref:`.Pool.creator`.

        :param pool_size: The size of the pool to be maintained,
          defaults to 5. This is the largest number of connections that
          will be kept persistently in the pool. Note that the pool
          begins with no connections; once this number of connections
          is requested, that number of connections will remain.
          ``pool_size`` can be set to 0 to indicate no size limit; to
          disable pooling, use a :class:`~sqlalchemy.pool.NullPool`
          instead.

        :param max_overflow: The maximum overflow size of the
          pool. When the number of checked-out connections reaches the
          size set in pool_size, additional connections will be
          returned up to this limit. When those additional connections
          are returned to the pool, they are disconnected and
          discarded. It follows then that the total number of
          simultaneous connections the pool will allow is pool_size +
          `max_overflow`, and the total number of "sleeping"
          connections the pool will allow is pool_size. `max_overflow`
          can be set to -1 to indicate no overflow limit; no limit
          will be placed on the total number of concurrent
          connections. Defaults to 10.

        :param timeout: The number of seconds to wait before giving up
          on returning a connection. Defaults to 30.

        :param \**kw: Other keyword arguments including
          :paramref:`.Pool.recycle`, :paramref:`.Pool.echo`,
          :paramref:`.Pool.reset_on_return` and others are passed to the
          :class:`.Pool` constructor.

        r   N)r2   rV   Ú
sqla_queueÚQueuerÒ   Ú	_overflowÚ_max_overflowÚ_timeoutr   ÚLockÚ_overflow_lock)r#   rJ   ró   Úmax_overflowÚtimeoutrô   r   r   r   rV   ˜  s   (
zQueuePool.__init__c                 C   sJ   z
| j  |d¡ W d S  tjy$   z| ¡  W |  ¡  Y d S |  ¡  w w rÉ   )rÒ   Úputrÿ   ÚFullr   Ú_dec_overflowr•   r   r   r   r�   Ç  s   
üzQueuePool._do_return_connc                 C   sÜ   | j dk}z|o| j| j k}| j || j¡W S  tjy    Y nw |r@| j| j kr@|s/|  ¡ S tj	d|  
¡ |  ¡ | jf dd�‚|  ¡ rjz|  ¡ W S    t ¡ � |  ¡  W d   ƒ Y d S 1 sbw   Y  Y d S |  ¡ S )Nr3   zPQueuePool limit of size %d overflow %d reached, connection timed out, timeout %dÚ3o7r)Úcode)r  r  rÒ   Úgetr  rÿ   ÚEmptyr“   r   ÚTimeoutErrorrò   ÚoverflowÚ_inc_overflowr}   r   r¨   r
  )r#   Úuse_overflowÚwaitr   r   r   r“   Ð  s0   
üþü


&ÿzQueuePool._do_getc                 C   sv   | j dkr|  jd7  _dS | j�  | j| j k r(|  jd7  _	 W d   ƒ dS 	 W d   ƒ dS 1 s4w   Y  d S )Nr3   r   TF©r  r  r  rY   r   r   r   r  ï  s   
ý$ûzQueuePool._inc_overflowc                 C   sX   | j dkr|  jd8  _dS | j� |  jd8  _	 W d   ƒ dS 1 s%w   Y  d S )Nr3   r   Tr  rY   r   r   r   r
  ú  s   
$þzQueuePool._dec_overflowc                 C   sD   | j  d¡ | j| j| jj| j| j| j| j	| j
| j| j| j| jd�S )Nrõ   )
ró   r  r  rK   rC   r7   rL   rM   rR   rP   )rn   r¢   rÀ   r<   rÒ   Úmaxsizer  r  r=   rC   r8   r?   rA   rD   rF   rY   r   r   r   r‰     s   õzQueuePool.recreatec                 C   sV   	 z| j  d¡}| ¡  W n
 tjy   Y nw qd|  ¡  | _| j d|  	¡ ¡ d S )NTFr   zPool disposed. %s)
rÒ   r  r   rÿ   r  rò   r  rn   r¢   r—   r•   r   r   r   rŠ     s   ÿüzQueuePool.disposec                 C   s    d|   ¡ |  ¡ |  ¡ |  ¡ f S )Nz_Pool size: %d  Connections in pool: %d Current Overflow: %d Current Checked out connections: %d)rò   Ú	checkedinr  Ú
checkedoutrY   r   r   r   r—     s   üýÿzQueuePool.statusc                 C   rÞ   r    )rÒ   r  rY   r   r   r   rò   *  ó   zQueuePool.sizec                 C   s
   | j  ¡ S r    )rÒ   ÚqsizerY   r   r   r   r  -  s   
zQueuePool.checkedinc                 C   r»   r    )r  rY   r   r   r   r  0  r˜   zQueuePool.overflowc                 C   s   | j j| j  ¡  | j S r    )rÒ   r  r  r  rY   r   r   r   r  3  s   zQueuePool.checkedoutN)rî   rý   rþ   )r.   r/   r0   r1   rV   r�   r“   r  r
  r‰   rŠ   r—   rò   r  r  r  r   r   r   r   rü   �  s    
ÿ/	rü   c                   @   s8   e Zd ZdZdd„ Zdd„ Zdd„ Zdd	„ Zd
d„ ZdS )ÚNullPoolaQ  A Pool which does not pool connections.

    Instead it literally opens and closes the underlying DB-API connection
    per each connection open/close.

    Reconnect-related functions such as ``recycle`` and connection
    invalidation are not supported by this Pool implementation, since
    no connections are held persistently.

    c                 C   ó   dS )Nr  r   rY   r   r   r   r—   D  rû   zNullPool.statusc                 C   r   r    r)   r•   r   r   r   r�   G  r&   zNullPool._do_return_connc                 C   ó   |   ¡ S r    )r}   rY   r   r   r   r“   J  r  zNullPool._do_getc              
   C   ó6   | j  d¡ | j| j| j| j| j| j| j| j	| j
d�S )Nrõ   )rK   rC   r7   rL   rM   rR   rP   )rn   r¢   rÀ   r<   r=   rC   r8   r?   rA   rD   rF   rY   r   r   r   r‰   M  s   øzNullPool.recreatec                 C   rú   r    r   rY   r   r   r   rŠ   [  rû   zNullPool.disposeN)	r.   r/   r0   r1   r—   r�   r“   r‰   rŠ   r   r   r   r   r  7  s    r  c                   @   sX   e Zd ZdZedd„ ƒZedd„ ƒZdd„ Zdd	„ Zd
d„ Z	dd„ Z
dd„ Zdd„ ZdS )Ú
StaticPoola.  A Pool of exactly one connection, used for all requests.

    Reconnect-related functions such as ``recycle`` and connection
    invalidation (which is also used to support auto-reconnect) are not
    currently supported by this Pool implementation but may be implemented
    in a future release.

    c                 C   r  r    )r<   rY   r   r   r   rï   j  rà   zStaticPool._connc                 C   rz   r    r{   rY   r   r   r   rr   n  rà   zStaticPool.connectionc                 C   r  )Nr  r   rY   r   r   r   r—   r  rû   zStaticPool.statusc                 C   s"   d| j v r| j ¡  d | _d S d S )Nrï   )rX   rï   r   rY   r   r   r   rŠ   u  s   


þzStaticPool.disposec              
   C   r  )Nrõ   )rJ   rK   rL   rM   rC   r7   rR   rP   )rn   r¢   rÀ   r<   r=   r?   rA   rC   r8   rD   rF   rY   r   r   r   r‰   z  s   øzStaticPool.recreatec                 C   r»   r    )rï   rY   r   r   r   r}   ‡  r˜   zStaticPool._create_connectionc                 C   rú   r    r   r•   r   r   r   r�   Š  rû   zStaticPool._do_return_connc                 C   r»   r    rá   rY   r   r   r   r“   �  r˜   zStaticPool._do_getN)r.   r/   r0   r1   r
   rï   rr   r—   rŠ   r‰   r}   r�   r“   r   r   r   r   r  _  s    	

r  c                   @   s@   e Zd ZdZdd„ Zdd„ Zdd„ Zdd	„ Zd
d„ Zdd„ Z	dS )ÚAssertionPoola  A :class:`.Pool` that allows at most one checked out connection at
    any given time.

    This will raise an exception if more than one connection is checked out
    at a time.  Useful for debugging code that is using more connections
    than desired.

    c                 O   s<   d | _ d| _| dd¡| _d | _tj| g|¢R i |¤Ž d S )NFÚstore_tracebackT)rï   Ú_checked_outr¸   Ú_store_tracebackÚ_checkout_tracebackr2   rV   ©r#   rã   rô   r   r   r   rV   œ  s
   zAssertionPool.__init__c                 C   r  )Nr  r   rY   r   r   r   r—   £  rû   zAssertionPool.statusc                 C   s&   | j stdƒ‚d| _ || ju sJ ‚d S )Nzconnection is not checked outF)r!  ÚAssertionErrorrï   r•   r   r   r   r�   ¦  s   zAssertionPool._do_return_connc                 C   s   d| _ | jr| j ¡  d S d S rÉ   )r!  rï   r   rY   r   r   r   rŠ   ¬  s   ÿzAssertionPool.disposec                 C   s*   | j  d¡ | j| j| j| j| j| jd�S )Nrõ   )rC   r7   rR   rP   )rn   r¢   rÀ   r<   rC   r8   rD   rF   rY   r   r   r   r‰   ±  s   ûzAssertionPool.recreatec                 C   s^   | j r| jrdd t| jƒ¡ }nd}td| ƒ‚| js!|  ¡ | _d| _ | jr,t 	¡ | _| jS )Nz at:
%sr¾   z!connection is already checked outT)
r!  r#  Újoinr	   r%  rï   r}   r"  Ú	tracebackÚformat_stack)r#   Úsuffixr   r   r   r“   »  s   ÿ

zAssertionPool._do_getN)
r.   r/   r0   r1   rV   r—   r�   rŠ   r‰   r“   r   r   r   r   r  ‘  s    	
r  c                   @   sT   e Zd ZdZefdd„Zdd„ Zdd„ Zdd	„ Zd
d„ Z	dd„ Z
dd„ Zdd„ ZdS )r   a	  Layers connection pooling behavior on top of a standard DB-API module.

    Proxies a DB-API 2.0 connect() call to a connection pool keyed to the
    specific connect parameters. Other functions and attributes are delegated
    to the underlying DB-API module.
    c                 K   s&   || _ || _|| _i | _t ¡ | _dS )zØInitializes a new proxy.

        module
          a DB-API 2.0 module

        poolclass
          a Pool class, defaulting to QueuePool

        Other parameters are sent to the Pool object's constructor.

        N)r   rô   Ú	poolclassÚpoolsr   r  Ú_create_pool_mutex)r#   r   r*  rô   r   r   r   rV   ×  s
   z_DBProxy.__init__c                 C   s   t | jƒD ]}| j|= qd S r    )Úlistr+  ræ   r   r   r   r   ê  s   
ÿz_DBProxy.closec                 C   s   |   ¡  d S r    r)   rY   r   r   r   Ú__del__î  r&   z_DBProxy.__del__c                 C   rå   r    )r€   r   ræ   r   r   r   rè   ñ  r&   z_DBProxy.__getattr__c                    s²   ˆj ˆ i ˆ¤Ž}zˆj| W S  tyX   ˆj ¡  z7|ˆjvrEˆ dd ¡ ˆj‡ ‡‡fdd„fi ˆj¤Ž}|ˆj|< |W ˆj ¡   Y S ˆj| W ˆj ¡   Y S ˆj ¡  w w )NÚsa_pool_keyc                      s   ˆj jˆ i ˆ¤ŽS r    )r   r�   r   ©rã   rô   r#   r   r   rb   þ  s    z#_DBProxy.get_pool.<locals>.<lambda>)	Ú
_serializer+  r   r,  Úacquirer¸   r*  rô   Úrelease)r#   rã   rô   rç   r    r   r0  r   Úget_poolô  s&   

ÿÿ

þóz_DBProxy.get_poolc                 O   s   | j |i |¤Ž ¡ S )a,  Activate a connection to the database.

        Connect to the database using this DBProxy's module and the given
        connect arguments.  If the arguments match an existing pool, the
        connection will be returned from the pool's current thread-local
        connection instance, or if there is no thread-local connection
        instance it will be checked out from the set of pooled connections.

        If the pool has no available connections and allows new connections
        to be created, a new database connection will be made.

        )r4  r�   r$  r   r   r   r�     s   z_DBProxy.connectc                 O   s4   | j |i |¤Ž}z| j|= W dS  ty   Y dS w )z;Dispose the pool referenced by the given connect arguments.N)r1  r+  r   )r#   rã   rô   rç   r   r   r   rŠ     s   ÿz_DBProxy.disposec                    s2   dˆ v rˆ d S t t|ƒ‡ fdd„tˆ ƒD ƒ ƒS )Nr/  c                    s   g | ]}|ˆ | f‘qS r   r   )Ú.0Úk©rô   r   r   Ú
<listcomp>$  s    z'_DBProxy._serialize.<locals>.<listcomp>)Útupler-  Úsortedr$  r   r7  r   r1     s   "z_DBProxy._serializeN)r.   r/   r0   r1   rü   rV   r   r.  rè   r4  r�   rŠ   r1  r   r   r   r   r   Î  s    	r   r    )'r1   Úcollectionsr   r‚   r'  r«   r¾   r   r   r   r   r   r	   r
   r   rÿ   r   r   r   r   Úsymbolr   r   r   Úobjectr   Ú
Identifiedr2   r|   r¤   rð   r­   rw   rí   rü   r  r  r  r   r   r   r   r   Ú<module>   sN   


  t }
ÿ.  -^ )(2=