code: def test_sigterm_notifier_fn():
      trainer = Mock()
      launcher = Mock()
      trainer.strategy.launcher = launcher
      connector = _SignalConnector(trainer)
  
      assert not connector.received_sigterm
      connector._sigterm_notifier_fn(signal.SIGTERM, Mock())
      launcher.kill.assert_called_once_with(15)
      assert connector.received_sigterm
      launcher.reset_mock()
      connector._sigterm_notifier_fn(signal.SIGTERM, Mock())
      launcher.kill.assert_not_called()
  
imports: import concurrent.futures
  import os
  import signal
  from unittest import mock
  from unittest.mock import Mock
  import pytest
  from lightning.fabric.plugins.environments import SLURMEnvironment
  from lightning.fabric.utilities.imports import _IS_WINDOWS
  from lightning.pytorch import Trainer
  from lightning.pytorch.demos.boring_classes import BoringModel
  from lightning.pytorch.trainer.connectors.signal_connector import _SignalConnector
  from lightning.pytorch.utilities.exceptions import SIGTERMException
  from tests_pytorch.helpers.runif import RunIf
label_desc: Use image node_id 11 for calling a global function with example usage: test_sigterm_notifier_fn() without return types