code: def test_roll_series_with_gap_early_values(
      window_length, gap, window_series_pd
  ):
      gap_num = get_number_from_offset(gap)
      window_length_num = get_number_from_offset(window_length)
  
      # Default min periods is 1 - will include all
      default_partial_values = roll_series_with_gap(
          window_series_pd,
          window_length,
          gap=gap,
          min_periods=1,
      ).count()
      num_empty_aggregates = len(
          default_partial_values.loc[default_partial_values == 0]
      )
      num_partial_aggregates = len(
          (default_partial_values.loc[default_partial_values != 0]).loc[
              default_partial_values < window_length_num
          ],
      )
  
      assert num_partial_aggregates == window_length_num - 1
      if isinstance(gap, str):
          # gap isn't handled, so we'll always at least include the row itself
          assert num_empty_aggregates == 0
      else:
          assert num_empty_aggregates == gap_num
  
      # Make min periods the size of the window
      no_partial_values = roll_series_with_gap(
          window_series_pd,
          window_length,
          gap=gap,
          min_periods=window_length_num,
      ).count()
      num_null_aggregates = len(
          no_partial_values.loc[pd.isna(no_partial_values)]
      )
      num_partial_aggregates = len(
          no_partial_values.loc[no_partial_values < window_length_num],
      )
  
      # because we shift, gap is included as nan values in the series.
      # Count treats nans in a window as values that don't get counted,
      # so the gap rows get included in the count for whether a window has "min periods".
      # This is different than max, for example, which does not count nans in a window as values towards "min periods"
      assert num_null_aggregates == window_length_num - 1
      if isinstance(gap, str):
          # gap isn't handled, so we'll never have any partial aggregates
          assert num_partial_aggregates == 0
      else:
          assert num_partial_aggregates == gap_num
  
imports: from unittest.mock import patch
  import numpy
  import pandas
  import pytest
  from featuretools.primitives import RollingCount, RollingMax, RollingMean, RollingMin, RollingSTD, RollingTrend
  from featuretools.primitives.standard.transform.time_series.utils import _get_rolled_series_without_gap, apply_roll_with_offset_gap, roll_series_with_gap
  from featuretools.tests.primitive_tests.utils import get_number_from_offset
label_desc: Use image node_id 7 for calling a global function with example usage: test_roll_series_with_gap_early_values(window_length, gap, window_series_pd) without return types