class_docstr: Available events for :class:`_pool.Pool`.
  
  The methods here define the name of an event as well
  as the names of members that are passed to listener
  functions.
  
  e.g.::
  
      from sqlalchemy import event
  
      def my_on_checkout(dbapi_conn, connection_rec, connection_proxy):
          "handle an on checkout event"
  
      event.listen(Pool, 'checkout', my_on_checkout)
  
  In addition to accepting the :class:`_pool.Pool` class and
  :class:`_pool.Pool` instances, :class:`_events.PoolEvents` also accepts
  :class:`_engine.Engine` objects and the :class:`_engine.Engine` class as
  targets, which will be resolved to the ``.pool`` attribute of the
  given engine or the :class:`_pool.Pool` class::
  
      engine = create_engine("postgresql+psycopg2://scott:tiger@localhost/test")
  
      # will associate with engine.pool
      event.listen(engine, 'checkout', my_on_checkout)
class_docstr_tok: ["Available","events","for",":","class",":","`","_pool.Pool","`",".","The","methods","here","define","the","name","of","an","event","as","well","as","the","names","of","members","that","are","passed","to","listener","functions",".","e.g",".",":",":","from","sqlalchemy","import","event","def","my_on_checkout","(","dbapi_conn",",","connection_rec",",","connection_proxy",")",":","``","handle","an","on","checkout","event","''","event.listen","(","Pool",",","'checkout","'",",","my_on_checkout",")","In","addition","to","accepting","the",":","class",":","`","_pool.Pool","`","class","and",":","class",":","`","_pool.Pool","`","instances",",",":","class",":","`","_events.PoolEvents","`","also","accepts",":","class",":","`","_engine.Engine","`","objects","and","the",":","class",":","`","_engine.Engine","`","class","as","targets",",","which","will","be","resolved","to","the","``",".pool","``","attribute","of","the","given","engine","or","the",":","class",":","`","_pool.Pool","`","class",":",":","engine","=","create_engine","(","``","postgresql+psycopg2",":","\/\/scott",":","tiger","@","localhost\/test","''",")","#","will","associate","with","engine.pool","event.listen","(","engine",",","'checkout","'",",","my_on_checkout",")"]
docstr: Called before the "reset" action occurs for a pooled connection.
  
  This event represents
  when the ``rollback()`` method is called on the DBAPI connection
  before it is returned to the pool or discarded.
  A custom "reset" strategy may be implemented using this event hook,
  which may also be combined with disabling the default "reset"
  behavior using the :paramref:`_pool.Pool.reset_on_return` parameter.
  
  The primary difference between the :meth:`_events.PoolEvents.reset` and
  :meth:`_events.PoolEvents.checkin` events are that
  :meth:`_events.PoolEvents.reset` is called not just for pooled
  connections that are being returned to the pool, but also for
  connections that were detached using the
  :meth:`_engine.Connection.detach` method as well as asyncio connections
  that are being discarded due to garbage collection taking place on
  connections before the connection was checked in.
  
  Note that the event **is not** invoked for connections that were
  invalidated using :meth:`_engine.Connection.invalidate`.    These
  events may be intercepted using the :meth:`.PoolEvents.soft_invalidate`
  and :meth:`.PoolEvents.invalidate` event hooks, and all "connection
  close" events may be intercepted using :meth:`.PoolEvents.close`.
  
  The :meth:`_events.PoolEvents.reset` event is usually followed by the
  :meth:`_events.PoolEvents.checkin` event, except in those
  cases where the connection is discarded immediately after reset.
  
  :param dbapi_connection: a DBAPI connection.
   The :attr:`.ConnectionPoolEntry.dbapi_connection` attribute.
  
  :param connection_record: the :class:`.ConnectionPoolEntry` managing
   the DBAPI connection.
  
  :param reset_state: :class:`.PoolResetState` instance which provides
   information about the circumstances under which the connection
   is being reset.
  
   .. versionadded:: 2.0
  
  .. seealso::
  
      :ref:`pool_reset_on_return`
  
      :meth:`_events.ConnectionEvents.rollback`
  
      :meth:`_events.ConnectionEvents.commit`
docstr_tok: ["Called","before","the","``","reset","''","action","occurs","for","a","pooled","connection",".","This","event","represents","when","the","``","rollback","(",")","``","method","is","called","on","the","DBAPI","connection","before","it","is","returned","to","the","pool","or","discarded",".","A","custom","``","reset","''","strategy","may","be","implemented","using","this","event","hook",",","which","may","also","be","combined","with","disabling","the","default","``","reset","''","behavior","using","the",":","paramref",":","`","_pool.Pool.reset_on_return","`","parameter",".","The","primary","difference","between","the",":","meth",":","`","_events.PoolEvents.reset","`","and",":","meth",":","`","_events.PoolEvents.checkin","`","events","are","that",":","meth",":","`","_events.PoolEvents.reset","`","is","called","not","just","for","pooled","connections","that","are","being","returned","to","the","pool",",","but","also","for","connections","that","were","detached","using","the",":","meth",":","`","_engine.Connection.detach","`","method","as","well","as","asyncio","connections","that","are","being","discarded","due","to","garbage","collection","taking","place","on","connections","before","the","connection","was","checked","in",".","Note","that","the","event","*","*","is","not","*","*","invoked","for","connections","that","were","invalidated","using",":","meth",":","`","_engine.Connection.invalidate","`",".","These","events","may","be","intercepted","using","the",":","meth",":","`",".PoolEvents.soft_invalidate","`","and",":","meth",":","`",".PoolEvents.invalidate","`","event","hooks",",","and","all","``","connection","close","''","events","may","be","intercepted","using",":","meth",":","`",".PoolEvents.close","`",".","The",":","meth",":","`","_events.PoolEvents.reset","`","event","is","usually","followed","by","the",":","meth",":","`","_events.PoolEvents.checkin","`","event",",","except","in","those","cases","where","the","connection","is","discarded","immediately","after","reset",".",":","param","dbapi_connection",":","a","DBAPI","connection",".","The",":","attr",":","`",".ConnectionPoolEntry.dbapi_connection","`","attribute",".",":","param","connection_record",":","the",":","class",":","`",".ConnectionPoolEntry","`","managing","the","DBAPI","connection",".",":","param","reset_state",":",":","class",":","`",".PoolResetState","`","instance","which","provides","information","about","the","circumstances","under","which","the","connection","is","being","reset",".","..","versionadded",":",":","2.0","..","seealso",":",":",":","ref",":","`","pool_reset_on_return","`",":","meth",":","`","_events.ConnectionEvents.rollback","`",":","meth",":","`","_events.ConnectionEvents.commit","`"]
code: def reset(
      self,
      dbapi_connection: DBAPIConnection,
      connection_record: ConnectionPoolEntry,
      reset_state: PoolResetState,
  ) -> None:
      """Called before the "reset" action occurs for a pooled connection.
  
      This event represents
      when the ``rollback()`` method is called on the DBAPI connection
      before it is returned to the pool or discarded.
      A custom "reset" strategy may be implemented using this event hook,
      which may also be combined with disabling the default "reset"
      behavior using the :paramref:`_pool.Pool.reset_on_return` parameter.
  
      The primary difference between the :meth:`_events.PoolEvents.reset` and
      :meth:`_events.PoolEvents.checkin` events are that
      :meth:`_events.PoolEvents.reset` is called not just for pooled
      connections that are being returned to the pool, but also for
      connections that were detached using the
      :meth:`_engine.Connection.detach` method as well as asyncio connections
      that are being discarded due to garbage collection taking place on
      connections before the connection was checked in.
  
      Note that the event **is not** invoked for connections that were
      invalidated using :meth:`_engine.Connection.invalidate`.    These
      events may be intercepted using the :meth:`.PoolEvents.soft_invalidate`
      and :meth:`.PoolEvents.invalidate` event hooks, and all "connection
      close" events may be intercepted using :meth:`.PoolEvents.close`.
  
      The :meth:`_events.PoolEvents.reset` event is usually followed by the
      :meth:`_events.PoolEvents.checkin` event, except in those
      cases where the connection is discarded immediately after reset.
  
      :param dbapi_connection: a DBAPI connection.
       The :attr:`.ConnectionPoolEntry.dbapi_connection` attribute.
  
      :param connection_record: the :class:`.ConnectionPoolEntry` managing
       the DBAPI connection.
  
      :param reset_state: :class:`.PoolResetState` instance which provides
       information about the circumstances under which the connection
       is being reset.
  
       .. versionadded:: 2.0
  
      .. seealso::
  
          :ref:`pool_reset_on_return`
  
          :meth:`_events.ConnectionEvents.rollback`
  
          :meth:`_events.ConnectionEvents.commit`
  
      """
  
imports: from __future__ import annotations
  import typing
  from typing import Any
  from typing import Optional
  from typing import Type
  from typing import Union
  from .base import ConnectionPoolEntry
  from .base import Pool
  from .base import PoolProxiedConnection
  from .base import PoolResetState
  from ..None import event
  from ..None import util
label_desc: Use image node_id 7 for calling the PoolEvents obj's underlying member method code with example usage: obj.reset(dbapi_connection, connection_record, reset_state) without return types