code: def k8s_resource_iterator(
      callback: Callable[[dict], None], resources: Iterator
  ) -> None:
      failures: list = []
      for data in resources:
          if data is not None:
              if "List" in data["kind"]:
                  kind = data["kind"].replace("List", "")
                  for yml_doc in data["items"]:
                      if kind != "":
                          yml_doc["apiVersion"] = data["apiVersion"]
                          yml_doc["kind"] = kind
                      try:
                          callback(yml_doc)
                      except (
                          FailToCreateError,
                          FailToDeleteError,
                      ) as failure:
                          failures.extend(failure.api_exceptions)
              else:
                  try:
                      callback(data)
                  except (
                      FailToCreateError,
                      FailToDeleteError,
                  ) as failure:
                      failures.extend(failure.api_exceptions)
      if failures:
          raise FailToCreateError(failures)
  
imports: from __future__ import annotations
  from typing import Callable, Iterator
  from kubernetes.utils import FailToCreateError
  from airflow.providers.cncf.kubernetes.utils.delete_from import FailToDeleteError
label_desc: Use image node_id 1 for calling a global function with example usage: k8s_resource_iterator(callback, resources) without return types