# Path: turbo/app.py
# class Mixin(tornado.web.RequestHandler):
# class BaseBaseHandler(Mixin):
# class BaseHandler(BaseBaseHandler):
# class ErrorHandler(tornado.web.RequestHandler):
#     def to_objectid(objid):
#     def to_int(value):
#     def to_float(value):
#     def to_bool(value):
#     def to_str(v):
#     def utf8(v):
#     def encode_http_params(**kw):
#     def json_encode(data, **kwargs):
#     def json_decode(data, **kwargs):
#     def is_ajax(self):
#     def initialize(self):
#     def session(self):
#     def get_template_namespace(self):
#     def render_string(self, template_name, **kwargs):
#     def sort_by(self, sort):
#     def get_context(self):
#     def wo_json(self, data):
#     def ri_json(self, data):
#     def parameter(self):
#         def filter_parameter(key, tp, default=None):
#     def head(self, *args, **kwargs):
#     def get(self, *args, **kwargs):
#     def post(self, *args, **kwargs):
#     def delete(self, *args, **kwargs):
#     def patch(self, *args, **kwargs):
#     def put(self, *args, **kwargs):
#     def options(self, *args, **kwargs):
#     def _method_call(self, method, *args, **kwargs):
#     def init_resp(code=0, msg=None):
#     def wo_resp(self, resp):
#     def HEAD(self, *args, **kwargs):
#     def GET(self, *args, **kwargs):
#     def POST(self, *args, **kwargs):
#     def DELETE(self, *args, **kwargs):
#     def PATCH(self, *args, **kwargs):
#     def PUT(self, *args, **kwargs):
#     def OPTIONS(self, *args, **kwargs):
#     def route(self, route, *args, **kwargs):
#     def on_finish(self):
#     def _processor(self):
#     def initialize(self, status_code):
#     def prepare(self):
# def start(port=8888):
# 
# Path: turbo/register.py
# def _install_app(package_space):
# def register_app(app_name, app_setting, web_application_setting, mainfile, package_space):
# def register_url(url, handler, name=None, kwargs=None):
# def register_group_urls(prefix, urls):
# 
# Path: turbo/conf.py
# class ObjectDict(dict):
# class AppConfig(object):
#     def __getattr__(self, name):
#         def __setattr__(self, name, value):
#     def __init__(self):
#     def log_level(self):
# 
# Path: turbo/util.py
# PY3 = sys.version_info >= (3,)
# _UTF8_TYPES = (bytes, type(None))
# _BASESTRING_TYPES = (basestring_type, type(None))
# def to_list_str(value, encode=None):
# def to_dict_str(origin_value, encode=None):
# def default_encode(v):
# def to_str(v, encode=None):
# def format_time(dt):
# def to_objectid(objid):
# def json_encode(data, **kwargs):
# def json_decode(data, **kwargs):
# def to_int(value, default=None):
# def to_float(value, default=None):
# def to_datetime(t, micro=False):
# def to_time(t, micro=False):
#     def __init__(self, module):
#     def __getattr__(self, name):
# def get_base_dir(currfile, dir_level_num=3):
# def join_sys_path(currfile, dir_level_num=3):
# def import_object(name, package_space=None):
# def camel_to_underscore(name):
# def remove_folder(path, foldername):
# def remove_file(path, filename):
# def remove_extension(path, extension):
# def build_index(model_list):
# def utf8(value):
# def to_basestring(value):
# def get_func_name(func):
# class Escape(object):


import multiprocessing
import os
import signal
import requests
from bson.objectid import ObjectId
from turbo import app
from turbo import register
from turbo.conf import app_config
from turbo.util import  basestring_type as basestring
from util import unittest, port_is_used, get_free_tcp_port

class ApiHandler(app.BaseHandler):

    _get_required_params = [
        ('skip', int, 0),
        ('limit', int, 20),
    ]

    _get_params = {
        'need': [
            ('action', None),
        ],
        'option': [
            ('who', basestring, 'python'),
            ('str_key', str, 'python'),
            ('bool', bool, False),
            ('int', int, 0),
            ('float', float, 0),
            ('objectid', ObjectId, None),
            ('list', list, []),
        ]
    }

    _post_required_params = [
        ('skip', int, 0),
        ('limit', int, 20),
    ]

    _post_params = {
        'need': [

# Path: turbo/app.py
# class Mixin(tornado.web.RequestHandler):
# class BaseBaseHandler(Mixin):
# class BaseHandler(BaseBaseHandler):
# class ErrorHandler(tornado.web.RequestHandler):
#     def to_objectid(objid):
#     def to_int(value):
#     def to_float(value):
#     def to_bool(value):
#     def to_str(v):
#     def utf8(v):
#     def encode_http_params(**kw):
#     def json_encode(data, **kwargs):
#     def json_decode(data, **kwargs):
#     def is_ajax(self):
#     def initialize(self):
#     def session(self):
#     def get_template_namespace(self):
#     def render_string(self, template_name, **kwargs):
#     def sort_by(self, sort):
#     def get_context(self):
#     def wo_json(self, data):
#     def ri_json(self, data):
#     def parameter(self):
#         def filter_parameter(key, tp, default=None):
#     def head(self, *args, **kwargs):
#     def get(self, *args, **kwargs):
#     def post(self, *args, **kwargs):
#     def delete(self, *args, **kwargs):
#     def patch(self, *args, **kwargs):
#     def put(self, *args, **kwargs):
#     def options(self, *args, **kwargs):
#     def _method_call(self, method, *args, **kwargs):
#     def init_resp(code=0, msg=None):
#     def wo_resp(self, resp):
#     def HEAD(self, *args, **kwargs):
#     def GET(self, *args, **kwargs):
#     def POST(self, *args, **kwargs):
#     def DELETE(self, *args, **kwargs):
#     def PATCH(self, *args, **kwargs):
#     def PUT(self, *args, **kwargs):
#     def OPTIONS(self, *args, **kwargs):
#     def route(self, route, *args, **kwargs):
#     def on_finish(self):
#     def _processor(self):
#     def initialize(self, status_code):
#     def prepare(self):
# def start(port=8888):
# 
# Path: turbo/register.py
# def _install_app(package_space):
# def register_app(app_name, app_setting, web_application_setting, mainfile, package_space):
# def register_url(url, handler, name=None, kwargs=None):
# def register_group_urls(prefix, urls):
# 
# Path: turbo/conf.py
# class ObjectDict(dict):
# class AppConfig(object):
#     def __getattr__(self, name):
#         def __setattr__(self, name, value):
#     def __init__(self):
#     def log_level(self):
# 
# Path: turbo/util.py
# PY3 = sys.version_info >= (3,)
# _UTF8_TYPES = (bytes, type(None))
# _BASESTRING_TYPES = (basestring_type, type(None))
# def to_list_str(value, encode=None):
# def to_dict_str(origin_value, encode=None):
# def default_encode(v):
# def to_str(v, encode=None):
# def format_time(dt):
# def to_objectid(objid):
# def json_encode(data, **kwargs):
# def json_decode(data, **kwargs):
# def to_int(value, default=None):
# def to_float(value, default=None):
# def to_datetime(t, micro=False):
# def to_time(t, micro=False):
#     def __init__(self, module):
#     def __getattr__(self, name):
# def get_base_dir(currfile, dir_level_num=3):
# def join_sys_path(currfile, dir_level_num=3):
# def import_object(name, package_space=None):
# def camel_to_underscore(name):
# def remove_folder(path, foldername):
# def remove_file(path, filename):
# def remove_extension(path, extension):
# def build_index(model_list):
# def utf8(value):
# def to_basestring(value):
# def get_func_name(func):
# class Escape(object):


# Path: tests/app_test.py
import multiprocessing
import os
import signal
import requests
from bson.objectid import ObjectId
from turbo import app
from turbo import register
from turbo.conf import app_config
from turbo.util import  basestring_type as basestring
from util import unittest, port_is_used, get_free_tcp_port


class ApiHandler(app.BaseHandler):

    _get_required_params = [
        ('skip', int, 0),
        ('limit', int, 20),
    ]

    _get_params = {
        'need': [
            ('action', None),
        ],
        'option': [
            ('who', basestring, 'python'),
            ('str_key', str, 'python'),
            ('bool', bool, False),
            ('int', int, 0),
            ('float', float, 0),
            ('objectid', ObjectId, None),
            ('list', list, []),
        ]
    }

    _post_required_params = [
        ('skip', int, 0),
        ('limit', int, 20),
    ]

    _post_params = {
        'need': [

            ('who', basestring),