code: def _check_task_rules(current_task: BaseOperator):
      """Check task rules for given task."""
      notices = []
      for rule in TASK_RULES:
          try:
              rule(current_task)
          except AirflowClusterPolicyViolation as ex:
              notices.append(str(ex))
      if notices:
          notices_list = " * " + "\n * ".join(notices)
          raise AirflowClusterPolicyViolation(
              f"DAG policy violation (DAG ID: {current_task.dag_id}, Path: {current_task.dag.fileloc}):\n"
              f"Notices:\n"
              f"{notices_list}"
          )
  
file_path: airflow/tests/cluster_policies/__init__.py
imports: from __future__ import annotations
  from abc import ABC
  from datetime import timedelta
  from typing import TYPE_CHECKING, Callable
  from airflow.configuration import conf
  from airflow.exceptions import AirflowClusterPolicySkipDag, AirflowClusterPolicyViolation
  from airflow.models.baseoperator import BaseOperator
label_desc: Use image node_id 2 for calling a global function with example usage: _check_task_rules(current_task) without return types