<s> import sys <EOL> def escape_html ( s ) : return s . replace ( '<STR_LIT:&>' , '<STR_LIT>' ) . replace ( '<STR_LIT:<>' , '<STR_LIT>' ) . replace ( '<STR_LIT:>>' , '<STR_LIT>' ) <EOL> def cutoff ( s , n = <NUM_LIT:100> ) : <EOL> if len ( s ) > n : return s [ : n ] + '<STR_LIT>' <EOL> return s <EOL> def handler ( environ , start_response ) : <EOL> writer = start_response ( "<STR_LIT>" , [ ( '<STR_LIT>' , '<STR_LIT>' ) ] ) <EOL> response_parts = [ ] <EOL> response_parts . append ( "<STR_LIT>" ) <EOL> response_parts . append ( "<STR_LIT>" ) <EOL> response_parts . append ( "<STR_LIT>" ) <EOL> response_parts . append ( "<STR_LIT>" ) <EOL> response_parts . append ( "<STR_LIT>" ) <EOL> response_parts . append ( "<STR_LIT>" % ( sys . version , sys . platform ) ) <EOL> response_parts . append ( "<STR_LIT>" ) <EOL> response_parts . append ( "<STR_LIT>" ) <EOL> environ_str = "<STR_LIT>" <EOL> keys = environ . keys ( ) <EOL> keys . sort ( ) <EOL> for ix , name in enumerate ( keys ) : <EOL> if ix % <NUM_LIT:2> : <EOL> background = '<STR_LIT>' <EOL> else : <EOL> background = '<STR_LIT>' <EOL> style = "<STR_LIT>" % background <EOL> value = escape_html ( cutoff ( str ( environ [ name ] ) ) ) or '<STR_LIT>' <EOL> environ_str = "<STR_LIT>" % ( environ_str , style , name , style , value ) <EOL> environ_str = "<STR_LIT>" % environ_str <EOL> response_parts . append ( environ_str ) <EOL> response_parts . append ( "<STR_LIT>" ) <EOL> response_parts . append ( "<STR_LIT>" ) <EOL> response_text = "<STR_LIT:\n>" . join ( response_parts ) <EOL> return [ response_text ] </s>
