code: def get_task(dag_id: str, task_id: str) -> TaskInstance:
      """Return the task object identified by the given dag_id and task_id."""
      dag = check_and_get_dag(dag_id, task_id)
  
      # Return the task.
      return dag.get_task(task_id)
  
imports: from __future__ import annotations
  from typing import TYPE_CHECKING
  from deprecated import deprecated
  from airflow.api.common.experimental import check_and_get_dag
label_desc: Use image node_id 1 for calling a global function with example usage: get_task(dag_id, task_id) and returns: dag