# Path: netjsonconfig/utils.py
# def get_copy(dict_, key, default=None):
#     """
#     Looks for a key in a dictionary, if found returns
#     a deepcopied value, otherwise returns default value
#     """
#     value = dict_.get(key, default)
#     if value:
#         return deepcopy(value)
#     return value
# 
# def sorted_dict(dict_):
#     return OrderedDict(sorted(dict_.items()))


from collections import OrderedDict
from ...utils import get_copy, sorted_dict
            if key not in properties:
                continue
            try:
                json_type = properties[key]['type']
            except KeyError:
                json_type = None
            # if multiple types are supported, the first
            # one takes precedence when parsing
            if isinstance(json_type, list) and json_type:
                json_type = json_type[0]
            if json_type == 'integer' and not isinstance(value, int):
                value = int(value)
            elif json_type == 'boolean' and not isinstance(value, bool):
                value = value == '1'
            item[key] = value
        return item

    def get_copy(self, dict_, key, default=None):
        return get_copy(dict_, key, default)

    def sorted_dict(self, dict_):
        return sorted_dict(dict_)

    def to_intermediate(self):
        """
        Converts the NetJSON configuration dictionary (``self.config``)
        to intermediate data structure (``self.intermediate_datra``)
        """
        result = OrderedDict()
        # copy netjson dictionary

# Path: netjsonconfig/utils.py
# def get_copy(dict_, key, default=None):
#     """
#     Looks for a key in a dictionary, if found returns
#     a deepcopied value, otherwise returns default value
#     """
#     value = dict_.get(key, default)
#     if value:
#         return deepcopy(value)
#     return value
# 
# def sorted_dict(dict_):
#     return OrderedDict(sorted(dict_.items()))


# Path: netjsonconfig/backends/base/converter.py
from collections import OrderedDict
from ...utils import get_copy, sorted_dict

            if key not in properties:
                continue
            try:
                json_type = properties[key]['type']
            except KeyError:
                json_type = None
            # if multiple types are supported, the first
            # one takes precedence when parsing
            if isinstance(json_type, list) and json_type:
                json_type = json_type[0]
            if json_type == 'integer' and not isinstance(value, int):
                value = int(value)
            elif json_type == 'boolean' and not isinstance(value, bool):
                value = value == '1'
            item[key] = value
        return item

    def get_copy(self, dict_, key, default=None):
        return get_copy(dict_, key, default)

    def sorted_dict(self, dict_):
        return sorted_dict(dict_)

    def to_intermediate(self):
        """
        Converts the NetJSON configuration dictionary (``self.config``)
        to intermediate data structure (``self.intermediate_datra``)
        """
        result = OrderedDict()
        # copy netjson dictionary

        netjson = get_copy(self.netjson, self.netjson_key)