remove the keys with None values.

def clean_dict(d):
    """ remove the keys with None values. """
    ktd = list()
    for k, v in d.items():
        if not v:
            ktd.append(k)
        elif type(v) is dict:
            d[k] = clean_dict(v)
    for k in ktd:
        d.pop(k)
    return d