def deep_merge(defaults, overrides):
    """
    Deep merges two dictionaries.

    If the value is None in `overrides`, that key-value pair will not show up in the final result.
    """
    merged = {}
    for key in defaults:
        if isinstance(defaults[key], dict):
            if key not in overrides:
                merged[key] = defaults[key]
            elif overrides[key] is None:
                continue
            elif isinstance(overrides[key], dict):
                merged[key] = deep_merge(defaults[key], overrides[key])
            else:
                raise Exception("Types must match")
        elif key in overrides and overrides[key] is None:
            continue
        elif key in overrides:
            merged[key] = overrides[key]
        else:
            merged[key] = defaults[key]
    return merged