class_docstr: A MockSessionManager used for runtime tests.
  
  This is done so that our runtime tests don't rely on a specific SessionManager
  implementation.
code: def connect_session(
      self,
      client: SessionClient,
      script_data: ScriptData,
      user_info: Dict[str, Optional[str]],
      existing_session_id: Optional[str] = None,
      session_id_override: Optional[str] = None,
  ) -> str:
      with mock.patch(
          "streamlit.runtime.scriptrunner.ScriptRunner",
          new=mock.MagicMock(),
      ):
          session = AppSession(
              script_data=script_data,
              uploaded_file_manager=self._uploaded_file_mgr,
              script_cache=self._script_cache,
              message_enqueued_callback=self._message_enqueued_callback,
              local_sources_watcher=mock.MagicMock(),
              user_info=user_info,
              session_id_override=session_id_override,
          )
  
      assert (
          session.id not in self._session_info_by_id
      ), f"session.id '{session.id}' registered multiple times!"
  
      self._session_info_by_id[session.id] = SessionInfo(
          client, session
      )
      return session.id
  
imports: import asyncio
  from typing import Callable, Dict, List, Optional
  from unittest import IsolatedAsyncioTestCase, mock
  from streamlit.proto.ForwardMsg_pb2 import ForwardMsg
  from streamlit.runtime import Runtime, RuntimeConfig, RuntimeState
  from streamlit.runtime.app_session import AppSession
  from streamlit.runtime.caching.storage.dummy_cache_storage import MemoryCacheStorageManager
  from streamlit.runtime.memory_media_file_storage import MemoryMediaFileStorage
  from streamlit.runtime.memory_uploaded_file_manager import MemoryUploadedFileManager
  from streamlit.runtime.script_data import ScriptData
  from streamlit.runtime.scriptrunner.script_cache import ScriptCache
  from streamlit.runtime.session_manager import SessionClient, SessionInfo, SessionManager, SessionStorage
  from streamlit.runtime.uploaded_file_manager import UploadedFileManager
label_desc: Use image node_id 2 for calling the MockSessionManager obj's underlying member method code with example usage: obj.connect_session(client, script_data, user_info, existing_session_id, session_id_override) and returns: session