Created
November 11, 2011 07:43
-
-
Save dctrwatson/1357456 to your computer and use it in GitHub Desktop.
Flatten uniform depth nested dicts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
";" between domains | |
":" between domain and queues | |
"|" between queues | |
"?" between queue names and metrics | |
"," between metrics |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
gmail.com:active?640s=0,20s=0,320s=0,160s=0,1280+s=0,5s=3,40s=0,1280s=0,80s=0,10s=0,total=3|deferred?640s=0,20s=0,320s=0,160s=0,1280+s=0,5s=3,40s=0,1280s=0,80s=0,10s=0,total=3;aol.com:active?640s=0,20s=0,320s=0,160s=0,1280+s=0,5s=1,40s=0,1280s=0,80s=0,10s=0,total=1|deferred?640s=0,20s=0,320s=0,160s=0,1280+s=0,5s=1,40s=0,1280s=0,80s=0,10s=0,total=1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sample = { | |
'aol.com': { | |
'active': { | |
'10s': '0', | |
'1280+s': '0', | |
'1280s': '0', | |
'160s': '0', | |
'20s': '0', | |
'320s': '0', | |
'40s': '0', | |
'5s': '1', | |
'640s': '0', | |
'80s': '0', | |
'total': '1' | |
}, | |
'deferred': { | |
'10s': '0', | |
'1280+s': '0', | |
'1280s': '0', | |
'160s': '0', | |
'20s': '0', | |
'320s': '0', | |
'40s': '0', | |
'5s': '1', | |
'640s': '0', | |
'80s': '0', | |
'total': '1' | |
} | |
}, | |
'gmail.com': { | |
'active': { | |
'10s': '0', | |
'1280+s': '0', | |
'1280s': '0', | |
'160s': '0', | |
'20s': '0', | |
'320s': '0', | |
'40s': '0', | |
'5s': '3', | |
'640s': '0', | |
'80s': '0', | |
'total': '3'}, | |
'deferred': { | |
'10s': '0', | |
'1280+s': '0', | |
'1280s': '0', | |
'160s': '0', | |
'20s': '0', | |
'320s': '0', | |
'40s': '0', | |
'5s': '3', | |
'640s': '0', | |
'80s': '0', | |
'total': '3' | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment