def del_none(d):
    '\n  Delete dict keys with None values, and empty lists, recursively.\n  '
    for (key, value) in d.items():
        if ((value is None) or (isinstance(value, list) and (len(value) == 0))):
            del d[key]
        elif isinstance(value, dict):
            del_none(value)
    return d
Delete dict keys with None values, and empty lists, recursively.
def del_none(d):
    '\n  \n  '
    for (key, value) in d.items():
        if ((value is None) or (isinstance(value, list) and (len(value) == 0))):
            del d[key]
        elif isinstance(value, dict):
            del_none(value)
    return d