code: def dag_policy(dag: DAG):
      """Ensure that DAG has at least one tag and skip the DAG with `only_for_beta` tag."""
      if not dag.tags:
          raise AirflowClusterPolicyViolation(
              f"DAG {dag.dag_id} has no tags. At least one tag required. File path: {dag.fileloc}"
          )
  
      if "only_for_beta" in dag.tags:
          raise AirflowClusterPolicySkipDag(
              f"DAG {dag.dag_id} is not loaded on the production cluster, due to `only_for_beta` tag."
          )
  
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 4 for calling a global function with example usage: dag_policy(dag) without return types