import collections
import codecs
import json


def load_json(filename):
    """
    load json file and return dict, order in the file is reserved

    :param: filename: input filename
    """

    ret_dict = collections.OrderedDict()
    with codecs.open(filename, "r", "utf-8") as f:
        ret_dict = json.load(f, object_pairs_hook=collections.OrderedDict)
    return ret_dict