def get_prefixed_subdict(token, dict):
    """Returns the sub-dictionary of the given dictionary, creating an empty one
    if necessary."""

    # Example: DELTET/DELTA_T_A = 32.184

    # Look up or create the DELTET sub-dictionary
    try:
        subdict = dict[token]
        if type(subdict) == type({}):
            return dict[token]
    except KeyError:
        pass

    dict[token] = {}
    return dict[token]