code: def pytest_sessionfinish():
      """Correctly closes the global multiprocessing pool.
  
      Runs after all tests.
  
      """
      if not USE_PYTEST_POOL:
          return
      pytest.pool.close()
      pytest.pool.join()
  
file_path: torchmetrics/tests/unittests/conftest.py
imports: import contextlib
  import os
  import sys
  from functools import wraps
  from typing import Any, Callable, Optional
  import pytest
  import torch
  from torch.multiprocessing import Pool, set_sharing_strategy, set_start_method
label_desc: Use image node_id 3 for calling a global function with example usage: pytest_sessionfinish() without return types