Skip to content

Instantly share code, notes, and snippets.

@AlecTaylor
Last active June 6, 2018 14:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save AlecTaylor/5ba250a6a254c753cb8217137a5e8746 to your computer and use it in GitHub Desktop.
Save AlecTaylor/5ba250a6a254c753cb8217137a5e8746 to your computer and use it in GitHub Desktop.
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