code: def _clean_dic(self, dic):
          
          aux_dic = dic.copy()
          for key, value in iter(dic.items()):
  
              if value is None or value == '':
                  del aux_dic[key]
              elif type(value) is dict:
                  cleaned_dict = self._clean_dic(value)
                  if not cleaned_dict:
                      del aux_dic[key]
                      continue
                  aux_dic[key] = cleaned_dict
          return aux_dic
docs: Clean recursively all empty or None values inside a dict.