# 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):


from turbo.util import basestring_type, unicode_type, PY3, to_basestring
    from urllib.parse import quote
    from urllib import quote
from __future__ import absolute_import, division, print_function, with_statement


if PY3:
else:


def is_empty(v):
    if isinstance(v, basestring_type):
        if not v:
            return True
    if v is None:
        return True

    return False


def utf8(v):
    return v.encode('utf-8') if isinstance(v, unicode_type) else str(v)


def encode_http_params(**kw):
    '''
    url paremeter encode
    '''
    try:
        _fo = lambda k, v: '{name}={value}'.format(
            name=k, value=to_basestring(quote(v)))
    except:

# 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: turbo/httputil.py
from turbo.util import basestring_type, unicode_type, PY3, to_basestring
    from urllib.parse import quote
    from urllib import quote

from __future__ import absolute_import, division, print_function, with_statement


if PY3:
else:


def is_empty(v):
    if isinstance(v, basestring_type):
        if not v:
            return True
    if v is None:
        return True

    return False


def utf8(v):
    return v.encode('utf-8') if isinstance(v, unicode_type) else str(v)


def encode_http_params(**kw):
    '''
    url paremeter encode
    '''
    try:
        _fo = lambda k, v: '{name}={value}'.format(
            name=k, value=to_basestring(quote(v)))
    except:

        _fo = lambda k, v: '%s=%s' % (k, to_basestring(quote(v)))