code: def two_stage_agg(antialias_stage_2: UnzippedAntialiasStage2 | None):
      """Information used to perform the correct stage 2 aggregation."""
      if not antialias_stage_2:
          # Not using antialiased lines, doesn't matter what is returned.
          return False, False
  
      aa_combinations = antialias_stage_2[0]
  
      # A single combination in (SUM_2AGG, FIRST, LAST, MIN) means that a 2-stage
      # aggregation will be used, otherwise use a 1-stage aggregation that is
      # faster.
      use_2_stage_agg = False
      for comb in aa_combinations:
          if comb in (
              AntialiasCombination.SUM_2AGG,
              AntialiasCombination.MIN,
              AntialiasCombination.FIRST,
              AntialiasCombination.LAST,
          ):
              use_2_stage_agg = True
              break
  
      # Boolean overwrite flag is used in _full_antialias() is True to overwrite
      # pixel values (using max of previous and new values) or False for the more
      # complicated correction algorithm. Prefer overwrite=True for speed, but
      # any SUM_1AGG implies overwrite=False.
      overwrite = True
      for comb in aa_combinations:
          if comb == AntialiasCombination.SUM_1AGG:
              overwrite = False
              break
  
      return overwrite, use_2_stage_agg
  
file_path: datashader/datashader/antialias.py
imports: from __future__ import annotations
  from enum import Enum
  from typing import NamedTuple, TYPE_CHECKING
label_desc: Use image node_id 1 for calling a global function with example usage: two_stage_agg(antialias_stage_2) and returns: overwrite,  use_2_stage_agg, False,  False