def add_validator(segmentation_type, validator_function):
 if (segmentation_type in _supported):
  msg = (_('Cannot redefine existing %s segmentation type') % segmentation_type)
  raise KeyError(msg)
 _supported[segmentation_type] = validator_function

def add_validator ( segmentation_type , validator_function ) : if ( segmentation_type in _supported ) : msg = ( _ ( 'Cannot redefine existing %s segmentation type' ) % segmentation_type ) raise KeyError ( msg ) _supported [ segmentation_type ] = validator_function
introduce new entry to the map of supported segmentation types .