code: def test_stream_to_dataframe(stream):
      df = cudf.DataFrame({"x": [1, 2, 3], "y": [4, 5, 6]})
      source = stream
      L = (
          source.to_dataframe(example=df)
          .x.sum()
          .stream.gather()
          .sink_to_list()
      )
  
      source.emit(df)
      source.emit(df)
      source.emit(df)
  
      assert L == [6, 12, 18]
  
imports: import json
  import operator
  import numpy
  import pandas
  import pytest
  from dask.dataframe.utils import assert_eq
  from distributed import Client
  from streamz import Stream
  from streamz.dask import DaskStream
  from streamz.dataframe import Aggregation, DataFrame, DataFrames, Series
label_desc: Use image node_id 22 for calling a global function with example usage: test_stream_to_dataframe(stream) without return types