code: def apply_roll_with_offset_gap(
      window: Series,
      gap_offset: str,
      reducer_fn: Callable[[Series], float],
      min_periods: int,
  ) -> float:
      """Takes in a series to which an offset gap will be applied, removing however many
      rows fall under the gap before applying the reducing function.
  
      Args:
          window (Series):  A rolling window that includes both the window length and gap spans of time.
          gap_offset (string): The pandas offset alias that determines how much time at the end of the window
              should be removed.
          reducer_fn (callable[Series -> float]): The function to be applied to the window in order to produce
              the aggregate that will be included in the resulting feature.
          min_periods (int): Minimum number of observations required for performing calculations
              over the window.
  
      Returns:
          float: The aggregate value to be used as a feature value.
      """
      window = _get_rolled_series_without_gap(window, gap_offset)
  
      if min_periods is None:
          min_periods = 1
  
      if len(window) < min_periods or not len(window):
          return np.nan
  
      return reducer_fn(window)
  
file_path: featuretools/featuretools/primitives/standard/transform/time_series/utils.py
imports: from typing import Callable, Optional, Union
  import numpy
  import pandas
  from pandas import Series
  from pandas.core.window.rolling import Rolling
  from pandas.tseries.frequencies import to_offset
label_desc: Use image node_id 3 for calling a global function with example usage: apply_roll_with_offset_gap(window, gap_offset, reducer_fn, min_periods) and returns: reducer_fn, np