def merge(base, overrider):
    """ Override base dict with an overrider dict, recursively. """
    for key, value in overrider.items():
        if isinstance(value, dict):
            subitem = base.setdefault(key, {})
            merge(subitem, value)
        else:
            base[key] = value

    return base