<s> """<STR_LIT>""" <EOL> import eventlet <EOL> from eventlet import wsgi <EOL> from eventlet . green import time <EOL> from urlparse import parse_qs <EOL> from random import random , choice <EOL> datas = [ '<STR_LIT:hello>' , '<STR_LIT>' ] <EOL> comparators = [ '<STR_LIT:<>' , '<STR_LIT:=>' , '<STR_LIT:>>' , '<STR_LIT:false>' ] <EOL> def parse_response ( env , start_response ) : <EOL> '''<STR_LIT>''' <EOL> delay = random ( ) <EOL> time . sleep ( delay / <NUM_LIT:10> ) <EOL> try : <EOL> params = parse_qs ( env [ '<STR_LIT>' ] ) <EOL> row_index = int ( params [ '<STR_LIT>' ] [ <NUM_LIT:0> ] ) <EOL> char_index = int ( params [ '<STR_LIT>' ] [ <NUM_LIT:0> ] ) - <NUM_LIT:1> <EOL> test_char = int ( params [ '<STR_LIT>' ] [ <NUM_LIT:0> ] ) <EOL> comparator = comparators . index ( params [ '<STR_LIT>' ] [ <NUM_LIT:0> ] ) - <NUM_LIT:1> <EOL> try : <EOL> sleep_int = float ( params [ '<STR_LIT>' ] . pop ( <NUM_LIT:0> ) ) <EOL> except KeyError : <EOL> sleep_int = <NUM_LIT:1> <EOL> current_character = datas [ row_index ] [ char_index ] <EOL> truth = ( cmp ( ord ( current_character ) , test_char ) == comparator ) <EOL> response = types [ env [ '<STR_LIT>' ] ] ( test_char , current_character , comparator , sleep_int , start_response , truth ) <EOL> return response <EOL> except : <EOL> start_response ( '<STR_LIT>' , [ ( '<STR_LIT:Content-Type>' , '<STR_LIT>' ) ] ) <EOL> return [ '<STR_LIT>' ] <EOL> def time_based_blind ( test_char , current_character , comparator , sleep_int , start_response , truth ) : <EOL> sleep_time = sleep_int * truth <EOL> time . sleep ( sleep_time ) <EOL> start_response ( '<STR_LIT>' , [ ( '<STR_LIT:Content-Type>' , '<STR_LIT>' ) ] ) <EOL> return [ '<STR_LIT>' ] <EOL> def boolean_based_error ( test_char , current_character , comparator , env , start_response , truth ) : <EOL> if truth : <EOL> start_response ( '<STR_LIT>' , [ ( '<STR_LIT:Content-Type>' , '<STR_LIT>' ) ] ) <EOL> return [ '<STR_LIT>' ] <EOL> else : <EOL> start_response ( '<STR_LIT>' , [ ( '<STR_LIT:Content-Type>' , '<STR_LIT>' ) ] ) <EOL> return [ '<STR_LIT>' ] <EOL> def boolean_based_size ( test_char , current_character , comparator , env , start_response , truth ) : <EOL> if truth : <EOL> start_response ( '<STR_LIT>' , [ ( '<STR_LIT:Content-Type>' , '<STR_LIT>' ) ] ) <EOL> return [ '<STR_LIT>' ] <EOL> else : <EOL> start_response ( '<STR_LIT>' , [ ( '<STR_LIT:Content-Type>' , '<STR_LIT>' ) ] ) <EOL> return [ '<STR_LIT>' ] <EOL> types = { '<STR_LIT>' : time_based_blind , '<STR_LIT>' : boolean_based_error , '<STR_LIT>' : boolean_based_size } <EOL> if __name__ == "<STR_LIT:__main__>" : <EOL> print "<STR_LIT:\n>" <EOL> print "<STR_LIT>" <EOL> print "<STR_LIT>" <EOL> print "<STR_LIT>" <EOL> print "<STR_LIT>" <EOL> print "<STR_LIT:\n>" <EOL> from sys import argv <EOL> import re <EOL> CHARSET = [ chr ( x ) for x in xrange ( <NUM_LIT:32> , <NUM_LIT> ) ] <EOL> rre = re . compile ( u'<STR_LIT>' ) <EOL> cre = re . compile ( u'<STR_LIT>' ) <EOL> rows = filter ( rre . match , argv ) <EOL> cols = filter ( cre . match , argv ) <EOL> if rows and cols : <EOL> rows = rows [ <NUM_LIT:0> ] <EOL> cols = cols [ <NUM_LIT:0> ] <EOL> CHARSET = [ chr ( x ) for x in xrange ( <NUM_LIT:32> , <NUM_LIT> ) ] <EOL> datas = [ ] <EOL> for asdf in range ( <NUM_LIT:5> ) : <EOL> datas . append ( "<STR_LIT>" ) <EOL> for fdsa in range ( <NUM_LIT:100> ) : <EOL> datas [ - <NUM_LIT:1> ] += choice ( CHARSET ) <EOL> wsgi . server ( eventlet . listen ( ( '<STR_LIT>' , <NUM_LIT> ) ) , parse_response ) </s>
