@_with_element
def selectbox(self, element, label, options, index=0, format_func=str, key=None):
    "Display a select widget.\n\n        Parameters\n        ----------\n        label : str\n            A short label explaining to the user what this select widget is for.\n        options : list, tuple, numpy.ndarray, or pandas.Series\n            Labels for the select options. This will be cast to str internally\n            by default.\n        index : int\n            The index of the preselected option on first render.\n        format_func : function\n            Function to modify the display of the labels. It receives the option\n            as an argument and its output will be cast to str.\n        key : str\n            An optional string to use as the unique key for the widget.\n            If this is omitted, a key will be generated for the widget\n            based on its content. Multiple widgets of the same type may\n            not share the same key.\n\n        Returns\n        -------\n        any\n            The selected option\n\n        Example\n        -------\n        >>> option = st.selectbox(\n        ...     'How would you like to be contacted?',\n        ...     ('Email', 'Home phone', 'Mobile phone'))\n        >>>\n        >>> st.write('You selected:', option)\n\n        "
    if (not isinstance(index, int)):
        raise StreamlitAPIException(('Selectbox Value has invalid type: %s' % type(index).__name__))
    if ((len(options) > 0) and (not (0 <= index < len(options)))):
        raise StreamlitAPIException('Selectbox index must be between 0 and length of options')
    element.selectbox.label = label
    element.selectbox.default = index
    element.selectbox.options[:] = [str(format_func(option)) for option in options]
    ui_value = _get_widget_ui_value('selectbox', element, user_key=key)
    current_value = (ui_value if (ui_value is not None) else index)
    return (options[current_value] if ((len(options) > 0) and (options[current_value] is not None)) else NoValue)
Display a select widget.

Parameters
----------
label : str
    A short label explaining to the user what this select widget is for.
options : list, tuple, numpy.ndarray, or pandas.Series
    Labels for the select options. This will be cast to str internally
    by default.
index : int
    The index of the preselected option on first render.
format_func : function
    Function to modify the display of the labels. It receives the option
    as an argument and its output will be cast to str.
key : str
    An optional string to use as the unique key for the widget.
    If this is omitted, a key will be generated for the widget
    based on its content. Multiple widgets of the same type may
    not share the same key.

Returns
-------
any
    The selected option

Example
-------
>>> option = st.selectbox(
...     'How would you like to be contacted?',
...     ('Email', 'Home phone', 'Mobile phone'))
>>>
>>> st.write('You selected:', option)
@_with_element
def selectbox(self, element, label, options, index=0, format_func=str, key=None):
    "Display a select widget.\n\n        Parameters\n        ----------\n        label : str\n            A short label explaining to the user what this select widget is for.\n        options : list, tuple, numpy.ndarray, or pandas.Series\n            Labels for the select options. This will be cast to str internally\n            by default.\n        index : int\n            The index of the preselected option on first render.\n        format_func : function\n            Function to modify the display of the labels. It receives the option\n            as an argument and its output will be cast to str.\n        key : str\n            An optional string to use as the unique key for the widget.\n            If this is omitted, a key will be generated for the widget\n            based on its content. Multiple widgets of the same type may\n            not share the same key.\n\n        Returns\n        -------\n        any\n            The selected option\n\n        Example\n        -------\n        >>> option = st.selectbox(\n        ...     'How would you like to be contacted?',\n        ...     ('Email', 'Home phone', 'Mobile phone'))\n        >>>\n        >>> st.write('You selected:', option)\n\n        "
    if (not isinstance(index, int)):
        raise StreamlitAPIException(('Selectbox Value has invalid type: %s' % type(index).__name__))
    if ((len(options) > 0) and (not (0 <= index < len(options)))):
        raise StreamlitAPIException('Selectbox index must be between 0 and length of options')
    element.selectbox.label = label
    element.selectbox.default = index
    element.selectbox.options[:] = [str(format_func(option)) for option in options]
    ui_value = _get_widget_ui_value('selectbox', element, user_key=key)
    current_value = (ui_value if (ui_value is not None) else index)
    return (options[current_value] if ((len(options) > 0) and (options[current_value] is not None)) else NoValue)