code: def _get_session_id() -> str:
      """Get the active AppSession's session_id."""
      from streamlit.runtime.scriptrunner import get_script_run_ctx
  
      ctx = get_script_run_ctx()
      if ctx is None:
          # This is only None when running "python myscript.py" rather than
          # "streamlit run myscript.py". In which case the session ID doesn't
          # matter and can just be a constant, as there's only ever "session".
          return "dontcare"
      else:
          return ctx.session_id
  
file_path: streamlit/lib/streamlit/runtime/media_file_manager.py
imports: import collections
  import threading
  from typing import Dict, Optional, Set, Union
  from streamlit.logger import get_logger
  from streamlit.runtime.media_file_storage import MediaFileKind, MediaFileStorage
label_desc: Use image node_id 1 for calling a global function with example usage: _get_session_id() and returns: str, ctx