code: def test_periodic():
      s = Source.from_periodic(lambda: True)
      l = s.sink_to_list()
      assert s.stopped
      s.start()
      wait_for(lambda: l, 0.3, period=0.01)
      wait_for(lambda: len(l) > 1, 0.3, period=0.01)
      assert all(l)
  
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 1 for calling a global function with example usage: test_periodic() without return types