<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def link(self, stream_instance):
 """Set my input stream"""

        if isinstance(stream_instance, collections.Iterable):
            self.input_stream = stream_instance
        elif getattr(stream_instance, 'output_stream', None):
            self.input_stream = stream_instance.output_stream
        else:
            raise RuntimeError('Calling link() with unknown instance type %s' % type(stream_instance))