class_docstr: Chooses between LocalExecutor and KubernetesExecutor based on the queue defined on the task.
  
  When the task's queue is the value of ``kubernetes_queue`` in section ``[local_kubernetes_executor]``
  of the configuration (default value: `kubernetes`), KubernetesExecutor is selected to run the task,
  otherwise, LocalExecutor is used.
class_docstr_tok: ["Chooses","between","LocalExecutor","and","KubernetesExecutor","based","on","the","queue","defined","on","the","task",".","When","the","task","'s","queue","is","the","value","of","``","kubernetes_queue","``","in","section","``","[","local_kubernetes_executor","]","``","of","the","configuration","(","default","value",":","`","kubernetes","`",")",",","KubernetesExecutor","is","selected","to","run","the","task",",","otherwise",",","LocalExecutor","is","used","."]
docstr: Try to adopt running task instances that have been abandoned by a SchedulerJob dying.
  
  Anything that is not adopted will be cleared by the scheduler (and then become eligible for
  re-scheduling)
  
  :return: any TaskInstances that were unable to be adopted
docstr_tok: ["Try","to","adopt","running","task","instances","that","have","been","abandoned","by","a","SchedulerJob","dying",".","Anything","that","is","not","adopted","will","be","cleared","by","the","scheduler","(","and","then","become","eligible","for","re-scheduling",")",":","return",":","any","TaskInstances","that","were","unable","to","be","adopted"]
code: def try_adopt_task_instances(
      self, tis: Sequence[TaskInstance]
  ) -> Sequence[TaskInstance]:
      """
      Try to adopt running task instances that have been abandoned by a SchedulerJob dying.
  
      Anything that is not adopted will be cleared by the scheduler (and then become eligible for
      re-scheduling)
  
      :return: any TaskInstances that were unable to be adopted
      """
      local_tis = [
          ti for ti in tis if ti.queue != self.KUBERNETES_QUEUE
      ]
      kubernetes_tis = [
          ti for ti in tis if ti.queue == self.KUBERNETES_QUEUE
      ]
      return [
          *self.local_executor.try_adopt_task_instances(local_tis),
          *self.kubernetes_executor.try_adopt_task_instances(
              kubernetes_tis
          ),
      ]
  
imports: from __future__ import annotations
  from typing import TYPE_CHECKING, Sequence
  from airflow.configuration import conf
  from airflow.providers.cncf.kubernetes.executors.kubernetes_executor import KubernetesExecutor
  from airflow.utils.log.logging_mixin import LoggingMixin
label_desc: Use image node_id 14 for calling the LocalKubernetesExecutor obj's underlying member method code with example usage: obj.try_adopt_task_instances(tis) and returns: list