Last active
June 6, 2018 14:39
-
-
Save AlecTaylor/5ba250a6a254c753cb8217137a5e8746 to your computer and use it in GitHub Desktop.
This file contains 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
epoch2stat = { | |
key: val | |
for key, val in iteritems( | |
{ | |
k: tuple(imap(itemgetter(1), v)) | |
for k, v in groupby( | |
imap(lambda l: (l[0], l[1]), | |
ifilter(None, imap( | |
lambda l: (lambda fst: ( | |
lambda three: (int(three), l.rstrip()[l.rfind(':') + 2:]) | |
if three is not None and three.isdigit() and int(three[0]) < 4 else None)( | |
l[fst - 3:fst] if fst > -1 else None))(l.rfind(']')), infile) | |
)) | |
, itemgetter(0)) | |
}) | |
if val and len(val) == 2 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment