code: def test_duplicate_futures(self):
      # Issue 20367. Duplicate futures should not raise exceptions or give
      # duplicate responses.
      # Issue #31641: accept arbitrary iterables.
      future1 = self.executor.submit(time.sleep, 2)
      completed = [
          f for f in futures.as_completed(itertools.repeat(future1, 3))
      ]
      self.assertEqual(len(completed), 1)
  
file_path: cpython/Lib/test/test_concurrent_futures/test_as_completed.py
imports: import itertools
  import time
  import unittest
  import weakref
  from concurrent import futures
  from concurrent.futures._base import CANCELLED_AND_NOTIFIED, FINISHED, Future
  from test import support
  from .util import PENDING_FUTURE, RUNNING_FUTURE, CANCELLED_AND_NOTIFIED_FUTURE, EXCEPTION_FUTURE, SUCCESSFUL_FUTURE, create_future, create_executor_tests, setup_module
label_desc: Use image node_id 3 for calling the AsCompletedTests obj's underlying member method code with example usage: obj.test_duplicate_futures() without return types