code: def test_from_iterable_stop():
      from _pytest.outcomes import Failed
  
      source = Source.from_iterable(range(5))
      L = source.rate_limit(0.01).sink_to_list()
      source.start()
  
      wait_for(lambda: L == [0], 1)
      source.stop()
  
      assert source.stopped
      with pytest.raises(Failed):
          wait_for(lambda: L == [0, 1, 2], 0.1)
  
file_path: streamz/streamz/tests/test_sources.py
imports: import asyncio
  import sys
  from flaky import flaky
  import pytest
  from streamz import Source
  from streamz.utils_test import wait_for, await_for, gen_test
  import socket
label_desc: Use image node_id 9 for calling a global function with example usage: test_from_iterable_stop() without return types