def clean_doc(doc):
    """
    Clean given JSON document from keys where its value is None
    :param doc: Pure, dirty JSON
    :return: Cleaned JSON document
    """
    for key, value in list(doc.items()):
        if value is None:
            del doc[key]
        elif isinstance(value, dict):
            clean_doc(value)
    return doc