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 when a connection is retrieved from the Pool.
  
  :param dbapi_connection: a DBAPI connection.
   The :attr:`.ConnectionPoolEntry.dbapi_connection` attribute.
  
  :param connection_record: the :class:`.ConnectionPoolEntry` managing
   the DBAPI connection.
  
  :param connection_proxy: the :class:`.PoolProxiedConnection` object
    which will proxy the public interface of the DBAPI connection for the
    lifespan of the checkout.
  
  If you raise a :class:`~sqlalchemy.exc.DisconnectionError`, the current
  connection will be disposed and a fresh connection retrieved.
  Processing of all checkout listeners will abort and restart
  using the new connection.
  
  .. seealso:: :meth:`_events.ConnectionEvents.engine_connect`
     - a similar event
     which occurs upon creation of a new :class:`_engine.Connection`.
docstr_tok: ["Called","when","a","connection","is","retrieved","from","the","Pool",".",":","param","dbapi_connection",":","a","DBAPI","connection",".","The",":","attr",":","`",".ConnectionPoolEntry.dbapi_connection","`","attribute",".",":","param","connection_record",":","the",":","class",":","`",".ConnectionPoolEntry","`","managing","the","DBAPI","connection",".",":","param","connection_proxy",":","the",":","class",":","`",".PoolProxiedConnection","`","object","which","will","proxy","the","public","interface","of","the","DBAPI","connection","for","the","lifespan","of","the","checkout",".","If","you","raise","a",":","class",":","`","~sqlalchemy.exc.DisconnectionError","`",",","the","current","connection","will","be","disposed","and","a","fresh","connection","retrieved",".","Processing","of","all","checkout","listeners","will","abort","and","restart","using","the","new","connection",".","..","seealso",":",":",":","meth",":","`","_events.ConnectionEvents.engine_connect","`","-","a","similar","event","which","occurs","upon","creation","of","a","new",":","class",":","`","_engine.Connection","`","."]
code: def checkout(
      self,
      dbapi_connection: DBAPIConnection,
      connection_record: ConnectionPoolEntry,
      connection_proxy: PoolProxiedConnection,
  ) -> None:
      """Called when a connection is retrieved from the Pool.
  
      :param dbapi_connection: a DBAPI connection.
       The :attr:`.ConnectionPoolEntry.dbapi_connection` attribute.
  
      :param connection_record: the :class:`.ConnectionPoolEntry` managing
       the DBAPI connection.
  
      :param connection_proxy: the :class:`.PoolProxiedConnection` object
        which will proxy the public interface of the DBAPI connection for the
        lifespan of the checkout.
  
      If you raise a :class:`~sqlalchemy.exc.DisconnectionError`, the current
      connection will be disposed and a fresh connection retrieved.
      Processing of all checkout listeners will abort and restart
      using the new connection.
  
      .. seealso:: :meth:`_events.ConnectionEvents.engine_connect`
         - a similar event
         which occurs upon creation of a new :class:`_engine.Connection`.
  
      """
  
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 5 for calling the PoolEvents obj's underlying member method code with example usage: obj.checkout(dbapi_connection, connection_record, connection_proxy) without return types