code: def test_groupby_windowing_n(func, n, getter, grouper, indexer):
      df = cudf.DataFrame(
          {"x": np.arange(10, dtype=float), "y": [1.0, 2.0] * 5}
      )
  
      sdf = DataFrame(example=df)
  
      def f(x):
          return func(indexer(x.groupby(grouper(x))))
  
      L = f(sdf.window(n=n)).stream.gather().sink_to_list()
  
      diff = 3
      for i in range(0, 10, diff):
          sdf.emit(df.iloc[i : i + diff])
      sdf.emit(df.iloc[:0])
  
      assert len(L) == 5
  
      first = df.iloc[max(0, diff - n) : diff]
  
      g = f(first)
      assert_eq(L[0], g)
  
      last = df.iloc[len(df) - n :]
      h = f(last)
      assert_eq(L[-1], h)
  
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 35 for calling a global function with example usage: test_groupby_windowing_n(func, n, getter, grouper, indexer) and returns: func