code: def sfs(dac, n=None):
      
  
      # check input
      dac, n = _check_dac_n(dac, n)
  
      # need platform integer for bincount
      dac = dac.astype(int, copy=False)
  
      # compute site frequency spectrum
      x = n + 1
      s = np.bincount(dac, minlength=x)
  
      return s
docs: Compute the site frequency spectrum given derived allele counts at
      a set of biallelic variants.
  
      Parameters
      ----------
      dac : array_like, int, shape (n_variants,)
          Array of derived allele counts.
      n : int, optional
          The total number of chromosomes called.
  
      Returns
      -------
      sfs : ndarray, int, shape (n_chromosomes,)
          Array where the kth element is the number of variant sites with k
          derived alleles.