code: def test_kwswitch():
      i = Literal()
      ab = scope.kwswitch(i, k1="a", k2="b", err=scope.Raise(Exception))
      assert rec_eval(ab, memo={i: "k1"}) == "a"
      assert rec_eval(ab, memo={i: "k2"}) == "b"
      assert_raises(Exception, rec_eval, ab, memo={i: "err"})
  
imports: from hyperopt.pyll import base
  from hyperopt.pyll.base import Literal, as_apply, Apply, dfs, scope, rec_eval, p0, Lambda, clone_merge
  from nose import SkipTest
  from nose.tools import assert_raises
  import numpy
label_desc: Use image node_id 18 for calling a global function with example usage: test_kwswitch() without return types