def __init__(self, stream_adapter, input_callback, window, close_adapter):
self.stream_adapter = stream_adapter<EOL>if not input_callback:<EOL><INDENT>self.input_callback = lambda _: None<EOL><DEDENT>else:<EOL><INDENT>self.input_callback = input_callback<EOL><DEDENT>self.window = window<EOL>self.close_adapter = close_adapter<EOL>
:param StreamAdapter stream_adapter: The :class:`StreamAdapter` object
    to receive data from.
:param function input_callback: Callback function with one parameter
    that is called each time new data is read from the
    *stream_adapter*.
:param int window: Number of historical objects (bytes, characters,
    etc.) to buffer.
:param bool close_adapter: If ``True``, and the Expecter is used as a
    context manager, closes the adapter at the end of the context
    manager.