<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def unflatten(d, splitter='tuple', inverse=False):
 """Unflatten dict-like object. Parameters d: dict-like object The dict that will be unflattened. splitter: {'tuple', 'path', function} (default: 'tuple') The key splitting method. If a function is given, the function will be used to split. 'tuple': Use each element in the tuple key as the key of the unflattened dict. 'path': Use ``pathlib.Path.parts`` to split keys. inverse: bool (default: False) Whether you want to invert the key and value before flattening. Returns ------- unflattened_dict: dict """

    if isinstance(splitter, str):
        splitter = SPLITTER_DICT[splitter]

    unflattened_dict = {}
    for flat_key, value in six.viewitems(d):
        if inverse:
            flat_key, value = value, flat_key
        key_tuple = splitter(flat_key)
        nested_set_dict(unflattened_dict, key_tuple, value)

    return unflattened_dict