docstr: Calling a cache's global `clear_all` function should remove all
  items from all caches of the appropriate type.
docstr_tok: ["Calling","a","cache","'s","global","`","clear_all","`","function","should","remove","all","items","from","all","caches","of","the","appropriate","type","."]
code: def test_clear_all_caches(self, _, cache_decorator, clear_cache_func):
      """Calling a cache's global `clear_all` function should remove all
      items from all caches of the appropriate type.
      """
      foo_vals = []
  
      @cache_decorator
      def foo(x):
          foo_vals.append(x)
          return x
  
      bar_vals = []
  
      @cache_decorator
      def bar(x):
          bar_vals.append(x)
          return x
  
      foo(0), foo(1), foo(2)
      bar(0), bar(1), bar(2)
      self.assertEqual([0, 1, 2], foo_vals)
      self.assertEqual([0, 1, 2], bar_vals)
  
      # Clear the cache and access our original values again. They
      # should be recomputed.
      clear_cache_func()
  
      foo(0), foo(1), foo(2)
      bar(0), bar(1), bar(2)
      self.assertEqual([0, 1, 2, 0, 1, 2], foo_vals)
      self.assertEqual([0, 1, 2, 0, 1, 2], bar_vals)
  
imports: import threading
  import time
  import unittest
  from datetime import timedelta
  from typing import Any, List
  from unittest.mock import MagicMock, Mock, patch
  from parameterized import parameterized
  import streamlit
  from streamlit.runtime import Runtime
  from streamlit.runtime.caching import CACHE_DATA_MESSAGE_REPLAY_CTX, CACHE_RESOURCE_MESSAGE_REPLAY_CTX, cache_data, cache_resource
  from streamlit.runtime.caching.cache_errors import CacheReplayClosureError
  from streamlit.runtime.caching.cache_type import CacheType
  from streamlit.runtime.caching.cache_utils import CachedResult
  from streamlit.runtime.caching.cached_message_replay import MultiCacheResults, _make_widget_key
  from streamlit.runtime.caching.storage.dummy_cache_storage import MemoryCacheStorageManager
  from streamlit.runtime.forward_msg_queue import ForwardMsgQueue
  from streamlit.runtime.memory_uploaded_file_manager import MemoryUploadedFileManager
  from streamlit.runtime.scriptrunner import ScriptRunContext, add_script_run_ctx, get_script_run_ctx, script_run_context
  from streamlit.runtime.state import SafeSessionState, SessionState
  from streamlit.testing.v1.app_test import AppTest
  from tests.delta_generator_test_case import DeltaGeneratorTestCase
  from tests.exception_capturing_thread import ExceptionCapturingThread, call_on_threads
  from tests.streamlit.elements.image_test import create_image
  from tests.testutil import create_mock_script_run_ctx
label_desc: Use image node_id 19 for calling the CommonCacheTest obj's underlying member method code with example usage: obj.test_clear_all_caches(_, cache_decorator, clear_cache_func) and returns: x, x