<s> import numpy as np <EOL> from collections import defaultdict <EOL> from itertools import chain <EOL> from gzip import GzipFile <EOL> dataset = [ [ int ( tok ) for tok in line . strip ( ) . split ( ) ] <EOL> for line in GzipFile ( '<STR_LIT>' ) ] <EOL> counts = defaultdict ( int ) <EOL> for elem in chain ( * dataset ) : <EOL> counts [ elem ] += <NUM_LIT:1> <EOL> counts = np . array ( list ( counts . values ( ) ) ) <EOL> bins = [ <NUM_LIT:1> , <NUM_LIT:2> , <NUM_LIT:4> , <NUM_LIT:8> , <NUM_LIT:16> , <NUM_LIT:32> , <NUM_LIT:64> , <NUM_LIT> , <NUM_LIT> ] <EOL> print ( '<STR_LIT>' . format ( '<STR_LIT>' , '<STR_LIT>' ) ) <EOL> print ( '<STR_LIT>' ) <EOL> for i in range ( len ( bins ) ) : <EOL> bot = bins [ i ] <EOL> top = ( bins [ i + <NUM_LIT:1> ] if ( i + <NUM_LIT:1> ) < len ( bins ) else <NUM_LIT> ) <EOL> print ( '<STR_LIT>' . format ( <EOL> bot , ( top if top < <NUM_LIT:1000> else '<STR_LIT>' ) , np . sum ( ( counts >= bot ) & ( counts < top ) ) ) ) </s>
