code: def test_periodic_dataframes():
      pd = pytest.importorskip("pandas")
      from streamz.dataframe import PeriodicDataFrame
      from streamz.dataframe.core import random_datapoint
  
      df = random_datapoint(now=pd.Timestamp.now())
      assert len(df) == 1
  
      def callback(now, **kwargs):
          return pd.DataFrame(dict(x=50, index=[now]))
  
      df = PeriodicDataFrame(callback, interval="20ms")
      assert df.tail(0).x == 50
      df.stop()
  
imports: import pytest
  import toolz
  from streamz.batch import Batch, Streaming
  from streamz.utils_test import inc
label_desc: Use image node_id 3 for calling a global function with example usage: test_periodic_dataframes() and returns: pd