<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def cast_pars_dict(pars_dict):
 """Cast the bool and float elements of a parameters dict to the appropriate python types. """


    o = {}

    for pname, pdict in pars_dict.items():

        o[pname] = {}

        for k, v in pdict.items():

            if k == 'free':
                o[pname][k] = bool(int(v))
            elif k == 'name':
                o[pname][k] = v
            else:
                o[pname][k] = float(v)

    return o