code: def sfs_folded(ac, n=None):
      
  
      # check input
      ac, n = _check_ac_n(ac, n)
  
      # compute minor allele counts
      mac = np.amin(ac, axis=1)
  
      # need platform integer for bincount
      mac = mac.astype(int, copy=False)
  
      # compute folded site frequency spectrum
      x = n//2 + 1
      s = np.bincount(mac, minlength=x)
  
      return s
docs: Compute the folded site frequency spectrum given reference and
      alternate allele counts at a set of biallelic variants.
  
      Parameters
      ----------
      ac : array_like, int, shape (n_variants, 2)
          Allele counts array.
      n : int, optional
          The total number of chromosomes called.
  
      Returns
      -------
      sfs_folded : ndarray, int, shape (n_chromosomes//2,)
          Array where the kth element is the number of variant sites with a
          minor allele count of k.