flattenDict

support.dicts.flattenDict(dictionary, init=())

Converts nested dicts with numeric or str keys to flat dict with tuple keys.

For example, x[1][0][2] becomes xx[(1, 0, 2)].

Based on::

http://stackoverflow.com/questions/6027558/ flatten-nested-python-dictionaries-compressing-keys