def checkout(self, dbapi_con, con_record, con_proxy):
    if not is_valid_connection(dbapi_con):
        raise sqlalchemy.exc.DisconnectionError
How can I check pooled connections in SQLAlchemy before handing them off to my application code?