code: def _select_slider(
      self,
      label: str,
      options: OptionSequence[T] = (),
      value: object = None,
      format_func: Callable[[Any], Any] = str,
      key: Optional[Key] = None,
      help: Optional[str] = None,
      on_change: Optional[WidgetCallback] = None,
      args: Optional[WidgetArgs] = None,
      kwargs: Optional[WidgetKwargs] = None,
      disabled: bool = False,
      label_visibility: LabelVisibility = "visible",
      ctx: Optional[ScriptRunContext] = None,
  ) -> Union[T, Tuple[T, T]]:
      key = to_key(key)
      check_callback_rules(self.dg, on_change)
      check_session_state_rules(default_value=value, key=key)
      maybe_raise_label_warnings(label, label_visibility)
      opt = ensure_indexable(options)
      check_python_comparable(opt)
  
      if len(opt) == 0:
          raise StreamlitAPIException(
              "The `options` argument needs to be non-empty"
          )
  
      def as_index_list(v: object) -> List[int]:
          if _is_range_value(v):
              slider_value = [index_(opt, val) for val in v]
              start, end = slider_value
              if start > end:
                  slider_value = [end, start]
              return slider_value
          else:
              # Simplify future logic by always making value a list
              try:
                  return [index_(opt, v)]
              except ValueError:
                  if value is not None:
                      raise
  
                  return [0]
  
      # Convert element to index of the elements
      slider_value = as_index_list(value)
  
      id = compute_widget_id(
          "select_slider",
          user_key=key,
          label=label,
          options=[str(format_func(option)) for option in opt],
          value=slider_value,
          key=key,
          help=help,
          form_id=current_form_id(self.dg),
          page=ctx.page_script_hash if ctx else None,
      )
  
      slider_proto = SliderProto()
      slider_proto.id = id
      slider_proto.type = SliderProto.Type.SELECT_SLIDER
      slider_proto.label = label
      slider_proto.format = "%s"
      slider_proto.default[:] = slider_value
      slider_proto.min = 0
      slider_proto.max = len(opt) - 1
      slider_proto.step = 1  # default for index changes
      slider_proto.data_type = SliderProto.INT
      slider_proto.options[:] = [
          str(format_func(option)) for option in opt
      ]
      slider_proto.form_id = current_form_id(self.dg)
      slider_proto.disabled = disabled
      slider_proto.label_visibility.value = (
          get_label_visibility_proto_value(label_visibility)
      )
      if help is not None:
          slider_proto.help = dedent(help)
  
      serde = SelectSliderSerde(
          opt, slider_value, _is_range_value(value)
      )
  
      widget_state = register_widget(
          "slider",
          slider_proto,
          user_key=key,
          on_change_handler=on_change,
          args=args,
          kwargs=kwargs,
          deserializer=serde.deserialize,
          serializer=serde.serialize,
          ctx=ctx,
      )
      if isinstance(widget_state.value, tuple):
          widget_state = maybe_coerce_enum_sequence(
              cast(RegisterWidgetResult[Tuple[T, T]], widget_state),
              options,
              opt,
          )
      else:
          widget_state = maybe_coerce_enum(widget_state, options, opt)
  
      if widget_state.value_changed:
          slider_proto.value[:] = serde.serialize(widget_state.value)
          slider_proto.set_value = True
  
      self.dg._enqueue("slider", slider_proto)
      return widget_state.value
  
imports: from dataclasses import dataclass
  from textwrap import dedent
  from typing import TYPE_CHECKING, Any, Callable, Generic, List, Optional, Sequence, Tuple, Union, cast
  from typing_extensions import TypeGuard
  from streamlit.elements.form import current_form_id
  from streamlit.elements.utils import check_callback_rules, check_session_state_rules, get_label_visibility_proto_value, maybe_coerce_enum, maybe_coerce_enum_sequence
  from streamlit.errors import StreamlitAPIException
  from streamlit.proto.Slider_pb2 import Slider
  from streamlit.runtime.metrics_util import gather_metrics
  from streamlit.runtime.scriptrunner import ScriptRunContext, get_script_run_ctx
  from streamlit.runtime.state import WidgetArgs, WidgetCallback, WidgetKwargs, register_widget
  from streamlit.runtime.state.common import RegisterWidgetResult, compute_widget_id
  from streamlit.type_util import Key, LabelVisibility, OptionSequence, T, check_python_comparable, ensure_indexable, maybe_raise_label_warnings, to_key
  from streamlit.util import index_
label_desc: Use image node_id 2 for calling the SelectSliderMixin obj's underlying member method code with example usage: obj._select_slider(label, options, value, format_func, key, help, on_change, args, kwargs, disabled, label_visibility, ctx) and returns: widget_state, slider_value, list, list