<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def tag_dict(obj, *args, **kwargs):
 """Create a TaggedDict instance. Will either be a TaggedOrderedDict or TaggedPlainDict depending on the type of `obj`."""


    if isinstance(obj, OrderedDict):
        return _TaggedOrderedDict(obj, *args, **kwargs)
    else:
        return _TaggedPlainDict(obj, *args, **kwargs)