<s> import getopt <EOL> import sys <EOL> import time <EOL> import urllib2 <EOL> BLOCK_SIZE = <NUM_LIT> <EOL> label = None <EOL> opts , args = getopt . gnu_getopt ( sys . argv [ <NUM_LIT:1> : ] , "<STR_LIT>" ) <EOL> for o , a in opts : <EOL> if o == "<STR_LIT>" : <EOL> label = a <EOL> try : <EOL> stream = urllib2 . urlopen ( args [ <NUM_LIT:0> ] , timeout = <NUM_LIT:100> ) <EOL> start_time = time . time ( ) <EOL> while stream . read ( BLOCK_SIZE ) : <EOL> pass <EOL> end_time = time . time ( ) <EOL> if label : <EOL> print "<STR_LIT>" % ( label , end_time - start_time ) <EOL> else : <EOL> print "<STR_LIT>" % ( end_time - start_time ) <EOL> except : <EOL> if label : <EOL> print "<STR_LIT>" % label <EOL> else : <EOL> print "<STR_LIT:error>" </s>
