class_docstr: Widgets called by a cache-decorated function, and a mapping of the
  widget-derived cache key to the final results of executing the function.
class_docstr_tok: ["Widgets","called","by","a","cache-decorated","function",",","and","a","mapping","of","the","widget-derived","cache","key","to","the","final","results","of","executing","the","function","."]
code: def get_current_widget_key(
      self, ctx: ScriptRunContext, cache_type: CacheType
  ) -> str:
      state = ctx.session_state
      # Compute the key using only widgets that have values. A missing widget
      # can be ignored because we only care about getting different keys
      # for different widget values, and for that purpose doing nothing
      # to the running hash is just as good as including the widget with a
      # sentinel value. But by excluding it, we might get to reuse a result
      # saved before we knew about that widget.
      widget_values = [
          (wid, state[wid])
          for wid in sorted(self.widget_ids)
          if wid in state
      ]
      widget_key = _make_widget_key(widget_values, cache_type)
      return widget_key
  
imports: from __future__ import annotations
  import contextlib
  import hashlib
  import threading
  import types
  from dataclasses import dataclass
  from typing import TYPE_CHECKING, Any, Iterator, Union
  from google.protobuf.message import Message
  from typing_extensions import Protocol, runtime_checkable
  import streamlit
  from streamlit import runtime, util
  from streamlit.elements import NONWIDGET_ELEMENTS, WIDGETS
  from streamlit.logger import get_logger
  from streamlit.proto.Block_pb2 import Block
  from streamlit.runtime.caching.cache_errors import CachedStFunctionWarning, CacheReplayClosureError
  from streamlit.runtime.caching.cache_type import CacheType
  from streamlit.runtime.caching.hashing import update_hash
  from streamlit.runtime.scriptrunner.script_run_context import ScriptRunContext, get_script_run_ctx
  from streamlit.runtime.state.common import WidgetMetadata
  from streamlit.util import HASHLIB_KWARGS
label_desc: Use image node_id 1 for calling the MultiCacheResults obj's underlying member method code with example usage: obj.get_current_widget_key(ctx, cache_type) and returns: widget_key