# Path: hurricane/utils.py
# class cached_property(object):
#     """A decorator that converts a function into a lazy property.  The
#     function wrapped is called the first time to retrieve the result
#     and than that calculated result is used the next time you access
#     the value::
# 
#         class Foo(object):
# 
#             @cached_property
#             def foo(self):
#                 # calculate something important here
#                 return 42
# 
#     The class has to have a `__dict__` in order for this property to
#     work.
#     """
#     # implementation detail: this property is implemented as non-data
#     # descriptor.  non-data descriptors are only invoked if there is
#     # no entry with the same name in the instance's __dict__
#     # this allows us to completely get rid of the access function call
#     # overhead.  If one choses to invoke __get__ by hand the property
#     # will still work as expected because the lookup logic is replicated
#     # in __get__ for manual invocation.
# 
#     def __init__(self, func, name=None, doc=None):
#         self.__name__ = name or func.__name__
#         self.__doc__ = doc
#         self.func = func
# 
#     def __get__(self, obj, type=None):
#         if obj is None:
#             return self
#         value = obj.__dict__.get(self.__name__, _missing)
#         if value is _missing:
#             value = self.func(obj)
#             obj.__dict__[self.__name__] = value
#         return value


from Cookie import BaseCookie, Morsel, CookieError
from simplejson import loads
from hurricane.utils import cached_property



_missing = object()


def unquote_header_value(value):
    r"""Unquotes a header value.  (Reversal of :func:`quote_header_value`).

# Path: hurricane/utils.py
# class cached_property(object):
#     """A decorator that converts a function into a lazy property.  The
#     function wrapped is called the first time to retrieve the result
#     and than that calculated result is used the next time you access
#     the value::
# 
#         class Foo(object):
# 
#             @cached_property
#             def foo(self):
#                 # calculate something important here
#                 return 42
# 
#     The class has to have a `__dict__` in order for this property to
#     work.
#     """
#     # implementation detail: this property is implemented as non-data
#     # descriptor.  non-data descriptors are only invoked if there is
#     # no entry with the same name in the instance's __dict__
#     # this allows us to completely get rid of the access function call
#     # overhead.  If one choses to invoke __get__ by hand the property
#     # will still work as expected because the lookup logic is replicated
#     # in __get__ for manual invocation.
# 
#     def __init__(self, func, name=None, doc=None):
#         self.__name__ = name or func.__name__
#         self.__doc__ = doc
#         self.func = func
# 
#     def __get__(self, obj, type=None):
#         if obj is None:
#             return self
#         value = obj.__dict__.get(self.__name__, _missing)
#         if value is _missing:
#             value = self.func(obj)
#             obj.__dict__[self.__name__] = value
#         return value


# Path: hurricane/handlers/comet/utils.py
from Cookie import BaseCookie, Morsel, CookieError
from simplejson import loads
from hurricane.utils import cached_property




_missing = object()


def unquote_header_value(value):
    r"""Unquotes a header value.  (Reversal of :func:`quote_header_value`).

    This does not use the real unquoting but what browsers are actually