Gets the filter type specified by the given hints.

@param pHints rendering hints
@return a filter type constant
512892
private static int getFilterType(RenderingHints pHints) {
        if (pHints == null) {
            return FILTER_UNDEFINED;
        }

        if (pHints.containsKey(KEY_RESAMPLE_INTERPOLATION)) {
            Object value = pHints.get(KEY_RESAMPLE_INTERPOLATION);
            // NOTE: Workaround for a bug in RenderingHints constructor (Bug id# 5084832)
            if (!KEY_RESAMPLE_INTERPOLATION.isCompatibleValue(value)) {
                throw new IllegalArgumentException(value + " incompatible with key " + KEY_RESAMPLE_INTERPOLATION);
            }
            return value != null ? ((Value) value).getFilterType() : FILTER_UNDEFINED;
        }
        else if (RenderingHints.VALUE_INTERPOLATION_NEAREST_NEIGHBOR.equals(pHints.get(RenderingHints.KEY_INTERPOLATION))
                || (!pHints.containsKey(RenderingHints.KEY_INTERPOLATION)
                && (RenderingHints.VALUE_RENDER_SPEED.equals(pHints.get(RenderingHints.KEY_RENDERING))
                || RenderingHints.VALUE_COLOR_RENDER_SPEED.equals(pHints.get(RenderingHints.KEY_COLOR_RENDERING))))) {
            // Nearest neighbour, or prioritize speed
            return FILTER_POINT;
        }
        else if (RenderingHints.VALUE_INTERPOLATION_BILINEAR.equals(pHints.get(RenderingHints.KEY_INTERPOLATION))) {
            // Triangle equals bi-linear interpolation
            return FILTER_TRIANGLE;
        }
        else if (RenderingHints.VALUE_INTERPOLATION_BICUBIC.equals(pHints.get(RenderingHints.KEY_INTERPOLATION))) {
            return FILTER_QUADRATIC;// No idea if this is correct..?
        }
        else if (RenderingHints.VALUE_RENDER_QUALITY.equals(pHints.get(RenderingHints.KEY_RENDERING))
                || RenderingHints.VALUE_COLOR_RENDER_QUALITY.equals(pHints.get(RenderingHints.KEY_COLOR_RENDERING))) {
            // Prioritize quality
            return FILTER_MITCHELL;
        }

        // NOTE: Other hints are ignored
        return FILTER_UNDEFINED;
    }
1210921
def get_querysets_for_context_hints(context_hints_per_source):
    
    model_select_relateds = defaultdict(set)
    model_prefetch_relateds = defaultdict(set)
    model_querysets = {}
    for context_hints in context_hints_per_source.values():
        for hints in context_hints.values():
            model = get_model(hints['app_name'], hints['model_name'])
            model_querysets[model] = model.objects
            model_select_relateds[model].update(hints.get('select_related', []))
            model_prefetch_relateds[model].update(hints.get('prefetch_related', []))

    # Attach select and prefetch related parameters to the querysets if needed
    for model, queryset in model_querysets.items():
        if model_select_relateds[model]:
            queryset = queryset.select_related(*model_select_relateds[model])
        if model_prefetch_relateds[model]:
            queryset = queryset.prefetch_related(*model_prefetch_relateds[model])
        model_querysets[model] = queryset

    return model_querysets
1287003
function _getFilterIndex(filterSets, filter) {
        var index = -1;

        if (!filter || !filterSets.length) {
            return index;
        }

        return _.findIndex(filterSets, _.partial(_.isEqual, filter));
    }
477321
public CmsLockFilter filterIncludeChildren() {

        CmsLockFilter filter = (CmsLockFilter)clone();
        filter.m_includeChildren = true;
        return filter;
    }
1208068
def _get_type_hints(func, args = None, res = None, infer_defaults = None):
    
    if args is None or res is None:
        args2, res2 = _get_types(func, util.is_classmethod(func),
                util.is_method(func), unspecified_type = type(NotImplemented),
                infer_defaults = infer_defaults)
        if args is None:
            args = args2
        if res is None:
            res = res2
    slf = 1 if util.is_method(func) else 0
    argNames = util.getargnames(util.getargspecs(util._actualfunc(func)))
    result = {}
    if not args is Any:
        prms = get_Tuple_params(args)
        for i in range(slf, len(argNames)):
            if not prms[i-slf] is type(NotImplemented):
                result[argNames[i]] = prms[i-slf]
    result['return'] = res
    return result
279047
private static LinkedHashSet<Provider> getAllQualifyingCandidates(
                                                String filterKey,
                                                String filterValue,
                                                Provider[] allProviders) {
        String[] filterComponents = getFilterComponents(filterKey,
                                                        filterValue);

        // The first component is the service name.
        // The second is the algorithm name.
        // If the third isn't null, that is the attrinute name.
        String serviceName = filterComponents[0];
        String algName = filterComponents[1];
        String attrName = filterComponents[2];

        return getProvidersNotUsingCache(serviceName, algName, attrName,
                                         filterValue, allProviders);
    }
485774
public TypeInfo getSchemaTypeInfo() {
	// dynamic load to support jre 1.4 and 1.5
	try {
	    Method m = element.getClass().getMethod("getSchemaTypeInfo", new Class[] {});
	    return (TypeInfo) m.invoke(element, ArrayUtil.OBJECT_EMPTY);
	}
	catch (Exception e) {
	    throw new PageRuntimeException(Caster.toPageException(e));
	}
    }
1230760
public static AccessibilityNodeInfoCompat getSelfOrMatchingAncestor(
            Context context, AccessibilityNodeInfoCompat node, NodeFilter filter) {
        if (node == null) {
            return null;
        }

        if (filter.accept(context, node)) {
            return AccessibilityNodeInfoCompat.obtain(node);
        }

        return getMatchingAncestor(context, node, filter);
    }
967352
public final WritableRaster filter(final Raster pSource, WritableRaster pDest) {
        return filter(pSource, pDest, getICM(pSource));
    }
887589
def get_filters(self):
        
        if self._filters:
            filters_list = self._filters
            if isinstance(filters_list[-1], Enum):
                filters_list = filters_list[:-1]
            return ' '.join(
                [fs.value if isinstance(fs, Enum) else fs[1] for fs in
                 filters_list]).strip()
        else:
            return None
842890
public static int lookup(String text, int filter) {
        int type = UNKNOWN;

        if (LOOKUP.containsKey(text)) {
            type = LOOKUP.get(text);
            if (filter != UNKNOWN && !ofType(type, filter)) {
                type = UNKNOWN;
            }
        }

        return type;
    }
1054498
public Set<Class<?>> findReferencedTypes(String typeName) {
        Set<Class<?>> referencedTypes = new HashSet<>();

        // use the cached version if possible
        if (referencedTypesCache.containsKey(typeName)) {
            return referencedTypesCache.get(typeName);
        }

        try {
            CtClass cc = classPool.get(typeName);
            for (Object referencedType : cc.getRefClasses()) {
                String referencedTypeName = (String)referencedType;

                if (!isExcluded(referencedTypeName)) {
                    try {
                        referencedTypes.add(loadClass(referencedTypeName));
                    } catch (Throwable t) {
                        log.debug("Could not find " + referencedTypeName + " ... ignoring.");
                    }
                }
            }

            // remove the type itself
            referencedTypes.remove(loadClass(typeName));
        } catch (Exception e) {
            log.debug("Error finding referenced types for " + typeName + " ... ignoring.");

            // since there was an error, we can't find the set of referenced types from it, so...
            referencedTypesCache.put(typeName, new HashSet<>());
        }

        // cache for the next time
        referencedTypesCache.put(typeName, referencedTypes);

        return referencedTypes;
    }
1146808
public CmsRelationFilter filterUserDefined() {

        CmsRelationFilter filter = (CmsRelationFilter)clone();
        if (filter.m_types.isEmpty()) {
            filter.m_types.addAll(CmsRelationType.getAllUserDefined());
        } else {
            filter.m_types = new HashSet<CmsRelationType>(CmsRelationType.filterUserDefined(filter.m_types));
        }
        return filter;
    }
1292947
private Description findShadowedTypes(
      Tree tree, List<? extends TypeParameterTree> typeParameters, VisitorState state) {

    Env<AttrContext> env =
        Enter.instance(state.context)
            .getEnv(ASTHelpers.getSymbol(state.findEnclosing(ClassTree.class)));

    Symtab symtab = state.getSymtab();
    PackageSymbol javaLang =
        symtab.enterPackage(symtab.java_base, Names.instance(state.context).java_lang);

    Iterable<Symbol> enclosingTypes = typesInEnclosingScope(env, javaLang);

    List<Symbol> shadowedTypes =
        typeParameters.stream()
            .map(
                param ->
                    Iterables.tryFind(
                            enclosingTypes,
                            sym ->
                                sym.getSimpleName()
                                    .equals(ASTHelpers.getType(param).tsym.getSimpleName()))
                        .orNull())
            .filter(Objects::nonNull)
            .collect(ImmutableList.toImmutableList());

    if (shadowedTypes.isEmpty()) {
      return Description.NO_MATCH;
    }

    Description.Builder descBuilder = buildDescription(tree);

    descBuilder.setMessage(buildMessage(shadowedTypes));

    Set<String> visibleNames =
        Streams.stream(Iterables.concat(env.info.getLocalElements(), enclosingTypes))
            .map(sym -> sym.getSimpleName().toString())
            .collect(ImmutableSet.toImmutableSet());

    SuggestedFix.Builder fixBuilder = SuggestedFix.builder();
    shadowedTypes.stream()
        .filter(tv -> TypeParameterNamingClassification.classify(tv.name.toString()).isValidName())
        .map(
            tv ->
                TypeParameterShadowing.renameTypeVariable(
                    TypeParameterShadowing.typeParameterInList(typeParameters, tv),
                    tree,
                    TypeParameterShadowing.replacementTypeVarName(tv.name, visibleNames),
                    state))
        .forEach(fixBuilder::merge);

    descBuilder.addFix(fixBuilder.build());
    return descBuilder.build();
  }
113505
private OASFilter getFilter() {
        ClassLoader cl = getContextClassLoader();
        if (cl == null) {
            cl = OpenApiServletContextListener.class.getClassLoader();
        }
        return OpenApiProcessor.getFilter(config, cl);
    }
195540
public Filter getFilter()
        throws CacheReloadException
    {
        final IWhere where = eqlStmt.getQuery().getWhere();
        final IOrder order = eqlStmt.getOrder();
        return Filter.get(where, order, getTypes().toArray(new Type[getTypes().size()]));
    }
421029
public List<ZuulFilter> getFiltersByType(FilterType filterType) {

        List<ZuulFilter> list = hashFiltersByType.get(filterType);
        if (list != null) return list;

        list = new ArrayList<ZuulFilter>();

        Collection<ZuulFilter> filters = filterRegistry.getAllFilters();
        for (Iterator<ZuulFilter> iterator = filters.iterator(); iterator.hasNext(); ) {
            ZuulFilter filter = iterator.next();
            if (filter.filterType().equals(filterType)) {
                list.add(filter);
            }
        }

        // Sort by filterOrder.
        Collections.sort(list, new Comparator<ZuulFilter>() {
            @Override
            public int compare(ZuulFilter o1, ZuulFilter o2) {
                return o1.filterOrder() - o2.filterOrder();
            }
        });

        hashFiltersByType.putIfAbsent(filterType, list);
        return list;
    }