def dump(data_structure):
identity_set = set()<EOL>dup_set      = set()<EOL>def dump_helper(data_structure):<EOL><INDENT>if data_structure is None:<EOL><INDENT>return None<EOL><DEDENT>if isinstance(data_structure, _primitive_types):<EOL><INDENT>return data_structure<EOL><DEDENT>idd = id(data_structure)<EOL>if idd in identity_set:<EOL><INDENT>tlen = -<NUM_LIT:1><EOL>try:<EOL><INDENT>tlen = len(data_structure)<EOL><DEDENT>except:  <EOL><INDENT>pass<EOL><DEDENT>if tlen != -<NUM_LIT:1>:<EOL><INDENT>if (<EOL>hasattr(data_structure, "<STR_LIT>") or<EOL>hasattr(data_structure, "<STR_LIT>")<EOL>):<EOL><INDENT>dup_set.add(idd)<EOL>return "<STR_LIT>" % (type(data_structure), idd)<EOL><DEDENT>if not isinstance(<EOL>data_structure,<EOL>_ignore_types<EOL>):  <EOL><INDENT>dup_set.add(idd)<EOL>return "<STR_LIT>" % (type(data_structure), idd)<EOL><DEDENT><DEDENT>else:<EOL><INDENT>dup_set.add(idd)<EOL>return "<STR_LIT>" % (type(data_structure), idd)<EOL><DEDENT><DEDENT>else:<EOL><INDENT>identity_set.add(idd)<EOL><DEDENT>ret = Meta()<EOL>ret.append(IDD(data_structure, idd))<EOL>was_dict = isinstance(data_structure, WasDict)<EOL>was_tuple = isinstance(data_structure, tuple)<EOL>if not was_dict:<EOL><INDENT>if hasattr(data_structure, "<STR_LIT>"):<EOL><INDENT>data_structure = dict(object_to_items(data_structure))<EOL>was_dict = True<EOL><DEDENT>else:<EOL><INDENT>try:<EOL><INDENT>data_structure = data_structure.__dict__<EOL>was_dict = True<EOL><DEDENT>except:<EOL><INDENT>pass<EOL><DEDENT><DEDENT><DEDENT>try:<EOL><INDENT>data_structure = data_structure.items()<EOL>ret.append(dict([<EOL>(dump_helper(x[<NUM_LIT:0>]), dump_helper(x[<NUM_LIT:1>]))<EOL>for x in data_structure<EOL>]))<EOL>return ret<EOL><DEDENT>except:<EOL><INDENT>pass<EOL><DEDENT>tlen = -<NUM_LIT:1><EOL>try:<EOL><INDENT>tlen = len(data_structure)<EOL><DEDENT>except:  <EOL><INDENT>pass<EOL><DEDENT>if tlen != -<NUM_LIT:1>:<EOL><INDENT>try:<EOL><INDENT>if was_dict:<EOL><INDENT>ret.append(WasDict([<EOL>(dump_helper(x[<NUM_LIT:0>]), dump_helper(x[<NUM_LIT:1>]))<EOL>for x in data_structure<EOL>]))<EOL><DEDENT>elif was_tuple:<EOL><INDENT>ret.append(tuple([<EOL>dump_helper(x) for x in data_structure<EOL>]))<EOL><DEDENT>else:<EOL><INDENT>ret.append([<EOL>dump_helper(x) for x in data_structure<EOL>])<EOL><DEDENT>return ret<EOL><DEDENT>except:  <EOL><INDENT>pass<EOL><DEDENT><DEDENT>ret.append(data_structure)  <EOL>return ret  <EOL><DEDENT>def clean_up(data_structure):<EOL><INDENT>if isinstance(data_structure, Meta):<EOL><INDENT>idd_temp = data_structure[<NUM_LIT:0>]<EOL>idd_temp.is_target = idd_temp.idd in dup_set<EOL>if not (<EOL>idd_temp.is_target or<EOL>idd_temp.is_visible<EOL>):<EOL><INDENT>del data_structure[<NUM_LIT:0>]<EOL><DEDENT>if len(data_structure) == <NUM_LIT:1>:<EOL><INDENT>data_structure = data_structure[<NUM_LIT:0>]<EOL><DEDENT><DEDENT>if not isinstance(data_structure, _string_types):<EOL><INDENT>tlen = -<NUM_LIT:1><EOL>try:<EOL><INDENT>tlen = len(data_structure)<EOL><DEDENT>except:<EOL><INDENT>pass<EOL><DEDENT>if tlen != -<NUM_LIT:1>:<EOL><INDENT>if isinstance(data_structure, dict):<EOL><INDENT>for k in data_structure.keys():<EOL><INDENT>data_structure[k] = clean_up(data_structure[k])<EOL><DEDENT><DEDENT>elif isinstance(data_structure, Meta):<EOL><INDENT>data_structure = Meta([<EOL>clean_up(x) for x in data_structure<EOL>])<EOL><DEDENT>elif isinstance(data_structure, tuple):<EOL><INDENT>data_structure = tuple([<EOL>clean_up(x) for x in data_structure<EOL>])<EOL><DEDENT>else:<EOL><INDENT>data_structure = [<EOL>clean_up(x) for x in data_structure<EOL>]<EOL><DEDENT><DEDENT><DEDENT>return data_structure<EOL><DEDENT>data = clean_up(dump_helper(data_structure))<EOL>return data<EOL>
Dump will create a human readable version of your data-structure.
    It will try to dump almost anything, it has recursion detection and
    will try to display the recursion in a meaningful way.

    :param   data_structure: The structure to convert.

    When you freeze only content counts, same content same hash

    >>> a = hash(freeze(_TestClass(True)))
    >>> b = hash(freeze(_TestClass(True)))
    >>> b == a
    True

    >>> a = freeze(_TestClass(True))
    >>> b = freeze(_TestClass(True))
    >>> b == a
    True

    >>> x = _TestClass(True)
    >>> a = freeze(dump(x))
    >>> b = freeze(dump(x))
    >>> b == a
    True

    When you dump-freeze only content/type counts, same content/type same hash

    - Two object of the same type with same content will be equal

    - Two object of the different type with same content will be different

    >>> a = hash(freeze(dump(_TestClass(True))))
    >>> b = hash(freeze(dump(_TestClass(True))))
    >>> b == a
    True

    >>> a = freeze(dump(_TestClass(True)))
    >>> b = freeze(dump(_TestClass(True)))
    >>> b == a
    True

    >>> a = hash(freeze(dump(_TestClass(True))))
    >>> b = hash(freeze(dump(_TestClass2(True))))
    >>> b != a
    True

    >>> a = freeze(dump(_TestClass(True)))
    >>> b = freeze(dump(_TestClass2(True)))
    >>> b != a
    True

    >>> _py2_to_py3(vformat(dump([1, {'a' : 'b'}])))
    [1,
     ["<class 'dict'>",
      {'a': 'b'}]]

    >>> vformat(recursive_sort(dump(_TestClass(True))))
    ["<class 'freeze.xfreeze._TestClass'>",
     (('a',
       'huhu'),
      ('sub',
       ["<class 'freeze.xfreeze._TestSlots'>",
        (('a',
          'slot'),
         ('b',
          (1,
           (1,
            2,
            3),
           2,
           3)))]))]

    >>> a = _TestSlots()
    >>> b = [a, 1, 2, [a, "banane"]]
    >>> _no_null_x(vformat(dump(b)))
      {'a': 'slot',
       'b': [1,
             2,
             3,
             (1,
              2,
              3)]}],
     1,
     2,
      'banane']]

    >>> a = [1, 2]
    >>> _no_null_x(vformat(dump((a, (a, a)))))
    ([1,
      2],
     ([1,
       2],
      [1,
       2]))

    >>> recursive_sort(dump(freeze(_TestClass(True))))
    (('a', 'huhu'), ((('a', 'slot'), ('b', (1, (1, 2, 3), 2, 3))), 'sub'))

    >>> dump((None, (None, None)))
    (None, (None, None))

    >>> s = _TestClassWithLen()
    >>> a = [s, s]
    >>> _no_null_x(vformat(dump(a)))
      {'a': 'huhu'}],

    >>> s = (1, 2)
    >>> a = [s, s]
    >>> _no_null_x(vformat(dump(a)))
    [(1,
      2),
     (1,
      2)]