code: def assert_prefix(task_instance: TaskInstance, prefix: str) -> None:
      handler = next(
          (
              h
              for h in task_instance.log.handlers
              if h.name == TASK_HANDLER
          ),
          None,
      )
      assert (
          handler is not None
      ), "custom task log handler not set up correctly"
      assert (
          handler.formatter is not None
      ), "custom task log formatter not set up correctly"
      expected_format = f"{prefix}:{handler.formatter._fmt}"
      set_context(task_instance.log, task_instance)
      assert expected_format == handler.formatter._fmt
  
file_path: airflow/tests/utils/test_task_handler_with_custom_formatter.py
imports: from __future__ import annotations
  import logging
  import pytest
  from airflow.config_templates.airflow_local_settings import DEFAULT_LOGGING_CONFIG
  from airflow.models.dag import DAG
  from airflow.models.taskinstance import TaskInstance
  from airflow.operators.empty import EmptyOperator
  from airflow.utils.log.logging_mixin import set_context
  from airflow.utils.state import DagRunState
  from airflow.utils.timezone import datetime
  from airflow.utils.types import DagRunType
  from tests.test_utils.config import conf_vars
  from tests.test_utils.db import clear_db_runs
label_desc: Use image node_id 3 for calling a global function with example usage: assert_prefix(task_instance, prefix) without return types