@staticmethod
  def _aggregator_counter_kind(combine_fn):
    """Returns the counter aggregation kind for the combine_fn passed in.

    Args:
      combine_fn: The combining function used in an Aggregator.

    Returns:
      The aggregation_kind (to use in a Counter) that matches combine_fn.

    Raises:
      ValueError if the combine_fn doesn't map to any supported
      aggregation kind.
    """
    # We don't have combiner types that implement AND or OR.
    combine_kind_map = {sum: Counter.SUM, max: Counter.MAX, min: Counter.MIN,
                        combiners.Mean: Counter.MEAN}
    try:
      return combine_kind_map[combine_fn]
    except __HOLE__:
      try:
        return combine_kind_map[combine_fn.__class__]
      except KeyError:
        raise ValueError(
            'combine_fn %r (class %r) '
            'does not map to a supported aggregation kind'
            % (combine_fn, combine_fn.__class__))
dataset/ETHPy150Open GoogleCloudPlatform/DataflowPythonSDK/google/cloud/dataflow/transforms/aggregator.py/Aggregator._aggregator_counter_kind