@validate_label
def hp_pchoice(label, p_options):
 (p, options) = list(zip(*p_options))
 n_options = len(options)
 ch = scope.hyperopt_param(label, scope.categorical(p, upper=n_options))
 return scope.switch(ch, *options)

@ validate_label def hp_pchoice ( label , p_options ) : ( p , options ) = list ( zip ( * p_options ) ) n_options = len ( options ) ch = scope . hyperopt_param ( label , scope . categorical ( p , upper = n_options ) ) return scope . switch ( ch , * options )
label: string p_options: list of pairs .