code: def task_info(dag_id, task_id):
      """Return a JSON with a task's public instance variables."""
      try:
          t_info = get_task(dag_id, task_id)
      except AirflowException as err:
          log.info(err)
          response = jsonify(error=f"{err}")
          response.status_code = err.status_code
          return response
  
      # JSONify and return.
      fields = {
          k: str(v)
          for k, v in vars(t_info).items()
          if not k.startswith("_")
      }
      return jsonify(fields)
  
imports: from __future__ import annotations
  import logging
  from functools import wraps
  from typing import TYPE_CHECKING, Callable, TypeVar, cast
  from flask import Blueprint, current_app, g, jsonify, request, url_for
  from airflow import models
  from airflow.api.common.experimental import delete_dag, pool, trigger_dag
  from airflow.api.common.experimental.get_code import get_code
  from airflow.api.common.experimental.get_dag_run_state import get_dag_run_state
  from airflow.api.common.experimental.get_dag_runs import get_dag_runs
  from airflow.api.common.experimental.get_lineage import get_lineage
  from airflow.api.common.experimental.get_task import get_task
  from airflow.api.common.experimental.get_task_instance import get_task_instance
  from airflow.exceptions import AirflowException
  from airflow.utils import timezone
  from airflow.utils.docs import get_docs_url
  from airflow.utils.strings import to_boolean
  from airflow.version import version
label_desc: Use image node_id 9 for calling a global function with example usage: task_info(dag_id, task_id) and returns: jsonify, response