<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _check_keys(dictionary):
 """ checks if entries in dictionary are mat-objects. If yes todict is called to change them to nested dictionaries """

    for key in dictionary:
        if isinstance(dictionary[key], matlab.mio5_params.mat_struct):
            dictionary[key] = _todict(dictionary[key])
    return dictionary