code: def test_multiple_selection():
      smw = widgets.SelectMultiple
  
      # degenerate multiple select
      w = smw()
      check_widget(w, value=tuple())
  
      # don't accept random other value when no options
      with pytest.raises(TraitError):
          w.value = (2,)
      check_widget(w, value=tuple())
  
      # basic multiple select
      w = smw(options=[(1, 1)], value=[1])
      check_widget(w, cls=smw, value=(1,), options=((1, 1),))
  
      # don't accept random other value
      with pytest.raises(TraitError):
          w.value = w.value + (2,)
      check_widget(w, value=(1,))
  
      # change options, which resets value
      w.options = w.options + ((2, 2),)
      check_widget(w, options=((1, 1), (2, 2)), value=())
  
      # change value
      w.value = (1, 2)
      check_widget(w, value=(1, 2))
  
      # dict style
      w.options = {1: 1}
      check_widget(w, options={1: 1})
  
      # updating
      with pytest.raises(TraitError):
          w.value = (2,)
      check_widget(w, options={1: 1})
  
imports: from __future__ import print_function
  import os
  from collections import OrderedDict
  import pytest
  import ipywidgets
  from traitlets import TraitError
  from ipywidgets import interact, interact_manual, interactive, interaction, Output
  from ipython_genutils.py3compat import annotate
  from .utils import setup, teardown
label_desc: Use image node_id 42 for calling a global function with example usage: test_multiple_selection() without return types