code: def test_process_str():
      cmd = 'python -c "for i in range(4): print(i)"'
      s = Source.from_process(cmd)
      if sys.platform != "win32":
          # don't know why - something with pytest and new processes
          policy = asyncio.get_event_loop_policy()
          watcher = asyncio.SafeChildWatcher()
          policy.set_child_watcher(watcher)
          watcher.attach_loop(s.loop.asyncio_loop)
      out = s.sink_to_list()
      s.start()
      yield await_for(
          lambda: out == [b"0\n", b"1\n", b"2\n", b"3\n"], timeout=5
      )
      s.stop()
  
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 6 for calling a global function with example usage: test_process_str() without return types