code: def clean_dict(d):
      
      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
docs: remove the keys with None values.