code: def build_switcher(
      items=None,
      label="",
      initial_selection=0,
      on_prev_clicked=lambda _selected_value: None,
      on_next_clicked=lambda _selected_value: None,
      on_value_changed=lambda _selected_idx, _selected_value: None,
  ):
      """Create horizon theme switcher.
  
      Parameters
      ----------
      items : list, optional
          dictionaries with keys 'label' and 'value'. Label will be used to show
          it to user and value will be used for selection.
      label : str, optional
          label for the switcher.
      initial_selection : int, optional
          index of the selected item initially.
      on_prev_clicked : callback, optional
          method providing a callback when prev value is selected in switcher.
      on_next_clicked : callback, optional
          method providing a callback when next value is selected in switcher.
      on_value_changed : callback, optional
          method providing a callback when either prev or next value selected in
          switcher.
  
      Returns
      -------
      HorizonCombineElement(
          label: HorizonUIElement,
          element(switcher): HorizonUIElement)
  
      Notes
      -----
      switcher: consists 'obj' which is an array providing FURY UI elements used.
      """
      if items is None:
          warnings.warn("No items passed in switcher")
          return
  
      num_items = len(items)
  
      if initial_selection >= num_items:
          initial_selection = 0
  
      switch_label = build_label(text=label, is_horizon_label=True)
      selection_label = build_label(
          text=items[initial_selection]["label"]
      )
  
      left_button = ui.Button2D(
          icon_fnames=[
              ("left", read_viz_icons(fname="circle-left.png"))
          ],
          size=(25, 25),
      )
      right_button = ui.Button2D(
          icon_fnames=[
              ("right", read_viz_icons(fname="circle-right.png"))
          ],
          size=(25, 25),
      )
  
      switcher = HorizonUIElement(
          True,
          [initial_selection, items[initial_selection]["value"]],
          [left_button, selection_label, right_button],
      )
  
      def left_clicked(_i_ren, _obj, _button):
          selected_id = switcher.selected_value[0] - 1
          if selected_id < 0:
              selected_id = num_items - 1
          value_changed(selected_id)
          on_prev_clicked(items[selected_id]["value"])
          on_value_changed(selected_id, items[selected_id]["value"])
  
      def right_clicked(_i_ren, _obj, _button):
          selected_id = switcher.selected_value[0] + 1
          if selected_id >= num_items:
              selected_id = 0
          value_changed(selected_id)
          on_next_clicked(items[selected_id]["value"])
          on_value_changed(selected_id, items[selected_id]["value"])
  
      def value_changed(selected_id):
          switcher.selected_value[0] = selected_id
          switcher.selected_value[1] = items[selected_id]["value"]
          selection_label.message = items[selected_id]["label"]
  
      left_button.on_left_mouse_button_clicked = left_clicked
      right_button.on_left_mouse_button_clicked = right_clicked
  
      return (switch_label, switcher)
  
imports: from typing import Any
  from dataclasses import dataclass
  import warnings
  from abc import ABC, abstractmethod
  import numpy
  from dipy.utils.optpkg import optional_package
label_desc: Use image node_id 4 for calling a global function with example usage: build_switcher(items, label, initial_selection, on_prev_clicked, on_next_clicked, on_value_changed) and returns: switch_label,  switcher