def clear_state(dict_in):
    """Clear the state information for a given dictionary.

    Parameters
    ----------
    dict_in : obj
        Input dictionary to be cleared.

    """
    if not isinstance(dict_in,dict):
        return dict_in

    for k,v in dict_in.items():
        if isinstance(v,dict):
            dict_in[k] =  clear_state(v)
        if k == 'state':
            dict_in[k] = None
    return dict_in