def coerce_kw_type(kw, key, type_, flexi_bool=True):

    if key in kw and type(kw[key]) is not type_ and kw[key] is not None:
        if type_ is bool and flexi_bool:
            kw[key] = asbool(kw[key])
        else:
            kw[key] = type_(kw[key])
If 'key' is present in dict 'kw', coerce its value to type 'type_' if
dataset/ETHPy150Open ralfonso/theory/theory/model/mpdutil.py/coerce_kw_type