(name_or_callable)
Returns aggregator from predefined set by name, else returns callable.
Returns aggregator from predefined set by name, else returns callable.
Returns aggregator from predefined set by name else returns callable .
def _get_aggregator(name_or_callable):
  """Returns aggregator from predefined set by name, else returns callable."""
  if name_or_callable is None:
    return None
  elif not callable(name_or_callable):
    try:
      return AGGREGATORS[name_or_callable]
    except KeyError:
      raise KeyError('Unrecognized aggregator name: {!r}. Valid names: {}.'
                     .format(name_or_callable, AGGREGATORS.keys()))
  else:
    return name_or_callable
def _get_aggregator ( name_or_callable ) : if name_or_callable is None : return None elif not callable ( name_or_callable ) : try : return AGGREGATORS [ name_or_callable ] except KeyError : raise KeyError ( 'Unrecognized aggregator name: {!r}. Valid names: {}.' . format ( name_or_callable , AGGREGATORS . keys ( ) ) ) else : return name_or_callable