def __init__(self, K, pi=None, psi=None, mu=None, Sigma=None):
        assert isinstance(K, int) and K >= 2, "K must be an integer >= 2"
        self.K = K

        assert pi is not None or psi is not None or None not in (mu, Sigma), \
            "pi, psi, or (mu and Sigma) must be specified"

        if pi is not None:
            assert isinstance(pi, np.ndarray) and \
                   pi.shape == (K,) and \
                   np.allclose(pi.sum(), 1.0), \
                "Pi must be a normalized length-K vector"
            self.pi = pi

        if psi is not None:
            assert isinstance(psi, np.ndarray) and \
                   psi.shape == (K-1,), \
                "Psi must be a length-K vector of reals"
            self.psi = psi

        if None not in (mu, Sigma):
            assert isinstance(mu, np.ndarray) and mu.shape == (K,), \
                "Mu must be a length-K vector"

            assert isinstance(Sigma, np.ndarray) and Sigma.shape == (K,K), \
                "Sigma must be a KxK Covariance matrix"
            self.mu = mu
            self.Sigma = Sigma
            self.Lambda = np.linalg.inv(Sigma)

            # If psi and pi have not been given, sample from the prior
            if psi is None and pi is None:
                self.psi = np.random.multivariate_normal(self.mu, self.Sigma)

        # Initialize Polya-gamma augmentation variables
        self.ppgs   = initialize_polya_gamma_samplers()
        self.omega = np.ones(self.K)

        # Initialize the space for the transformed psi variables, rho
        self.rho = np.zeros(self.K)
Invoked on entering a `with` block.
dataset/ETHPy150Open HIPS/pgmult/pgmult/distributions.py/PGLogisticNormalMultinomial.__init__--crossover with--dataset/ETHPy150Open d11wtq/dockerpty/dockerpty/pty.py/WINCHHandler.__enter__