# Path: torext/utils.py
# def generate_cookie_secret():
# def timesince(t):
# def pprint(o):
#     def instance(cls, *args, **kwgs):
# def split_kwargs(kwgs_tuple, kwgs):
#     def __getattr__(self, key):
#     def __setattr__(self, key, value):
#     def __delattr__(self, key):
#     def __str__(self):
# def _resolve_name(name, package, level):
# def import_module(name, package=None):
# def add_to_syspath(pth, relative_to=None):
# def start_shell(extra_vars=None):
#         def complete(self, text, state):
# def fix_request_arguments(arguments):
#     def __init__(self, local, name=None):
#     def get_current_object(self):
#     def __dict__(self):
#     def __repr__(self):
#     def __bool__(self):
#     def __unicode__(self):
#     def __dir__(self):
#     def __getattr__(self, name):
#     def __setitem__(self, key, value):
#     def __delitem__(self, key):
#     def __setslice__(self, i, j, seq):
#     def __delslice__(self, i, j):
# class SingletonMixin(object):
# class ObjectDict(dict):
#     class CustomCompleter(rlcompleter.Completer):
# class LocalProxy(object):
# 
# Path: torext/compat.py
# PY3 = sys.version_info.major == 3
# PY2 = sys.version_info.major == 2
#     def unicode_(s, *args):
#     def decode_(s, *args):
#     def bytes_(s):
#     def str_(s):
#     def unicode_(s, *args):
#     def decode_(s, *args):
#     def bytes_(s):
#     def str_(s):


import sys
import time
import unittest
import logging
import mimetypes
from tornado.httpclient import AsyncHTTPClient
from tornado.ioloop import IOLoop
from tornado.stack_context import NullContext
from tornado.escape import json_encode
from tornado import web
from tornado.web import HTTPError
from torext.utils import raise_exc_info
from torext.compat import SimpleCookie, quote, urlencode, httplib
        return resp

    def get(self, *args, **kwgs):
        return self.request('GET', *args, **kwgs)

    def delete(self, *args, **kwgs):
        return self.request('DELETE', *args, **kwgs)

    def post(self, *args, **kwgs):
        return self.request('POST', *args, **kwgs)

    def put(self, *args, **kwgs):
        return self.request('PUT', *args, **kwgs)

    def patch(self, *args, **kwgs):
        return self.request('PATCH', *args, **kwgs)

    def get_protocol(self):
        return 'http'

    def get_http_port(self):
        return self.app.settings['PORT']

    def get_url(self, path):
        """Returns an absolute url for the given path on the test server."""
        return '%s://localhost:%s%s' % (self.get_protocol(),
                                        self.get_http_port(), path)

    def get_handler_exc(self):
        if self._handler_exc_info:

# Path: torext/utils.py
# def generate_cookie_secret():
# def timesince(t):
# def pprint(o):
#     def instance(cls, *args, **kwgs):
# def split_kwargs(kwgs_tuple, kwgs):
#     def __getattr__(self, key):
#     def __setattr__(self, key, value):
#     def __delattr__(self, key):
#     def __str__(self):
# def _resolve_name(name, package, level):
# def import_module(name, package=None):
# def add_to_syspath(pth, relative_to=None):
# def start_shell(extra_vars=None):
#         def complete(self, text, state):
# def fix_request_arguments(arguments):
#     def __init__(self, local, name=None):
#     def get_current_object(self):
#     def __dict__(self):
#     def __repr__(self):
#     def __bool__(self):
#     def __unicode__(self):
#     def __dir__(self):
#     def __getattr__(self, name):
#     def __setitem__(self, key, value):
#     def __delitem__(self, key):
#     def __setslice__(self, i, j, seq):
#     def __delslice__(self, i, j):
# class SingletonMixin(object):
# class ObjectDict(dict):
#     class CustomCompleter(rlcompleter.Completer):
# class LocalProxy(object):
# 
# Path: torext/compat.py
# PY3 = sys.version_info.major == 3
# PY2 = sys.version_info.major == 2
#     def unicode_(s, *args):
#     def decode_(s, *args):
#     def bytes_(s):
#     def str_(s):
#     def unicode_(s, *args):
#     def decode_(s, *args):
#     def bytes_(s):
#     def str_(s):


# Path: torext/testing.py
import sys
import time
import unittest
import logging
import mimetypes
from tornado.httpclient import AsyncHTTPClient
from tornado.ioloop import IOLoop
from tornado.stack_context import NullContext
from tornado.escape import json_encode
from tornado import web
from tornado.web import HTTPError
from torext.utils import raise_exc_info
from torext.compat import SimpleCookie, quote, urlencode, httplib

        return resp

    def get(self, *args, **kwgs):
        return self.request('GET', *args, **kwgs)

    def delete(self, *args, **kwgs):
        return self.request('DELETE', *args, **kwgs)

    def post(self, *args, **kwgs):
        return self.request('POST', *args, **kwgs)

    def put(self, *args, **kwgs):
        return self.request('PUT', *args, **kwgs)

    def patch(self, *args, **kwgs):
        return self.request('PATCH', *args, **kwgs)

    def get_protocol(self):
        return 'http'

    def get_http_port(self):
        return self.app.settings['PORT']

    def get_url(self, path):
        """Returns an absolute url for the given path on the test server."""
        return '%s://localhost:%s%s' % (self.get_protocol(),
                                        self.get_http_port(), path)

    def get_handler_exc(self):
        if self._handler_exc_info:

            raise_exc_info(self._handler_exc_info)