def to_consistent_data_structure(obj):
    """obj could be set, dictionary, list, tuple or nested of them.
    This function will convert all dictionaries inside the obj to be list of tuples (sorted by key),
    will convert all set inside the obj to be list (sorted by to_consistent_data_structure(value))

    >>> to_consistent_data_structure([
        {"a" : 3, "b": 4},
        ( {"e" : 5}, (6, 7)
        ),
        set([10, ]),
        11
    ])

    Out[2]: [[('a', 3), ('b', 4)], ([('e', 5)], (6, 7)), [10], 11]
    """

    if isinstance(obj, dict):
        return [(k, to_consistent_data_structure(v)) for k, v in sorted(list(obj.items()), key=lambda x: x[0])]
    elif isinstance(obj, set):
        return sorted([to_consistent_data_structure(v) for v in obj])
    elif isinstance(obj, list):
        return [to_consistent_data_structure(v) for v in obj]
    elif isinstance(obj, tuple):
        return tuple([to_consistent_data_structure(v) for v in obj])
    return obj