code: def moving_haplotype_diversity(h, size, start=0, stop=None, step=None):
      
  
      hd = moving_statistic(values=h, statistic=haplotype_diversity, size=size,
                            start=start, stop=stop, step=step)
      return hd
docs: Estimate haplotype diversity in moving windows.
  
      Parameters
      ----------
      h : array_like, int, shape (n_variants, n_haplotypes)
          Haplotype array.
      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
      -------
      hd : ndarray, float, shape (n_windows,)
          Haplotype diversity.