src/seals/util.py
def sample_distribution(
    p: np.ndarray,
    random: np.random.RandomState,
) -> int:
    """Samples an integer with probabilities given by p."""
    return random.choice(np.arange(len(p)), p=p)
Samples an integer with probabilities given by p.
Samples an integer with probabilities given by p.
Samples an integer with probabilities given by p .
def sample_distribution(
    p: np.ndarray,
    random: np.random.RandomState,
) -> int:
    return random.choice(np.arange(len(p)), p=p)
def sample_distribution ( p : np . ndarray , random : np . random . RandomState , ) -> int : return random . choice ( np . arange ( len ( p ) ) , p = p )
Samples an integer with probabilities given by p.
Samples an integer with probabilities given by p .
"""Samples an integer with probabilities given by p."""
p
np.ndarray
random
np.random.RandomState