class_docstr: CeleryExecutor is recommended for production use of Airflow.
  
  It allows distributing the execution of task instances to multiple worker nodes.
  
  Celery is a simple, flexible and reliable distributed system to process
  vast amounts of messages, while providing operations with the tools
  required to maintain such a system.
class_docstr_tok: ["CeleryExecutor","is","recommended","for","production","use","of","Airflow",".","It","allows","distributing","the","execution","of","task","instances","to","multiple","worker","nodes",".","Celery","is","a","simple",",","flexible","and","reliable","distributed","system","to","process","vast","amounts","of","messages",",","while","providing","operations","with","the","tools","required","to","maintain","such","a","system","."]
code: def sync(self) -> None:
      if not self.tasks:
          self.log.debug("No task to query celery, skipping sync")
          return
      self.update_all_task_states()
  
imports: from __future__ import annotations
  import logging
  import math
  import operator
  import time
  from collections import Counter
  from concurrent.futures import ProcessPoolExecutor
  from multiprocessing import cpu_count
  from typing import TYPE_CHECKING, Any, Optional, Sequence, Tuple
  from celery import states
  from airflow.configuration import conf
  from airflow.exceptions import AirflowTaskTimeout
  from airflow.executors.base_executor import BaseExecutor
  from airflow.stats import Stats
  from airflow.utils.state import TaskInstanceState
label_desc: Use image node_id 6 for calling the CeleryExecutor obj's underlying member method code with example usage: obj.sync() without return types