code: def moving_hudson_fst(ac1, ac2, size, start=0, stop=None, step=None):
      
  
      # calculate per-variant values
      num, den = hudson_fst(ac1, ac2, fill=np.nan)
  
      # compute the numerator and denominator in moving windows
      num_sum = moving_statistic(num, statistic=np.nansum, size=size,
                                 start=start, stop=stop, step=step)
      den_sum = moving_statistic(den, statistic=np.nansum, size=size,
                                 start=start, stop=stop, step=step)
  
      # calculate fst in each window
      fst = num_sum / den_sum
  
      return fst
docs: Estimate average Fst in moving windows over a single chromosome/contig,
      following the method of Hudson (1992) elaborated by Bhatia et al. (2013).
  
      Parameters
      ----------
      ac1 : array_like, int, shape (n_variants, n_alleles)
          Allele counts array from the first population.
      ac2 : array_like, int, shape (n_variants, n_alleles)
          Allele counts array from the second population.
      size : int
          The window size (number of variants).
      start : int, optional
          The index at which to start.
      stop : int, optional
          The index at which to stop.
      step : int, optional
          The number of variants between start positions of windows. If not
          given, defaults to the window size, i.e., non-overlapping windows.
  
      Returns
      -------
      fst : ndarray, float, shape (n_windows,)
          Average Fst in each window.