def _initialize():
    global _initialized

    def _init_simplejson():
        global _decode, _encode
        import simplejson
        _decode = lambda string, loads=simplejson.loads: loads(string)
        _encode = lambda obj, dumps=simplejson.dumps: \
            dumps(obj, allow_nan=False, ensure_ascii=False)

    def _init_cjson():
        global _decode, _encode
        import cjson
        _decode = lambda string, decode=cjson.decode: decode(string)
        _encode = lambda obj, encode=cjson.encode: encode(obj)

    def _init_stdlib():
        global _decode, _encode
        json = __import__('json', {}, {})

        def _decode(string_, loads=json.loads):
            if isinstance(string_, util.btype):
                string_ = string_.decode("utf-8")
            return loads(string_)

        _encode = lambda obj, dumps=json.dumps: \
            dumps(obj, allow_nan=False, ensure_ascii=False)

    if _using == 'simplejson':
        _init_simplejson()
    elif _using == 'cjson':
        warnings.warn("Builtin cjson support is deprecated. Please use the "
                      "default or provide custom decode/encode functions "
                      "[2011-11-09].",
                      DeprecationWarning, stacklevel=1)
        _init_cjson()
    elif _using == 'json':
        _init_stdlib()
    elif _using != 'custom':
        try:
            _init_simplejson()
        except __HOLE__:
            _init_stdlib()
    _initialized = True
dataset/ETHPy150Open djc/couchdb-python/couchdb/json.py/_initialize