# 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
# -*- coding: utf-8 -*-
"""
    solace.database
    ~~~~~~~~~~~~~~~

    This module defines lower-level database support.

    :copyright: (c) 2010 by the Solace Team, see AUTHORS for more details.
    :license: BSD, see LICENSE for more details.
"""
from __future__ import with_statement


_engine = None
_engine_lock = Lock()


# the best timer for the platform. on windows systems we're using clock
# for timing which has a higher resolution.
if sys.platform == 'win32':
    _timer = time.clock
else:
    _timer = time.time


def get_engine():
    """Creates or returns the engine."""
    global _engine
    with _engine_lock:
        if _engine is None:

# 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

# -*- coding: utf-8 -*-
"""
    solace.database
    ~~~~~~~~~~~~~~~

    This module defines lower-level database support.

    :copyright: (c) 2010 by the Solace Team, see AUTHORS for more details.
    :license: BSD, see LICENSE for more details.
"""
from __future__ import with_statement


_engine = None
_engine_lock = Lock()


# the best timer for the platform. on windows systems we're using clock
# for timing which has a higher resolution.
if sys.platform == 'win32':
    _timer = time.clock
else:
    _timer = time.time


def get_engine():
    """Creates or returns the engine."""
    global _engine
    with _engine_lock:
        if _engine is None:

            options = {'echo': settings.DATABASE_ECHO,