def scrub_class_and_module(doc):
    """
    This utility method scrubs a document of it's class and
    module entries.  Note that this works on the doc **in place**.

    Args:
        doc (dict): a nested dictionary to be scrubbed

    Returns:
        A nested dictionary with the module and class attributes
        removed from all subdocuments
    """
    if isinstance(doc, dict):
        return {k: scrub_class_and_module(v) for k, v in doc.items()
                if not k in ['@class', '@module']}
    elif isinstance(doc, list):
        return [scrub_class_and_module(k) for k in doc]
    else:
        return doc