-
-
Save altendky/df74405c0f6d58fa2ca15bfcc7a3fe20 to your computer and use it in GitHub Desktop.
Revisions
-
altendky revised this gist
Jun 6, 2018 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -90,4 +90,4 @@ def b(grouped): yield (k, v) epoch2stat = dict(b(a())) -
altendky revised this gist
Jun 6, 2018 . 1 changed file with 50 additions and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -41,4 +41,53 @@ )) }) if val and len(val) == 2 } # ----- def a(): return groupby(sorted( 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, ), ), ), key=itemgetter(0), ), itemgetter(0), )) def b(grouped): for k, v in grouped: v = tuple(imap(itemgetter(1), v)) if len(v) == 2: yield (k, v) epoch2stat = b(a()) -
altendky revised this gist
Jun 6, 2018 . 1 changed file with 18 additions and 19 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -7,23 +7,22 @@ ) ) for k, v in groupby(sorted( 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 ) )( @@ -32,14 +31,14 @@ else None ) )(l.rfind(']')), infile, ), ), ), key=itemgetter(0), ), itemgetter(0), )) }) if val and len(val) == 2 } -
altendky revised this gist
Jun 6, 2018 . 1 changed file with 40 additions and 12 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,17 +1,45 @@ epoch2stat = { key: val for key, val in iteritems({ k: tuple( (lambda stats: stats)( tuple(imap(itemgetter(1), v)) ) ) for k, v in groupby(sorted( 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 ), ), ), key=itemgetter(0), ), itemgetter(0), ) }) if val and len(val) == 2 } -
AlecTaylor created this gist
Jun 6, 2018 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,17 @@ epoch2stat = { key: val for key, val in iteritems( { k: tuple((lambda stats: stats)(tuple(imap(itemgetter(1), v)))) for k, v in groupby(sorted(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) )), key=itemgetter(0)), itemgetter(0)) }) if val and len(val) == 2 }