@@ -0,0 +1,720 @@
+%0Adef flatten_dict(ddict):%0A    def get_keys(ddict, prefix=''):%0A        keys, vals = %5B%5D, %5B%5D%0A    %0A        for k,v in ddict.items():%0A            if isinstance(v, list) and not isinstance(v, str):%0A                v=dict((str(i), q) for i,q in enumerate(v))%0A            if isinstance(v, dict):%0A                prefix = prefix+'.' if prefix else ''%0A                kk, vv = get_keys(v,prefix+k)%0A                keys.extend(kk)%0A                vals.extend(vv)%0A            else:%0A                vals.append(v)%0A                if prefix:%0A                    keys.append(prefix+'.'+k)%0A                else:%0A                    keys.append(k)%0A        return keys, vals%0A%0A    k,v = get_keys(ddict)%0A    d = dict(zip(k,v))%0A    return d%0A

Create flatten.py