code: def register_signals():
      """
      Register the same signals as scheduler does to test celery_executor to make sure it does not
      hang.
      """
      orig_sigint = orig_sigterm = orig_sigusr2 = signal.SIG_DFL
  
      orig_sigint = signal.signal(signal.SIGINT, _exit_gracefully)
      orig_sigterm = signal.signal(signal.SIGTERM, _exit_gracefully)
      orig_sigusr2 = signal.signal(signal.SIGUSR2, _exit_gracefully)
  
      yield
  
      # Restore original signal handlers after test
      signal.signal(signal.SIGINT, orig_sigint)
      signal.signal(signal.SIGTERM, orig_sigterm)
      signal.signal(signal.SIGUSR2, orig_sigusr2)
  
imports: from __future__ import annotations
  import contextlib
  import logging
  import os
  import signal
  import sys
  from datetime import datetime, timedelta
  from unittest import mock
  import celery.contrib.testing.tasks
  import pytest
  import time_machine
  from celery import Celery
  from celery.result import AsyncResult
  from kombu.asynchronous import set_event_loop
  from airflow.configuration import conf
  from airflow.models.baseoperator import BaseOperator
  from airflow.models.dag import DAG
  from airflow.models.taskinstance import TaskInstance, TaskInstanceKey
  from airflow.providers.celery.executors import celery_executor, celery_executor_utils, default_celery
  from airflow.providers.celery.executors.celery_executor import CeleryExecutor
  from airflow.utils import timezone
  from airflow.utils.state import State
  from tests.test_utils import db
  from tests.test_utils.config import conf_vars
label_desc: Use image node_id 5 for calling a global function with example usage: register_signals() without return types