Resolves a list of accepted MediaTypes and available renderers to the preferred renderer.

        Call as MediaType.resolve([MediaType], [renderer]).
437043
def resolve(cls, accept, available_renderers):
        
        assert isinstance(available_renderers, tuple)
        accept = sorted(accept)

        renderers, seen = [], set()

        accept_groups = [[accept.pop()]]
        for imt in accept:
            if imt.equivalent(accept_groups[-1][0]):
                accept_groups[-1].append(imt)
            else:
                accept_groups.append([imt])

        for accept_group in accept_groups:
            for renderer in available_renderers:
                if renderer in seen:
                    continue
                for mimetype in renderer.mimetypes:
                    for imt in accept_group:
                        if mimetype.provides(imt):
                            renderers.append(renderer)
                            seen.add(renderer)
                            break

        return renderers
765692
def perform_content_negotiation(self, request, force=False):
        
        renderers = self.get_renderers()
        conneg = self.get_content_negotiator()

        try:
            return conneg.select_renderer(request, renderers, self.format_kwarg)
        except Exception:
            if force:
                return (renderers[0], renderers[0].media_type)
            raise
1116895
public void resolveExtendingTypes(Set<ModelElementType> allExtendingTypes) {
    for(ModelElementType modelElementType : extendingTypes) {
      ModelElementTypeImpl modelElementTypeImpl = (ModelElementTypeImpl) modelElementType;
      if (!allExtendingTypes.contains(modelElementTypeImpl)) {
        allExtendingTypes.add(modelElementType);
        modelElementTypeImpl.resolveExtendingTypes(allExtendingTypes);
      }
    }
  }
315794
def mediatypes(self):
        """"""
        return [h for h, q in sorted(request.accept_mimetypes,
                                     key=operator.itemgetter(1), reverse=True)]
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
993963
public static List<ObjectModelResolver> getResolvers() {
        if (resolvers == null) {
            synchronized (serviceLoader) {
                if (resolvers == null) {
                    List<ObjectModelResolver> foundResolvers = new ArrayList<ObjectModelResolver>();
                    for (ObjectModelResolver resolver : serviceLoader) {
                        foundResolvers.add(resolver);
                    }
                    resolvers = foundResolvers;
                }
            }
        }

        return resolvers;
    }
10561
@NonNull
	public static ResolvedType resolveSubtype(@NonNull ResolvedType superType, @NonNull Class<?> subType)
	{
		return typeResolver.resolveSubtype(superType, subType);
	}
558526
private static void resolveDependencies(Collection<ArtifactSpec> collection, ShrinkwrapArtifactResolvingHelper helper) {
        // Identify the artifact specs that need resolution.
        // Ideally, there should be none at this point.
        collection.forEach(spec -> {
            if (spec.file == null) {
                // Resolve it.
                ArtifactSpec resolved = helper.resolve(spec);
                if (resolved != null) {
                    spec.file = resolved.file;
                } else {
                    throw new IllegalStateException("Unable to resolve artifact: " + spec.toString());
                }
            }
        });
    }
429452
def filter_renderers(self, renderers, format):
        
        renderers = [renderer for renderer in renderers
                     if renderer.format == format]
        if not renderers:
            raise Http404
        return renderers
681348
public Route accepts(String... types) {
        Preconditions.checkNotNull(types);
        final ImmutableSet.Builder<MediaType> builder = new ImmutableSet.Builder<>();
        builder.addAll(this.acceptedMediaTypes);
        for (String s : types) {
            builder.add(MediaType.parse(s));
        }
        this.acceptedMediaTypes = builder.build();
        return this;
    }
1310002
@SuppressWarnings({ "unchecked", "rawtypes" })
    protected Type resolveType(Type type) {

        Map<TypeVariable, Type> map = new HashMap<>();
        map.putAll(getTypeVariableMap());

        return ResolvableType.forType(type, new TypeVariableMapVariableResolver(map)).getType();
    }
531527
private List<RequestHandler2> resolveRequestHandlers() {
        return (requestHandlers == null) ? new ArrayList<RequestHandler2>() :
                new ArrayList<RequestHandler2>(requestHandlers);
    }
418676
def resolve(self, component_type, **kwargs):
        
        with self._resolve_lock:
            context = _ComponentContext(self)
            return context.resolve(component_type, **kwargs)
943563
def determine_resolver(params)
      if params[:resolver]
        Djatoka::Resolver.new(params[:resolver])
      elsif Djatoka.resolver
        Djatoka.resolver
      else
        nil
      end
    end
384995
def select_renderer(self, request, renderers):
        
        if not len(request.accept_mimetypes):
            return renderers[0], renderers[0].mimetype

        for mimetype, quality in request.accept_mimetypes:
            accept_mimetype = MimeType.parse(mimetype)
            for renderer in renderers:
                if accept_mimetype.match(renderer.mimetype):
                    return renderer, renderer.mimetype.replace(params=accept_mimetype.params)

        return None, None
506109
function resolve (options) {
  return {
    apiBuilders: resolveOption(options, 'apiBuilders'),
    languages: resolveOption(options, 'languages'),
    targetVersions: resolveOption(options, 'targetVersions'),
    issueUrl: resolveOption(options, 'issueUrl'),
    processChangelogs: resolveOption(options, 'processChangelogs'),
    changelogReverseVisibleList: resolveOption(options, 'changelogReverseVisibleList'),
    changelogGroupByApi: resolveOption(options, 'changelogGroupByApi')
  }
}
117403
function Resolver(readerType) {
  // Add all fields here so that all resolvers share the same hidden class.
  this._readerType = readerType;
  this._read = null;
  this.itemsType = null;
  this.size = 0;
  this.symbols = null;
  this.valuesType = null;
}