def set_target(self, stream):
with self.lock:<EOL><INDENT>if self._stream:<EOL><INDENT>raise ValueError("<STR_LIT>")<EOL><DEDENT>self._stream = stream<EOL>self._reader = StreamReader(stream)<EOL><DEDENT>
Make the `stream` the target for this transport instance.

        The 'stream_start', 'stream_end' and 'stream_element' methods
        of the target will be called when appropriate content is received.

        :Parameters:
            - `stream`: the stream handler to receive stream content
              from the transport
        :Types:
            - `stream`: `StreamBase`