<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def sort_by_formula_id(raw_datasets):
 """ Sort a list of formulas by `id`, where `id` represents the accepted formula id. Parameters raw_datasets : list of dictionaries A list of raw datasets. Examples -------- The parameter `raw_datasets` has to be of the format """

    by_formula_id = defaultdict(list)
    for el in raw_datasets:
        by_formula_id[el['handwriting'].formula_id].append(el['handwriting'])
    return by_formula_id