# 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 copy
import logging
import time
from datetime import datetime
from bson.objectid import ObjectId
from turbo.util import escape as es, camel_to_underscore, basestring_type as basestring, unicode_type
from util import unittest
        )).__name__ == 'list'
        )

        # error test
        self.assertTrue(type(es.json_decode(
            es.json_encode(es.to_str(self.values), invlaid=4)
        )).__name__ == 'NoneType'
        )

    def test_to_list_str(self):
        [self.check_value_type(v) for v in es.to_list_str(self.values)]

    def test_camel_to_underscore(self):
        self.assertEqual(camel_to_underscore('HelloWorld'), 'hello_world')

    def check_value_type(self, v):
        if isinstance(v, list):
            [self.check_value_type(v1) for v1 in v]
            return

        if isinstance(v, dict):
            [self.check_value_type(v1) for k1, v1 in v.items()]
            return

        self.assertTrue(self.check_base_value_type(v))

    def log(self, msg):
        logging.info(msg)

    def check_base_value_type(self, v):

# 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/escape_test.py
import copy
import logging
import time
from datetime import datetime
from bson.objectid import ObjectId
from turbo.util import escape as es, camel_to_underscore, basestring_type as basestring, unicode_type
from util import unittest

        )).__name__ == 'list'
        )

        # error test
        self.assertTrue(type(es.json_decode(
            es.json_encode(es.to_str(self.values), invlaid=4)
        )).__name__ == 'NoneType'
        )

    def test_to_list_str(self):
        [self.check_value_type(v) for v in es.to_list_str(self.values)]

    def test_camel_to_underscore(self):
        self.assertEqual(camel_to_underscore('HelloWorld'), 'hello_world')

    def check_value_type(self, v):
        if isinstance(v, list):
            [self.check_value_type(v1) for v1 in v]
            return

        if isinstance(v, dict):
            [self.check_value_type(v1) for k1, v1 in v.items()]
            return

        self.assertTrue(self.check_base_value_type(v))

    def log(self, msg):
        logging.info(msg)

    def check_base_value_type(self, v):

        return isinstance(v, int) or isinstance(v, float) or isinstance(v, basestring) or v is None