code: def test_get_logs_with_metadata(
      log_admin_client, metadata, create_expected_log_file
  ):
      url_template = "get_logs_with_metadata?dag_id={}&task_id={}&execution_date={}&try_number={}&metadata={}"
      try_number = 1
      create_expected_log_file(try_number)
      response = log_admin_client.get(
          url_template.format(
              DAG_ID,
              TASK_ID,
              urllib.parse.quote_plus(DEFAULT_DATE.isoformat()),
              try_number,
              metadata,
          ),
          data={"username": "test", "password": "test"},
          follow_redirects=True,
      )
      assert 200 == response.status_code
  
      data = response.data.decode()
      assert '"message":' in data
      assert '"metadata":' in data
      assert "Log for testing." in data
  
imports: from __future__ import annotations
  import copy
  import logging
  import logging.config
  import pathlib
  import shutil
  import sys
  import tempfile
  import unittest.mock
  import urllib.parse
  import pytest
  from airflow import settings
  from airflow.config_templates.airflow_local_settings import DEFAULT_LOGGING_CONFIG
  from airflow.models import DagBag, DagRun
  from airflow.models.tasklog import LogTemplate
  from airflow.utils import timezone
  from airflow.utils.log.file_task_handler import FileTaskHandler
  from airflow.utils.log.logging_mixin import ExternalLoggingMixin
  from airflow.utils.session import create_session
  from airflow.utils.state import DagRunState, TaskInstanceState
  from airflow.utils.types import DagRunType
  from airflow.www.app import create_app
  from tests.test_utils.config import conf_vars
  from tests.test_utils.db import clear_db_dags, clear_db_runs
  from tests.test_utils.decorators import dont_initialize_flask_app_submodules
  from tests.test_utils.www import client_with_login
label_desc: Use image node_id 14 for calling a global function with example usage: test_get_logs_with_metadata(log_admin_client, metadata, create_expected_log_file) without return types