code: def test_check_history_server(
      mock_is_notebook_instance,
      mock_is_history_server_started,
      mock_get_notebook_instance_domain,
      py_spark_processor,
      config,
      expected,
  ):
      mock_is_notebook_instance.return_value = config[
          "is_note_book_instance"
      ]
      mock_is_history_server_started.return_value = config[
          "is_history_server_started"
      ]
  
      if "instance_domain" in config:
          mock_get_notebook_instance_domain.return_value = config[
              "instance_domain"
          ]
  
      with TestCase.assertLogs("sagemaker", level="INFO") as cm:
          py_spark_processor._check_history_server(ping_timeout=3)
  
      assert expected in cm.output[0]
  
imports: from __future__ import absolute_import
  import pathlib
  import subprocess
  import tempfile
  from io import BytesIO
  from typing import Generator
  from unittest.case import TestCase
  from unittest.mock import MagicMock, Mock, call, mock_open, patch
  import pytest
  from sagemaker.processing import ProcessingInput, ProcessingOutput
  from sagemaker.session_settings import SessionSettings
  from sagemaker.spark.processing import PySparkProcessor, SparkJarProcessor, _SparkProcessorBase, _HistoryServer, FileType, SparkConfigUtils
label_desc: Use image node_id 23 for calling a global function with example usage: test_check_history_server(mock_is_notebook_instance, mock_is_history_server_started, mock_get_notebook_instance_domain, py_spark_processor, config, expected) without return types