<s> import thread <EOL> from diesel . util . queue import Queue <EOL> from diesel import fork_from_thread <EOL> def put_stream_token ( q , line ) : <EOL> q . put ( line ) <EOL> def consume_stream ( stream , q ) : <EOL> while True : <EOL> line = stream . readline ( ) <EOL> fork_from_thread ( put_stream_token , q , line ) <EOL> if line == '<STR_LIT>' : <EOL> break <EOL> def create_line_input_stream ( fileobj ) : <EOL> q = Queue ( ) <EOL> thread . start_new_thread ( consume_stream , ( fileobj , q ) ) <EOL> return q </s>
