def _merge_dict(result, overrides):
    """ Deep-merge dictionaries.

    :arg dict result: The resulting dictionary
    :arg dict overrides: Dictionay being merged into the result

    :returns:
        The resulting dictionary

    """
    for key in overrides:
        if (
            key in result and
            isinstance(result[key], dict) and
            isinstance(overrides[key], dict)
        ):
            _merge_dict(result[key], overrides[key])
        else:
            result[key] = overrides[key]
    return result