<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def recursive_sort(data_structure):
 """Sort a recursive data_structure. :param data_structure: The structure to convert. data_structure must be already sortable or you must use freeze() or dump(). The function will work with many kinds of input. Dictionaries will be converted to lists of tuples. (["<class 'dict'>", (('a', 'b'), ('b', 'a'), ('c', 'c'))], 1, 3) ((('a', 'b'), ('b', 'a'), ('c', 'c')), 1, 3) (('a', 'huhu'),) """

    # We don't sory primitve types
    if not isinstance(data_structure, _primitive_types):
        is_meta = isinstance(data_structure, Meta)
        was_dict = isinstance(data_structure, WasDict)
        if not (is_meta or was_dict):
            was_dict = isinstance(data_structure, dict)
            if not was_dict:
                # Dictize if possible (support objects)
                try:
                    data_structure = data_structure.__dict__
                    was_dict = True
                except:
                    pass
            # Itemize if possible
            try:
                data_structure = data_structure.items()
            except:
                pass
        tlen = -1
        # If item has a length we sort it
        try:
            tlen = len(data_structure)
        except:  # pragma: no cover
            pass
        if tlen != -1:
            # Well there are classes out in the wild that answer to len
            # but have no indexer.
            try:
                if was_dict:
                    return tuple(sorted(
                        [
                            (
                                recursive_sort(x[0]),
                                recursive_sort(x[1]),
                            )
                            for x in data_structure
                        ],
                        key=TraversalBasedReprCompare
                    ))
                elif is_meta:
                    return data_structure[0:-1] + [
                        recursive_sort(
                            data_structure[-1]
                        )
                    ]
                else:
                    return tuple(sorted(
                        [recursive_sort(
                            x,
                        ) for x in data_structure],
                        key=TraversalBasedReprCompare,
                    ))
            except:  # pragma: no cover
                pass
    return data_structure