code: def _create_mock_session_state(
      initial_query_params_values: Dict[str, Union[List[str], str]]
  ) -> SafeSessionState:
      """Return a new SafeSessionState instance populated with the
      given query param values.
      """
      session_state = SessionState()
      query_params = QueryParams()
      for key, value in initial_query_params_values.items():
          query_params[key] = value
      session_state.query_params = query_params
      return SafeSessionState(session_state, lambda: None)
  
imports: import unittest
  from typing import Dict, List, Union
  from unittest.mock import MagicMock, patch
  import pytest
  from streamlit.runtime.state.query_params import QueryParams
  from streamlit.runtime.state.query_params_proxy import QueryParamsProxy
  from streamlit.runtime.state.safe_session_state import SafeSessionState
  from streamlit.runtime.state.session_state import SessionState
label_desc: Use image node_id 1 for calling a global function with example usage: _create_mock_session_state(initial_query_params_values) and returns: SafeSessionState