# 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

    def process_result_value(self, value, dialect):
        if value is not None:
            return badges_by_id.get(value)

    def is_mutable(self):
        return False


metadata = MetaData()
session = orm.scoped_session(SignalTrackingSession)


def init():
    """Initializes the database."""
    engine = get_engine()
    if engine.name == 'mysql':
        for table in metadata.tables.itervalues():
            table.kwargs.update(mysql_engine=settings.MYSQL_ENGINE,
                                mysql_charset=settings.MYSQL_TABLE_CHARSET)
    metadata.create_all(bind=engine)


def drop_tables():
    """Drops all tables again."""
    metadata.drop_all(bind=get_engine())


def add_query_debug_headers(request, response):
    """Add headers with the SQL info."""

# 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


    def process_result_value(self, value, dialect):
        if value is not None:
            return badges_by_id.get(value)

    def is_mutable(self):
        return False


metadata = MetaData()
session = orm.scoped_session(SignalTrackingSession)


def init():
    """Initializes the database."""
    engine = get_engine()
    if engine.name == 'mysql':
        for table in metadata.tables.itervalues():
            table.kwargs.update(mysql_engine=settings.MYSQL_ENGINE,
                                mysql_charset=settings.MYSQL_TABLE_CHARSET)
    metadata.create_all(bind=engine)


def drop_tables():
    """Drops all tables again."""
    metadata.drop_all(bind=get_engine())


def add_query_debug_headers(request, response):
    """Add headers with the SQL info."""

    if settings.TRACK_QUERIES: