code: def _create_widget(id: str, states: WidgetStates) -> WidgetState:
      """Create a widget with the given ID."""
      states.widgets.add().id = id
      return states.widgets[-1]
  
imports: import unittest
  from typing import Optional
  from streamlit.proto.WidgetStates_pb2 import WidgetState, WidgetStates
  from streamlit.runtime.scriptrunner.script_requests import RerunData, ScriptRequest, ScriptRequests, ScriptRequestType
label_desc: Use image node_id 1 for calling a global function with example usage: _create_widget(id, states) and returns: states