code: def test_should_return_valid_external_url(
      self, mock_client, mock_get_creds_and_project_id
  ):
      mock_get_creds_and_project_id.return_value = (
          "creds",
          "project_id",
      )
  
      stackdriver_task_handler = StackdriverTaskHandler(
          gcp_key_path="KEY_PATH"
      )
      url = stackdriver_task_handler.get_external_log_url(
          self.ti, self.ti.try_number
      )
  
      parsed_url = urlsplit(url)
      parsed_qs = parse_qs(parsed_url.query)
      assert "https" == parsed_url.scheme
      assert "console.cloud.google.com" == parsed_url.netloc
      assert "/logs/viewer" == parsed_url.path
      assert {
          "project",
          "interval",
          "resource",
          "advancedFilter",
      } == set(parsed_qs.keys())
      assert "global" in parsed_qs["resource"]
  
      filter_params = parsed_qs["advancedFilter"][0].splitlines()
      expected_filter = [
          'resource.type="global"',
          'logName="projects/project_id/logs/airflow"',
          f'labels.task_id="{self.ti.task_id}"',
          f'labels.dag_id="{self.DAG_ID}"',
          f'labels.execution_date="{self.ti.execution_date.isoformat()}"',
          f'labels.try_number="{self.ti.try_number}"',
      ]
      assert set(expected_filter) == set(filter_params)
  
imports: from __future__ import annotations
  import logging
  from unittest import mock
  from urllib.parse import parse_qs, urlsplit
  import pytest
  from google.cloud.logging import Resource
  from google.cloud.logging_v2.types import ListLogEntriesRequest, ListLogEntriesResponse, LogEntry
  from airflow.providers.google.cloud.log.stackdriver_task_handler import StackdriverTaskHandler
  from airflow.utils import timezone
  from airflow.utils.state import TaskInstanceState
  from tests.test_utils.db import clear_db_dags, clear_db_runs
label_desc: Use image node_id 12 for calling the TestStackdriverLoggingHandlerTask obj's underlying member method code with example usage: obj.test_should_return_valid_external_url(mock_client, mock_get_creds_and_project_id) without return types