def get_validator(validator):
 if (not _validators_cache):
  validators = _import_module_functions('ckan.lib.navl.validators')
  _validators_cache.update(validators)
  validators = _import_module_functions('ckan.logic.validators')
  _validators_cache.update(validators)
  _validators_cache.update({'OneOf': formencode.validators.OneOf})
  converters = _import_module_functions('ckan.logic.converters')
  _validators_cache.update(converters)
  for plugin in p.PluginImplementations(p.IValidators):
   for (name, fn) in plugin.get_validators().items():
    if (name in _validators_cache):
     raise NameConflict(('The validator %r is already defined' % (name,)))
    log.debug('Validator function {0} from plugin {1} was inserted'.format(name, plugin.name))
    _validators_cache[name] = fn
 try:
  return _validators_cache[validator]
 except KeyError:
  raise UnknownValidator(('Validator `%s` does not exist' % validator))

def get_validator ( validator ) : if ( not _validators_cache ) : validators = _import_module_functions ( 'ckan.lib.navl.validators' ) _validators_cache . update ( validators ) validators = _import_module_functions ( 'ckan.logic.validators' ) _validators_cache . update ( validators ) _validators_cache . update ( { 'OneOf' : formencode . validators . OneOf } ) converters = _import_module_functions ( 'ckan.logic.converters' ) _validators_cache . update ( converters ) for plugin in p . PluginImplementations ( p . IValidators ) : for ( name , fn ) in plugin . get_validators ( ) . items ( ) : if ( name in _validators_cache ) : raise NameConflict ( ( 'The validator %r is already defined' % ( name , ) ) ) log . debug ( 'Validator function {0} from plugin {1} was inserted' . format ( name , plugin . name ) ) _validators_cache [ name ] = fn try : return _validators_cache [ validator ] except KeyError : raise UnknownValidator ( ( 'Validator `%s` does not exist' % validator ) )
get validator for the segmentation type or keyerror if not found .