def get_calculator(counter_type):
 try:
  return _counter_type_calculators[counter_type]
 except KeyError:
  raise UndefinedCalculator

def get_calculator ( counter_type ) : try : return _counter_type_calculators [ counter_type ] except KeyError : raise UndefinedCalculator
return the calculator associated with the counter_type when it exists .