code: def test_cached_widget_replay_rerun():
      def script():
          import streamlit as st
  
          @st.cache_data(
              experimental_allow_widgets=True, show_spinner=False
          )
          def foo(i):
              options = ["foo", "bar", "baz", "qux"]
              r = st.radio("radio", options, index=i)
              return r
  
          foo(1)
  
      at = AppTest.from_function(script).run()
  
      assert at.radio.len == 1
      at.run()
      assert at.radio.len == 1
  
file_path: streamlit/lib/tests/streamlit/testing/app_test_test.py
imports: import pytest
  from streamlit.testing.v1 import AppTest
label_desc: Use image node_id 7 for calling a global function with example usage: test_cached_widget_replay_rerun() and returns: r