# Path: hurray/server/util.py
# PY3 = sys.version_info >= (3,)
#     def cast(typ, x):
# def import_object(name):
# def raise_exc_info(exc_info):
# def exec_in(code, glob, loc=None):
# def errno_from_exception(e):
#     def __new__(cls, *args, **kwargs):
#     def configurable_base(cls):
#     def configurable_default(cls):
#     def initialize(self):
#     def configure(cls, impl, **kwargs):
#     def configured_class(cls):
#     def _save_configuration(cls):
#     def _restore_configuration(cls, saved):
#     def __init__(self, func, name):
#     def _getargnames(self, func):
#     def get_old_value(self, args, kwargs, default=None):
#     def replace(self, new_value, args, kwargs):
# def timedelta_to_seconds(td):
# class Configurable(object):
# class ArgReplacer(object):


import logging
import logging.handlers
import sys
    import curses  # type: ignore
        import hurray.options
        import hurray.options
from hurray.server.util import unicode_type, basestring_type
These streams may be configured independently using the standard library's
`logging` module.  For example, you may wish to send ``hurray.access`` logs
to a separate file for analysis.
"""
from __future__ import absolute_import, division, print_function, with_statement



try:
except ImportError:
    curses = None

# Logger objects for internal hurray use
access_log = logging.getLogger("hurray.access")
app_log = logging.getLogger("hurray.application")
gen_log = logging.getLogger("hurray.general")


def _stderr_supports_color():
    color = False
    if curses and hasattr(sys.stderr, 'isatty') and sys.stderr.isatty():
        try:
            curses.setupterm()
            if curses.tigetnum("colors") > 0:
                color = True
        except Exception:
            pass
    return color



# Path: hurray/server/util.py
# PY3 = sys.version_info >= (3,)
#     def cast(typ, x):
# def import_object(name):
# def raise_exc_info(exc_info):
# def exec_in(code, glob, loc=None):
# def errno_from_exception(e):
#     def __new__(cls, *args, **kwargs):
#     def configurable_base(cls):
#     def configurable_default(cls):
#     def initialize(self):
#     def configure(cls, impl, **kwargs):
#     def configured_class(cls):
#     def _save_configuration(cls):
#     def _restore_configuration(cls, saved):
#     def __init__(self, func, name):
#     def _getargnames(self, func):
#     def get_old_value(self, args, kwargs, default=None):
#     def replace(self, new_value, args, kwargs):
# def timedelta_to_seconds(td):
# class Configurable(object):
# class ArgReplacer(object):


# Path: hurray/server/log.py
import logging
import logging.handlers
import sys
    import curses  # type: ignore
        import hurray.options
        import hurray.options
from hurray.server.util import unicode_type, basestring_type

These streams may be configured independently using the standard library's
`logging` module.  For example, you may wish to send ``hurray.access`` logs
to a separate file for analysis.
"""
from __future__ import absolute_import, division, print_function, with_statement



try:
except ImportError:
    curses = None

# Logger objects for internal hurray use
access_log = logging.getLogger("hurray.access")
app_log = logging.getLogger("hurray.application")
gen_log = logging.getLogger("hurray.general")


def _stderr_supports_color():
    color = False
    if curses and hasattr(sys.stderr, 'isatty') and sys.stderr.isatty():
        try:
            curses.setupterm()
            if curses.tigetnum("colors") > 0:
                color = True
        except Exception:
            pass
    return color



_TO_UNICODE_TYPES = (unicode_type, type(None))