code: def setup_tests(runtests: RunTests):
      support.verbose = runtests.verbose
      support.failfast = runtests.fail_fast
      support.PGO = runtests.pgo
      support.PGO_EXTENDED = runtests.pgo_extended
  
      set_match_tests(runtests.match_tests)
  
      if runtests.use_junit:
          support.junit_xml_list = []
          from .testresult import RegressionTestResult
  
          RegressionTestResult.USE_XML = True
      else:
          support.junit_xml_list = None
  
      if runtests.memory_limit is not None:
          support.set_memlimit(runtests.memory_limit)
  
      support.suppress_msvcrt_asserts(runtests.verbose >= 2)
  
      support.use_resources = runtests.use_resources
  
      timeout = runtests.timeout
      if timeout is not None:
          # For a slow buildbot worker, increase SHORT_TIMEOUT and LONG_TIMEOUT
          support.LOOPBACK_TIMEOUT = max(
              support.LOOPBACK_TIMEOUT, timeout / 120
          )
          # don't increase INTERNET_TIMEOUT
          support.SHORT_TIMEOUT = max(
              support.SHORT_TIMEOUT, timeout / 40
          )
          support.LONG_TIMEOUT = max(support.LONG_TIMEOUT, timeout / 4)
  
          # If --timeout is short: reduce timeouts
          support.LOOPBACK_TIMEOUT = min(
              support.LOOPBACK_TIMEOUT, timeout
          )
          support.INTERNET_TIMEOUT = min(
              support.INTERNET_TIMEOUT, timeout
          )
          support.SHORT_TIMEOUT = min(support.SHORT_TIMEOUT, timeout)
          support.LONG_TIMEOUT = min(support.LONG_TIMEOUT, timeout)
  
      if runtests.hunt_refleak:
          # private attribute that mypy doesn't know about:
          unittest.BaseTestSuite._cleanup = False  # type: ignore[attr-defined]
  
      if runtests.gc_threshold is not None:
          gc.set_threshold(runtests.gc_threshold)
  
      random.seed(runtests.random_seed)
  
file_path: cpython/Lib/test/libregrtest/setup.py
imports: import faulthandler
  import gc
  import os
  import random
  import signal
  import sys
  import unittest
  from test import support
  from test.support.os_helper import TESTFN_UNDECODABLE, FS_NONASCII
  from .filter import set_match_tests
  from .runtests import RunTests
  from .utils import setup_unraisable_hook, setup_threading_excepthook, fix_umask, adjust_rlimit_nofile
label_desc: Use image node_id 3 for calling a global function with example usage: setup_tests(runtests) without return types