Load Json from file. If file are not exists, returns ``default``.

    :param abspath: File path. Use absolute path as much as you can. File 
        extension has to be ``.json`` or ``.gz``. (for compressed Json)
    :type abspath: string

    :param default: (default dict()) If ``abspath`` not exists, return the 
        default Python object instead.

    :param compress: (default False) Load from a gzip compressed Json file.
        Check :func:`dump_js()<dump_js>` function for more information.
    :type compress: boolean
    
    :param enable_verbose: (default True) Trigger for message.
    :type enable_verbose: boolean

    Usage::

        >>> from weatherlab.lib.dataIO.js import load_js
        >>> load_js("test.json") # if you have a json file
        Loading from test.json...
            Complete! Elapse 0.000432 sec.
        {'a': 1, 'b': 2}

    **中文文档**

    从Json文件中读取数据

    参数列表
    
    :param abspath: 文件路径, 扩展名需为 ``.json`` 或 ``.gz``
    :type abspath: ``字符串``

    :param default: (默认 dict()) 如果文件路径不存在, 则会返回一个默认的Python对象。
    
    :param compress: (默认 False) 是否从一个gzip压缩过的Json文件中读取数据。 请
        参考 :func:`dump_js()<dump_js>` 获得更多信息.
    :type compress: ``布尔值``

    :param enable_verbose: (默认 True) 是否打开信息提示开关, 批处理时建议关闭.
    :type enable_verbose: ``布尔值``

def load_js(abspath, default=dict(), compress=False, enable_verbose=True):
    """Load Json from file. If file are not exists, returns ``default``.

    :param abspath: File path. Use absolute path as much as you can. File 
        extension has to be ``.json`` or ``.gz``. (for compressed Json)
    :type abspath: string

    :param default: (default dict()) If ``abspath`` not exists, return the 
        default Python object instead.

    :param compress: (default False) Load from a gzip compressed Json file.
        Check :func:`dump_js()<dump_js>` function for more information.
    :type compress: boolean
    
    :param enable_verbose: (default True) Trigger for message.
    :type enable_verbose: boolean

    Usage::

        >>> from weatherlab.lib.dataIO.js import load_js
        >>> load_js("test.json") # if you have a json file
        Loading from test.json...
            Complete! Elapse 0.000432 sec.
        {'a': 1, 'b': 2}

    **中文文档**

    从Json文件中读取数据

    参数列表
    
    :param abspath: 文件路径, 扩展名需为 ``.json`` 或 ``.gz``
    :type abspath: ``字符串``

    :param default: (默认 dict()) 如果文件路径不存在, 则会返回一个默认的Python对象。
    
    :param compress: (默认 False) 是否从一个gzip压缩过的Json文件中读取数据。 请
        参考 :func:`dump_js()<dump_js>` 获得更多信息.
    :type compress: ``布尔值``

    :param enable_verbose: (默认 True) 是否打开信息提示开关, 批处理时建议关闭.
    :type enable_verbose: ``布尔值``
    """
    abspath = str(abspath) # try stringlize
    
    if compress: # check extension name
        if os.path.splitext(abspath)[1] != ".gz":
            raise Exception("compressed json has to use extension '.gz'!")
    else:
        if os.path.splitext(abspath)[1] != ".json":
            raise Exception("file extension are not '.json'!")

    if enable_verbose:
        print("\nLoading from %s..." % abspath)
        st = time.clock()
        
    if os.path.exists(abspath): # exists, then load
        if compress:
            with gzip.open(abspath, "rb") as f:
                js = json.loads(f.read().decode("utf-8"))
        else:
            with open(abspath, "r") as f:
                js = json.load(f)
        if enable_verbose:
            print("\tComplete! Elapse %.6f sec." % (time.clock() - st) )
        return js
    
    else:
        if enable_verbose:
            print("\t%s not exists! cannot load! Create an default object "
                  "instead" % abspath)
        return default