<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _weighted_formula(form, weight_func):
 """Yield weight of each formula element."""

    for e, mf in form.items():
        if e == Atom.H:
            continue

        yield e, mf, weight_func(e)