<s> import numpy as np <EOL> def suggest ( new_ids , domain , trials , seed , p_suggest ) : <EOL> """<STR_LIT>""" <EOL> rng = np . random . RandomState ( seed ) <EOL> ps , suggests = zip ( * p_suggest ) <EOL> assert len ( ps ) == len ( suggests ) == len ( p_suggest ) <EOL> if not np . isclose ( sum ( ps ) , <NUM_LIT:1.0> ) : <EOL> raise ValueError ( '<STR_LIT>' , ps ) <EOL> idx = rng . multinomial ( n = <NUM_LIT:1> , pvals = ps ) . argmax ( ) <EOL> return suggests [ idx ] ( new_ids , domain , trials , <EOL> seed = int ( rng . randint ( <NUM_LIT:2> ** <NUM_LIT> ) ) ) </s>
