def _weighted_formula(form, weight_func):
for e, mf in form.items():<EOL><INDENT>if e == Atom.H:<EOL><INDENT>continue<EOL><DEDENT>yield e, mf, weight_func(e)<EOL><DEDENT>
Yield weight of each formula element.