class_docstr: Base class to inherit for concrete executors such as Celery, Kubernetes, Local, Sequential, etc.
  
  :param parallelism: how many jobs should run at one time. Set to ``0`` for infinity.
class_docstr_tok: ["Base","class","to","inherit","for","concrete","executors","such","as","Celery",",","Kubernetes",",","Local",",","Sequential",",","etc",".",":","param","parallelism",":","how","many","jobs","should","run","at","one","time",".","Set","to","``","0","``","for","infinity","."]
docstr: Return and flush the event buffer.
  
  In case dag_ids is specified it will only return and flush events
  for the given dag_ids. Otherwise, it returns and flushes all events.
  
  :param dag_ids: the dag_ids to return events for; returns all if given ``None``.
  :return: a dict of events
docstr_tok: ["Return","and","flush","the","event","buffer",".","In","case","dag_ids","is","specified","it","will","only","return","and","flush","events","for","the","given","dag_ids",".","Otherwise",",","it","returns","and","flushes","all","events",".",":","param","dag_ids",":","the","dag_ids","to","return","events","for",";","returns","all","if","given","``","None","``",".",":","return",":","a","dict","of","events"]
code: def get_event_buffer(
      self, dag_ids=None
  ) -> dict[TaskInstanceKey, EventBufferValueType]:
      """
      Return and flush the event buffer.
  
      In case dag_ids is specified it will only return and flush events
      for the given dag_ids. Otherwise, it returns and flushes all events.
  
      :param dag_ids: the dag_ids to return events for; returns all if given ``None``.
      :return: a dict of events
      """
      cleared_events: dict[TaskInstanceKey, EventBufferValueType] = {}
      if dag_ids is None:
          cleared_events = self.event_buffer
          self.event_buffer = {}
      else:
          for ti_key in list(self.event_buffer.keys()):
              if ti_key.dag_id in dag_ids:
                  cleared_events[ti_key] = self.event_buffer.pop(ti_key)
  
      return cleared_events
  
imports: from __future__ import annotations
  import logging
  import sys
  import warnings
  from collections import defaultdict
  from dataclasses import dataclass, field
  from typing import TYPE_CHECKING, Any, List, Optional, Sequence, Tuple
  import pendulum
  from airflow.cli.cli_config import DefaultHelpParser
  from airflow.configuration import conf
  from airflow.exceptions import RemovedInAirflow3Warning
  from airflow.stats import Stats
  from airflow.utils.log.logging_mixin import LoggingMixin
  from airflow.utils.state import TaskInstanceState
label_desc: Use image node_id 15 for calling the BaseExecutor obj's underlying member method code with example usage: obj.get_event_buffer(dag_ids) and returns: cleared_events