code: def _create_mock_session_state(
      initial_state_values: Dict[str, Any]
  ) -> SafeSessionState:
      """Return a new SafeSessionState instance populated with the
      given state values.
      """
      session_state = SessionState()
      for key, value in initial_state_values.items():
          session_state[key] = value
      return SafeSessionState(session_state, lambda: None)
  
imports: import unittest
  from typing import Any, Dict
  from unittest.mock import MagicMock, patch
  import pytest
  from streamlit.errors import StreamlitAPIException
  from streamlit.runtime.state import SafeSessionState, SessionState, SessionStateProxy
  from streamlit.runtime.state.common import GENERATED_WIDGET_ID_PREFIX, require_valid_user_key
label_desc: Use image node_id 1 for calling a global function with example usage: _create_mock_session_state(initial_state_values) and returns: SafeSessionState