code: def hp_pchoice(label, p_options):
      """
      label: string
      p_options: list of (probability, option) pairs
      """
      p, options = list(zip(*p_options))
      ch = scope.hyperopt_param(label, scope.categorical(p))
      return scope.switch(ch, *options)
  
imports: from functools import partial, wraps
  from .base import DuplicateLabel
  from .pyll.base import Apply, Literal, MissingArgument
  from .pyll import scope
  from .pyll import as_apply
label_desc: Use image node_id 4 for calling a global function with example usage: hp_pchoice(label, p_options) and returns: scope