hunk.code_window: from streamlit.protobuf.BackMsg_pb2 import WidgetStates
   from streamlit.widgets import Widgets
   def _create_widget(id, states):
       widget = WidgetState()
       widget.id = id
       states.widgets.append(widget)
       return states.widgets[-1]
   class ScriptEventQueueTest(unittest.TestCase):
  
hunk.labels: keep keep keep keep keep replace replace replace keep keep keep keep
hunk.after_edit:     states.widgets.add().id = id
  
hunk.file_path: lib/tests/streamlit/ScriptRunner_test.py
hunk.type: replace
file: # Python Virtual Environments
  
  ## 1. Installing `pyenv` and `pyenv-virtualenv`
  
  ###### On MacOS
  
  ```
  brew install pyenv
  brew install pyenv-virtualenv
  ```
  ###### On Linux
  Just [follow these instructions](https://github.com/pyenv/pyenv-installer/blob/master/README.rst).
  
  Also make sure you have [these packages](https://github.com/pyenv/pyenv/wiki/Common-build-problems).
  
  ## 2. Establish a Local Python Environment
  
  Create a virtualenv environment called `streamlit`:
  ```
  pyenv install 3.6.3
  pyenv virtualenv 3.6.3 streamlit
  pyenv local streamlit
  ```
  