docstr: Check our current ScriptRequestState to see if we have a
  pending STOP or RERUN request.
  
  This function is called every time the app script enqueues a
  ForwardMsg, which means that most `st.foo` commands - which generally
  involve sending a ForwardMsg to the frontend - act as implicit
  yield points in the script's execution.
docstr_tok: ["Check","our","current","ScriptRequestState","to","see","if","we","have","a","pending","STOP","or","RERUN","request",".","This","function","is","called","every","time","the","app","script","enqueues","a","ForwardMsg",",","which","means","that","most","`","st.foo","`","commands","-","which","generally","involve","sending","a","ForwardMsg","to","the","frontend","-","act","as","implicit","yield","points","in","the","script","'s","execution","."]
code: def _maybe_handle_execution_control_request(self) -> None:
      """Check our current ScriptRequestState to see if we have a
      pending STOP or RERUN request.
  
      This function is called every time the app script enqueues a
      ForwardMsg, which means that most `st.foo` commands - which generally
      involve sending a ForwardMsg to the frontend - act as implicit
      yield points in the script's execution.
      """
      if not self._is_in_script_thread():
          # We can only handle execution_control_request if we're on the
          # script execution thread. However, it's possible for deltas to
          # be enqueued (and, therefore, for this function to be called)
          # in separate threads, so we check for that here.
          return
  
      if not self._execing:
          # If the _execing flag is not set, we're not actually inside
          # an exec() call. This happens when our script exec() completes,
          # we change our state to STOPPED, and a statechange-listener
          # enqueues a new ForwardEvent
          return
  
      request = self._requests.on_scriptrunner_yield()
      if request is None:
          # No RERUN or STOP request.
          return
  
      if request.type == ScriptRequestType.RERUN:
          raise RerunException(request.rerun_data)
  
      assert request.type == ScriptRequestType.STOP
      raise StopException()
  
imports: import gc
  import sys
  import threading
  import types
  from contextlib import contextmanager
  from enum import Enum
  from timeit import default_timer
  from typing import Callable, Dict, Optional
  from blinker import Signal
  from streamlit import config, runtime, source_util, util
  from streamlit.error_util import handle_uncaught_app_exception
  from streamlit.logger import get_logger
  from streamlit.proto.ClientState_pb2 import ClientState
  from streamlit.proto.ForwardMsg_pb2 import ForwardMsg
  from streamlit.runtime.scriptrunner.script_cache import ScriptCache
  from streamlit.runtime.scriptrunner.script_requests import RerunData, ScriptRequests, ScriptRequestType
  from streamlit.runtime.scriptrunner.script_run_context import ScriptRunContext, add_script_run_ctx, get_script_run_ctx
  from streamlit.runtime.state import SCRIPT_RUN_WITHOUT_ERRORS_KEY, SafeSessionState, SessionState
  from streamlit.runtime.uploaded_file_manager import UploadedFileManager
  from streamlit.vendor.ipython.modified_sys_path import modified_sys_path
label_desc: Use image node_id 10 for calling the ScriptRunner obj's underlying member method code with example usage: obj._maybe_handle_execution_control_request() without return types