code: def create_context(task):
      dag = DAG(dag_id="dag")
      tzinfo = pendulum.timezone("Europe/Amsterdam")
      execution_date = timezone.datetime(
          2016, 1, 1, 1, 0, 0, tzinfo=tzinfo
      )
      dag_run = DagRun(
          dag_id=dag.dag_id,
          execution_date=execution_date,
          run_id=DagRun.generate_run_id(
              DagRunType.MANUAL, execution_date
          ),
      )
      task_instance = TaskInstance(task=task)
      task_instance.dag_run = dag_run
      task_instance.dag_id = dag.dag_id
      task_instance.xcom_push = mock.Mock()
      return {
          "dag": dag,
          "run_id": dag_run.run_id,
          "task": task,
          "ti": task_instance,
          "task_instance": task_instance,
      }
  
imports: from __future__ import annotations
  import copy
  import json
  from os.path import join
  from pathlib import Path
  from unittest import mock
  from unittest.mock import patch
  import pendulum
  import yaml
  from kubernetes.client import models
  from airflow import DAG
  from airflow.models import Connection, DagRun, TaskInstance
  from airflow.providers.cncf.kubernetes.operators.spark_kubernetes import SparkKubernetesOperator
  from airflow.utils import db, timezone
  from airflow.utils.types import DagRunType
label_desc: Use image node_id 3 for calling a global function with example usage: create_context(task) and returns: dict