# Path: solace/signals.py
# def _ref(func):
#     def __init__(self, im_self, im_func, im_class):
#     def resolve(self):
# def SIG(name, args=None):
#     def __init__(self, name, args=None, _frm=None):
#     def connect(self, func):
#     def is_connected(self, func):
#     def get_connections(self):
#     def disconnect(self, func):
#     def emit(self, **args):
#     def __reduce__(self):
#     def __repr__(self):
#     def emit(self, **args):
# def temporary_connection(func, signal):
# def handler(signal):
#     def decorator(func):
# class _MethodRef(object):
# class Signal(object):
# class _BroadcastSignal(Signal):
# 
# Path: solace/settings.py
# def configure(**values):
# def revert_to_default():
# def autodiscover_settings():
# def configure_from_file(filename):
# def describe_settings():


import sys
import time
    import solace.schema
    import solace.schema
from threading import Lock
from datetime import datetime
from babel import Locale
from sqlalchemy.types import TypeDecorator
from sqlalchemy.engine.url import make_url
from sqlalchemy.interfaces import ConnectionProxy
from sqlalchemy.orm.session import Session
from sqlalchemy.orm.interfaces import SessionExtension, MapperExtension, \
     EXT_CONTINUE
from sqlalchemy.util import to_list
from sqlalchemy import String, orm, sql, create_engine, MetaData
            from solace.badges import badges_by_id
        from solace.application import Request
from solace.signals import after_request_shutdown, before_response_sent, \
     after_cursor_executed, before_cursor_executed, before_models_committed, \
     after_models_committed
from solace import settings
        orm.attributes.instance_state(obj).expire_attributes(dict_, [column])
    else:
        orm.attributes.set_committed_value(obj, column, val + delta)

    table = mapper.tables[0]
    stmt = sql.update(table, mapper.primary_key[0] == pk[0], {
        column:     table.c[column] + delta
    })
    sess.execute(stmt)


def mapper(model, table, **options):
    """A mapper that hooks in standard extensions."""
    extensions = to_list(options.pop('extension', None), [])
    extensions.append(SignalTrackingMapperExtension())
    options['extension'] = extensions
    return orm.mapper(model, table, **options)


class ConnectionQueryTrackingProxy(ConnectionProxy):
    """A proxy that if enabled counts the queries."""

    def cursor_execute(self, execute, cursor, statement, parameters,
                       context, executemany):
        before_cursor_executed.emit(cursor=self, statement=statement,
                                    parameters=parameters)
        start = _timer()
        try:
            return execute(cursor, statement, parameters, context)
        finally:

# Path: solace/signals.py
# def _ref(func):
#     def __init__(self, im_self, im_func, im_class):
#     def resolve(self):
# def SIG(name, args=None):
#     def __init__(self, name, args=None, _frm=None):
#     def connect(self, func):
#     def is_connected(self, func):
#     def get_connections(self):
#     def disconnect(self, func):
#     def emit(self, **args):
#     def __reduce__(self):
#     def __repr__(self):
#     def emit(self, **args):
# def temporary_connection(func, signal):
# def handler(signal):
#     def decorator(func):
# class _MethodRef(object):
# class Signal(object):
# class _BroadcastSignal(Signal):
# 
# Path: solace/settings.py
# def configure(**values):
# def revert_to_default():
# def autodiscover_settings():
# def configure_from_file(filename):
# def describe_settings():


# Path: solace/database.py
import sys
import time
    import solace.schema
    import solace.schema
from threading import Lock
from datetime import datetime
from babel import Locale
from sqlalchemy.types import TypeDecorator
from sqlalchemy.engine.url import make_url
from sqlalchemy.interfaces import ConnectionProxy
from sqlalchemy.orm.session import Session
from sqlalchemy.orm.interfaces import SessionExtension, MapperExtension, \
     EXT_CONTINUE
from sqlalchemy.util import to_list
from sqlalchemy import String, orm, sql, create_engine, MetaData
            from solace.badges import badges_by_id
        from solace.application import Request
from solace.signals import after_request_shutdown, before_response_sent, \
     after_cursor_executed, before_cursor_executed, before_models_committed, \
     after_models_committed
from solace import settings

        orm.attributes.instance_state(obj).expire_attributes(dict_, [column])
    else:
        orm.attributes.set_committed_value(obj, column, val + delta)

    table = mapper.tables[0]
    stmt = sql.update(table, mapper.primary_key[0] == pk[0], {
        column:     table.c[column] + delta
    })
    sess.execute(stmt)


def mapper(model, table, **options):
    """A mapper that hooks in standard extensions."""
    extensions = to_list(options.pop('extension', None), [])
    extensions.append(SignalTrackingMapperExtension())
    options['extension'] = extensions
    return orm.mapper(model, table, **options)


class ConnectionQueryTrackingProxy(ConnectionProxy):
    """A proxy that if enabled counts the queries."""

    def cursor_execute(self, execute, cursor, statement, parameters,
                       context, executemany):
        before_cursor_executed.emit(cursor=self, statement=statement,
                                    parameters=parameters)
        start = _timer()
        try:
            return execute(cursor, statement, parameters, context)
        finally:

            after_cursor_executed.emit(cursor=self, statement=statement,