code: def test_wait_all(self):
      fut1 = Future[int]()
      fut2 = Future[int]()
  
      # No error version
      fut1.set_result(1)
      fut2.set_result(2)
      res = torch.futures.wait_all([fut1, fut2])
      print(res)
      self.assertEqual(res, [1, 2])
  
      # Version with an exception
      def raise_in_fut(fut):
          raise ValueError("Expected error")
  
      fut3 = fut1.then(raise_in_fut)
      with self.assertRaisesRegex(RuntimeError, "Expected error"):
          torch.futures.wait_all([fut3, fut2])
  
imports: import threading
  import time
  import torch
  import unittest
  from torch.futures import Future
  from torch.testing._internal.common_utils import IS_WINDOWS, TestCase, TemporaryFileName, run_tests
  from typing import TypeVar
label_desc: Use image node_id 23 for calling the TestFuture obj's underlying member method code with example usage: obj.test_wait_all() without return types