Registers a path specification resolver helper.

    Args:
      resolver_helper (ResolverHelper): resolver helper.

    Raises:
      KeyError: if resolver helper object is already set for the corresponding
          type indicator.
546905
def RegisterHelper(cls, resolver_helper):
    
    if resolver_helper.type_indicator in cls._resolver_helpers:
      raise KeyError((
          'Resolver helper object already set for type indicator: '
          '{0!s}.').format(resolver_helper.type_indicator))

    cls._resolver_helpers[resolver_helper.type_indicator] = resolver_helper
835897
def resolvers
      @resolvers ||= from.merge(default: self).map { |origin, hint| { origin: origin, hint: hint, resolver: ((has_group? && group.resolvers[origin]) || Resolver.for(origin)) } }
    end
310085
protected Serializer<?> createVia(SerializerResolver<?> resolver, Type type, Annotation... hints)
	{
		Set<Type> s = stack.get();

		// Only expose the hints that the resolver has declared
		Set<Class<? extends Annotation>> hintsUsed = resolver.getHints();
		List<Annotation> hintsActive;
		if(hintsUsed == null || hints == null || hints.length == 0)
		{
			hintsActive = Collections.emptyList();
		}
		else
		{
			hintsActive = new ArrayList<>();
			for(Annotation a : hints)
			{
				if(hintsUsed.contains(a.annotationType()))
				{
					hintsActive.add(a);
				}
			}
		}

		// Check if we have already built a serializer for this type
		CacheKey key = new CacheKey(type, hintsActive.toArray());
		Serializer<?> serializer = serializers.get(key);
		if(serializer != null)
		{
			return serializer;
		}

		// Stack to keep track of circular dependencies
		if(s == null)
		{
			s = new HashSet<Type>();
			stack.set(s);
		}

		try
		{
			s.add(type);

			// Find a serializer to use
			TypeEncounterImpl encounter = new TypeEncounterImpl(this, type, hintsActive);

			serializer = resolver.find(encounter);
			if(serializer == null)
			{
				throw new SerializationException("Unable to find serializer for " + type + " using " + resolver.getClass());
			}

			registerIfNamed(type.getErasedType(), serializer);

			// Store the found serializer in the cache
			serializers.put(key, serializer);
			return serializer;
		}
		finally
		{
			s.remove(type);

			if(s.isEmpty())
			{
				stack.remove();
			}
		}
	}
1330701
def alias(self, source: type, target: Any) -> Any:
        
        self.register(target, lambda c: c.resolve(source))
114911
def _GetResolverHelper(cls, type_indicator):
    
    if not cls._resolver_helpers_manager:
      # Delay the import of the resolver helpers manager to prevent circular
      # imports.
      from dfvfs.resolver_helpers import manager

      cls._resolver_helpers_manager = manager.ResolverHelperManager

    return cls._resolver_helpers_manager.GetHelper(type_indicator)
1027474
def register_reference(self, dispatcher, node):
        

        # the identifier node itself will be mapped to the current scope
        # for the resolve to work
        # This should probably WARN about the node object being already
        # assigned to an existing scope that isn't current_scope.
        self.identifiers[node] = self.current_scope
        self.current_scope.reference(node.value)
1137939
def register_prefix(self, path):
        
        if path not in self._prefixes:
            LOG.debug('%r: registering prefix %r', self, path)
            self._prefixes.add(path)
1158876
def resolve_content_type(type_resolvers, request):
    # type: (Iterable[Callable[[Any], str]], Any) -> Optional[str]
    
    for resolver in type_resolvers:
        content_type = parse_content_type(resolver(request))
        if content_type:
            return content_type
719856
def register(name):
    """"""
    def decorator(class_):
        if name in known_resolvers:
            raise ValueError('duplicate resolver name "%s"' % name)
        known_resolvers[name] = class_
    return decorator
362656
def register(cls, name, type_):
        

        if not issubclass(type_, Entry):
            raise exceptions.InvalidEntryType("%s is not a subclass of Entry" % str(type_))
        cls._registry[name.lower()] = type_
216764
public final TcpClient resolver(AddressResolverGroup<?> resolver) {
		Objects.requireNonNull(resolver, "resolver");
		return bootstrap(b -> b.resolver(resolver));
	}
831157
def RegisterPathSpec(cls, path_spec_type):
    
    type_indicator = path_spec_type.TYPE_INDICATOR
    if type_indicator in cls._path_spec_types:
      raise KeyError(
          'Path specification type: {0:s} already set.'.format(
              type_indicator))

    cls._path_spec_types[type_indicator] = path_spec_type

    if getattr(path_spec_type, '_IS_SYSTEM_LEVEL', False):
      cls._system_level_type_indicators[type_indicator] = path_spec_type
990166
function Resolver(root, dot, sep) {
    if (!Is.instance(this, Resolver)) {
        return PKG.Builder(root, dot, sep).get();
    }

    this.aliases = {};
    /**
     * Root path.
     *
     * @private
     * @type {string}
     */
     this.root = PKG.ROOT;
    /**
     * Character separator used in path keys.
     *
     * @private
     * @type {string}
     * @default {@link Dotresolver.DOT}
     */
    this.dot = dot || PKG.DOT;
    /**
     * Character separator used in built path.
     *
     * @private
     * @type {string}
     * @default {@link Dotresolver.SEP}
     */
    this.sep = sep || PKG.SEP;

    this.setRoot(root);
}
1156718
def RegisterPartitionResolver(self, database_link, partition_resolver):
        
        if not database_link:
            raise ValueError("database_link is None or empty.")

        if partition_resolver is None:
            raise ValueError("partition_resolver is None.")

        self.partition_resolvers = {base.TrimBeginningAndEndingSlashes(database_link): partition_resolver}
62311
public void registerVariantResolver(VariantResolver resolver) {

		for (VariantResolver variantResolver : variantResolvers.values()) {
			if (StringUtils.isEmpty(resolver.getVariantType())) {
				throw new IllegalStateException(
						"The getVariantType() method must return something at " + resolver.getClass());
			}

			if (resolver.getVariantType().equals(variantResolver.getVariantType())) {
				throw new IllegalStateException("There are 2 resolvers defined for the variant type '"
						+ resolver.getVariantType() + "' : " + variantResolver.getClass() + ";" + resolver.getClass());
			}
		}
		variantResolvers.put(resolver.getVariantType(), resolver);
	}
149965
def add_implicit_resolver(tag, regexp, first=None,
        Loader=Loader, Dumper=Dumper):
    
    Loader.add_implicit_resolver(tag, regexp, first)
    Dumper.add_implicit_resolver(tag, regexp, first)
1080340
def register(self, alias, uri):
        
        # TODO: do we want to constrain the valid alias names.
        if isinstance(uri, dict):
            id = uri.get('id', alias)
            self.resolver.store[id] = uri
            uri = id
        self.aliases[alias] = uri