code: def test_check_session_state_rules_writes_not_allowed(
      self, patched_get_session_state
  ):
      mock_session_state = MagicMock()
      mock_session_state.is_new_state_value.return_value = True
      patched_get_session_state.return_value = mock_session_state
  
      with pytest.raises(StreamlitAPIException) as e:
          check_session_state_rules(
              5, key="the key", writes_allowed=False
          )
  
      assert "cannot be set using st.session_state" in str(e.value)
  
imports: import copy
  import enum
  import os
  import unittest
  from unittest.mock import MagicMock, patch
  import pytest
  from streamlit import config
  from streamlit.elements import utils
  from streamlit.elements.utils import check_callback_rules, check_session_state_rules, maybe_coerce_enum, maybe_coerce_enum_sequence
  from streamlit.errors import StreamlitAPIException
  from streamlit.runtime.state.common import RegisterWidgetResult
label_desc: Use image node_id 11 for calling the ElementUtilsTest obj's underlying member method code with example usage: obj.test_check_session_state_rules_writes_not_allowed(patched_get_session_state) without return types