code: def test_expanding_count_date_range(
      window_date_range_pd, min_periods, gap
  ):
      test = _apply_gap_for_expanding_primitives(
          gap=gap, x=window_date_range_pd
      )
      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_date_range_pd)
      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 2 for calling a global function with example usage: test_expanding_count_date_range(window_date_range_pd, min_periods, gap) without return types