code: def subdag(parent_dag_name, child_dag_name, args) -> DAG:
      """
      Generate a DAG to be used as a subdag.
  
      :param str parent_dag_name: Id of the parent DAG
      :param str child_dag_name: Id of the child DAG
      :param dict args: Default arguments to provide to the subdag
      :return: DAG to use as a subdag
      """
      dag_subdag = DAG(
          dag_id=f"{parent_dag_name}.{child_dag_name}",
          default_args=args,
          start_date=pendulum.datetime(2021, 1, 1, tz="UTC"),
          catchup=False,
          schedule="@daily",
      )
  
      for i in range(5):
          EmptyOperator(
              task_id=f"{child_dag_name}-task-{i + 1}",
              default_args=args,
              dag=dag_subdag,
          )
  
      return dag_subdag
  
imports: from __future__ import annotations
  import pendulum
  from airflow.models.dag import DAG
  from airflow.operators.empty import EmptyOperator
label_desc: Use image node_id 1 for calling a global function with example usage: subdag(parent_dag_name, child_dag_name, args) and returns: dag_subdag