code: def test_expanding():
      import dtale.views as views
  
      df, _ = views.format_data(
          pd.DataFrame({"B": [0, 1, 2, np.nan, 4]})
      )
      data_id, column_type = "1", "expanding"
      build_data_inst({data_id: df})
  
      cfg = {"col": "B", "periods": 2, "agg": "sum"}
      builder = ColumnBuilder(data_id, column_type, "B_expanding", cfg)
  
      def verify(col):
          assert col.isnull().sum() == 1
          return list(col.dropna().values) == [1.0, 3.0, 3.0, 7.0]
  
      verify_builder(builder, verify)
  
imports: import numpy
  import pandas
  import pytest
  import sklearn
  from numpy.random import randn
  from pkg_resources import parse_version
  from six import PY3
  import dtale.pandas_util
  from dtale.column_builders import ColumnBuilder, ZERO_STD_ERROR
  from tests.dtale import build_data_inst
label_desc: Use image node_id 19 for calling a global function with example usage: test_expanding() and returns: unknown