code: def _iter_valid_subtotal_dicts(self):
          
          for insertion_dict in self._insertion_dicts:
              # ---skip any non-dicts---
              if not isinstance(insertion_dict, dict):
                  continue
  
              # ---skip any non-subtotal insertions---
              if insertion_dict.get("function") != "subtotal":
                  continue
  
              # ---skip any malformed subtotal-dicts---
              if not {"anchor", "args", "name"}.issubset(insertion_dict.keys()):
                  continue
  
              # ---skip if doesn't reference at least one non-missing element---
              if not self._element_ids.intersection(insertion_dict["args"]):
                  continue
  
              # ---an insertion-dict that successfully runs this gauntlet
              # ---is a valid subtotal dict
              yield insertion_dict
docs: Generate each insertion dict that represents a valid subtotal.