code: def test_roll_series_with_gap(window_length, gap, window_series_pd):
      rolling_max = roll_series_with_gap(
          window_series_pd,
          window_length,
          gap=gap,
          min_periods=1,
      ).max()
      rolling_min = roll_series_with_gap(
          window_series_pd,
          window_length,
          gap=gap,
          min_periods=1,
      ).min()
  
      assert len(rolling_max) == len(window_series_pd)
      assert len(rolling_min) == len(window_series_pd)
  
      gap_num = get_number_from_offset(gap)
      window_length_num = get_number_from_offset(window_length)
      for i in range(len(window_series_pd)):
          start_idx = i - gap_num - window_length_num + 1
  
          if isinstance(gap, str):
              # No gap functionality is happening, so gap isn't taken account in the end index
              # it's like the gap is 0; it includes the row itself
              end_idx = i
          else:
              end_idx = i - gap_num
  
          # If start and end are negative, they're entirely before
          if start_idx < 0 and end_idx < 0:
              assert pd.isnull(rolling_max.iloc[i])
              assert pd.isnull(rolling_min.iloc[i])
              continue
  
          if start_idx < 0:
              start_idx = 0
  
          # Because the row values are a range from 0 to 20, the rolling min will be the start index
          # and the rolling max will be the end idx
          assert rolling_min.iloc[i] == start_idx
          assert rolling_max.iloc[i] == end_idx
  
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 5 for calling a global function with example usage: test_roll_series_with_gap(window_length, gap, window_series_pd) without return types