class_docstr: Skip tasks that are not running during the most recent schedule interval.
  
  If the task is run outside the latest schedule interval (i.e. external_trigger),
  all directly downstream tasks will be skipped.
  
  Note that downstream tasks are never skipped if the given DAG_Run is
  marked as externally triggered.
class_docstr_tok: ["Skip","tasks","that","are","not","running","during","the","most","recent","schedule","interval",".","If","the","task","is","run","outside","the","latest","schedule","interval","(","i.e",".","external_trigger",")",",","all","directly","downstream","tasks","will","be","skipped",".","Note","that","downstream","tasks","are","never","skipped","if","the","given","DAG_Run","is","marked","as","externally","triggered","."]
code: def choose_branch(self, context: Context) -> str | Iterable[str]:
      # If the DAG Run is externally triggered, then return without
      # skipping downstream tasks
      dag_run: DagRun = context["dag_run"]  # type: ignore[assignment]
      if dag_run.external_trigger:
          self.log.info(
              "Externally triggered DAG_Run: allowing execution to proceed."
          )
          return list(
              context["task"].get_direct_relative_ids(upstream=False)
          )
  
      dag: DAG = context["dag"]
      next_info = dag.next_dagrun_info(
          dag.get_run_data_interval(dag_run), restricted=False
      )
      now = pendulum.now("UTC")
  
      if next_info is None:
          self.log.info(
              "Last scheduled execution: allowing execution to proceed."
          )
          return list(
              context["task"].get_direct_relative_ids(upstream=False)
          )
  
      left_window, right_window = next_info.data_interval
      self.log.info(
          "Checking latest only with left_window: %s right_window: %s now: %s",
          left_window,
          right_window,
          now,
      )
  
      if not left_window < now <= right_window:
          self.log.info("Not latest execution, skipping downstream.")
          # we return an empty list, thus the parent BaseBranchOperator
          # won't exclude any downstream tasks from skipping.
          return []
      else:
          self.log.info("Latest, allowing execution to proceed.")
          return list(
              context["task"].get_direct_relative_ids(upstream=False)
          )
  
imports: from __future__ import annotations
  from typing import TYPE_CHECKING, Iterable
  import pendulum
  from airflow.operators.branch import BaseBranchOperator
label_desc: Use image node_id 1 for calling the LatestOnlyOperator obj's underlying member method code with example usage: obj.choose_branch(context) and returns: list, list, list, list