docstr: `remove_file` is thread-safe.
docstr_tok: ["`","remove_file","`","is","thread-safe","."]
code: def test_remove_file(self):
      """`remove_file` is thread-safe."""
      # Add a bunch of files to a single widget
      file_ids = []
      for ii in range(self.NUM_THREADS):
          file = UploadedFileRec(
              file_id=f"id_{ii}",
              name=f"file_{ii}",
              type="type",
              data=b"123",
          )
          self.mgr.add_file("session", file)
          file_ids.append(file.file_id)
  
      # Have each thread remove a single file
      def remove_file(index: int) -> None:
          file_id = file_ids[index]
  
          # Ensure our file exists
          get_files_result = self.mgr.get_files("session", [file_id])
          self.assertEqual(1, len(get_files_result))
  
          # Remove our file and ensure our file no longer exists
          self.mgr.remove_file("session", file_id)
          get_files_result = self.mgr.get_files("session", [file_id])
          self.assertEqual(0, len(get_files_result))
  
      call_on_threads(remove_file, self.NUM_THREADS)
  
      self.assertEqual(0, len(self.mgr.file_storage["session"]))
  
file_path: streamlit/lib/tests/streamlit/runtime/uploaded_file_manager_test.py
imports: import unittest
  from streamlit.runtime.memory_uploaded_file_manager import MemoryUploadedFileManager
  from streamlit.runtime.stats import CacheStat
  from streamlit.runtime.uploaded_file_manager import UploadedFileRec
  from tests.exception_capturing_thread import call_on_threads
label_desc: Use image node_id 3 for calling the UploadedFileManagerThreadingTest obj's underlying member method code with example usage: obj.test_remove_file() without return types