@_with_element
def time_input(self, element, label, value=None, key=None):
    "Display a time input widget.\n\n        Parameters\n        ----------\n        label : str\n            A short label explaining to the user what this time input is for.\n        value : datetime.time/datetime.datetime\n            The value of this widget when it first renders. This will be\n            cast to str internally. Defaults to the current time.\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        datetime.time\n            The current value of the time input widget.\n\n        Example\n        -------\n        >>> t = st.time_input('Set an alarm for', datetime.time(8, 45))\n        >>> st.write('Alarm is set for', t)\n\n        "
    if (value is None):
        value = datetime.now().time()
    if ((not isinstance(value, datetime)) and (not isinstance(value, time))):
        raise StreamlitAPIException('The type of the value should be either datetime or time.')
    if isinstance(value, datetime):
        value = value.time()
    element.time_input.label = label
    element.time_input.default = time.strftime(value, '%H:%M')
    ui_value = _get_widget_ui_value('time_input', element, user_key=key)
    current_value = (datetime.strptime(ui_value, '%H:%M').time() if (ui_value is not None) else value)
    return current_value
Display a time input widget.

Parameters
----------
label : str
    A short label explaining to the user what this time input is for.
value : datetime.time/datetime.datetime
    The value of this widget when it first renders. This will be
    cast to str internally. Defaults to the current time.
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
-------
datetime.time
    The current value of the time input widget.

Example
-------
>>> t = st.time_input('Set an alarm for', datetime.time(8, 45))
>>> st.write('Alarm is set for', t)
@_with_element
def time_input(self, element, label, value=None, key=None):
    "Display a time input widget.\n\n        Parameters\n        ----------\n        label : str\n            A short label explaining to the user what this time input is for.\n        value : datetime.time/datetime.datetime\n            The value of this widget when it first renders. This will be\n            cast to str internally. Defaults to the current time.\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        datetime.time\n            The current value of the time input widget.\n\n        Example\n        -------\n        >>> t = st.time_input('Set an alarm for', datetime.time(8, 45))\n        >>> st.write('Alarm is set for', t)\n\n        "
    if (value is None):
        value = datetime.now().time()
    if ((not isinstance(value, datetime)) and (not isinstance(value, time))):
        raise StreamlitAPIException('The type of the value should be either datetime or time.')
    if isinstance(value, datetime):
        value = value.time()
    element.time_input.label = label
    element.time_input.default = time.strftime(value, '%H:%M')
    ui_value = _get_widget_ui_value('time_input', element, user_key=key)
    current_value = (datetime.strptime(ui_value, '%H:%M').time() if (ui_value is not None) else value)
    return current_value