code: def test_expanding_count_series(window_series_pd, min_periods, gap):
      test = window_series_pd.shift(gap)
      expected = test.expanding(min_periods=min_periods).count()
      num_nans = gap + min_periods - 1
      expected[range(num_nans)] = np.nan
      primitive_instance = ExpandingCount(
          min_periods=min_periods, gap=gap
      ).get_function()
      actual = primitive_instance(window_series_pd.index)
      pd.testing.assert_series_equal(pd.Series(actual), expected)
  
file_path: featuretools/featuretools/tests/primitive_tests/transform_primitive_tests/test_expanding_primitives.py
imports: import numpy
  import pandas
  import pytest
  from featuretools.primitives.standard.transform.time_series.expanding import ExpandingCount, ExpandingMax, ExpandingMean, ExpandingMin, ExpandingSTD, ExpandingTrend
  from featuretools.primitives.standard.transform.time_series.utils import _apply_gap_for_expanding_primitives
  from featuretools.utils import calculate_trend
label_desc: Use image node_id 1 for calling a global function with example usage: test_expanding_count_series(window_series_pd, min_periods, gap) without return types