def scale_joint_sfs_folded(s, n1, n2):
    """Scale a folded joint site frequency spectrum.

    Parameters
    ----------
    s : array_like, int, shape (m_chromosomes//2, n_chromosomes//2)
        Folded joint site frequency spectrum.
    n1, n2 : int, optional
        The total number of chromosomes called in each population.

    Returns
    -------
    joint_sfs_folded_scaled : ndarray, int, shape (m_chromosomes//2, n_chromosomes//2)
        Scaled folded joint site frequency spectrum.

    """  # noqa
    out = np.empty_like(s)
    for i in range(s.shape[0]):
        for j in range(s.shape[1]):
            out[i, j] = s[i, j] * i * j * (n1 - i) * (n2 - j)
    return out
Scale a folded joint site frequency spectrum.

    Parameters
    ----------
    s : array_like, int, shape (m_chromosomes//2, n_chromosomes//2)
        Folded joint site frequency spectrum.
    n1, n2 : int, optional
        The total number of chromosomes called in each population.

    Returns
    -------
    joint_sfs_folded_scaled : ndarray, int, shape (m_chromosomes//2, n_chromosomes//2)
        Scaled folded joint site frequency spectrum.