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)
Create a TaggedDict instance. Will either be a TaggedOrderedDict
    or TaggedPlainDict depending on the type of `obj`.