Apply the search backrefs to the search pattern.
165448
def _apply_search_backrefs(pattern, flags=0):
    """"""

    if isinstance(pattern, (str, bytes)):
        re_verbose = bool(VERBOSE & flags)
        re_unicode = None
        if bool((ASCII | LOCALE) & flags):
            re_unicode = False
        elif bool(UNICODE & flags):
            re_unicode = True
        if not (flags & DEBUG):
            pattern = _cached_search_compile(pattern, re_verbose, re_unicode, type(pattern))
        else:  # pragma: no cover
            pattern = _bre_parse._SearchParser(pattern, re_verbose, re_unicode).parse()
    elif isinstance(pattern, Bre):
        if flags:
            raise ValueError("Cannot process flags argument with a compiled pattern")
        pattern = pattern._pattern
    elif isinstance(pattern, (_RE_TYPE, Bre)):
        if flags:
            raise ValueError("Cannot process flags argument with a compiled pattern!")
    else:
        raise TypeError("Not a string or compiled pattern!")
    return pattern
831948
def write_backreferences(seen_backrefs, gallery_conf,
                         target_dir, fname, snippet):
    """"""
    if gallery_conf['backreferences_dir'] is None:
        return

    example_file = os.path.join(target_dir, fname)
    backrefs = scan_used_functions(example_file, gallery_conf)
    for backref in backrefs:
        include_path = os.path.join(gallery_conf['src_dir'],
                                    gallery_conf['backreferences_dir'],
                                    '%s.examples.new' % backref)
        seen = backref in seen_backrefs
        with codecs.open(include_path, 'a' if seen else 'w',
                         encoding='utf-8') as ex_file:
            if not seen:
                heading = '\n\nExamples using ``%s``' % backref
                ex_file.write(heading + '\n')
                ex_file.write('^' * len(heading) + '\n')
            ex_file.write(_thumbnail_div(target_dir, gallery_conf['src_dir'],
                                         fname, snippet, is_backref=True))
            seen_backrefs.add(backref)
458047
def search(pattern, text):
    ''
    return re.compile(str(pattern)).search(str(text))
170174
protected synchronized void replaceQuerySearchPatterns() {

        String currentKey = null;
        String currentValue = null;
        int startIndex = 0;
        int endIndex = 0;
        int lastIndex = 0;

        Iterator<String> allKeys = m_queries.keySet().iterator();
        while (allKeys.hasNext()) {
            currentKey = allKeys.next();
            currentValue = m_queries.get(currentKey);
            startIndex = 0;
            endIndex = 0;
            lastIndex = 0;

            while ((startIndex = currentValue.indexOf("${", lastIndex)) != -1) {
                endIndex = currentValue.indexOf('}', startIndex);
                if ((endIndex != -1) && !currentValue.startsWith(QUERY_PROJECT_SEARCH_PATTERN, startIndex - 1)) {

                    String replaceKey = currentValue.substring(startIndex + 2, endIndex);
                    String searchPattern = currentValue.substring(startIndex, endIndex + 1);
                    String replacePattern = this.readQuery(replaceKey);

                    if (replacePattern != null) {
                        currentValue = CmsStringUtil.substitute(currentValue, searchPattern, replacePattern);
                    }
                }

                lastIndex = endIndex + 2;
            }
            m_queries.put(currentKey, currentValue);
        }
    }
496186
private void beforeBatch(BatchBackend backend) {
		if ( this.purgeAtStart ) {
			// purgeAll for affected entities
			IndexedTypeSet targetedTypes = searchFactoryImplementor.getIndexedTypesPolymorphic( rootIndexedTypes );
			for ( IndexedTypeIdentifier type : targetedTypes ) {
				// needs do be in-sync work to make sure we wait for the end of it.
				backend.doWorkInSync( new PurgeAllLuceneWork( tenantId, type ) );
			}
			if ( this.optimizeAfterPurge ) {
				backend.optimize( targetedTypes );
			}
		}
	}
1249982
def search_datasets(self, search_phrase, limit=None):
        
        return self.backend.dataset_index.search(search_phrase, limit=limit)
322781
def backprop(self, **args):
        
        retval = self.compute_error(**args)
        if self.learning:
            self.compute_wed()
        return retval
550907
private static function applySearch(&$query, $search)
    {
        foreach ($search as $name => $filters) {
            foreach ($filters as $filter) {
                self::applySearchFilter($query, $filter);
            }
        }
    }
717545
def apply(self, search, field, value):
        """"""
        return search.query(
            self.query_type(  # pylint: disable=not-callable
                **{
                    field: {
                        self.operator: self.get_value_query(value)
                    }
                }
            )
        )
87914
private void applyFilter(){
        filteredItems.clear();

        Filter<M> filter = getFilter();
        if(filter == null){
            filteredItems.addAll(items);
        }else{
            for (int i = 0; i < items.size(); i++) {
                M item = items.get(i);
                if(filter.filter(item, query)){
                    filteredItems.add(item);
                }
            }
        }

        onFiltered();
    }
1273405
function doSearch(editor, searchBackwards) {
        var state = getSearchState(editor._codeMirror);

        if (state.parsedQuery) {
            findNext(editor, searchBackwards);
        } else {
            openSearchBar(editor, false);
        }
    }
780924
def build_re(self, *pattern, **kwargs):
        
        set_defaults(self._regex_defaults, kwargs)
        set_defaults(self._defaults, kwargs)
        return RePattern(*pattern, **kwargs)
526661
private void afterBatch(BatchBackend backend) {
		IndexedTypeSet targetedTypes = searchFactoryImplementor.getIndexedTypesPolymorphic( rootIndexedTypes );
		if ( this.optimizeAtEnd ) {
			backend.optimize( targetedTypes );
		}
		backend.flush( targetedTypes );
	}
838794
def apply(self):
        """"""
        # In this phase, we replace the substitutions in hyperlinks
        # with the contents of the sub-nodes introduced during phase 1.
        # We also remove those temporary nodes from the tree.
        subst_re = re.compile(self.subst_pattern)

        # Apply the substitutions to hyperlink references.
        for link in self.document.traverse(nodes.reference):
            substitutions = link.get('varlinks')
            if not substitutions:
                continue

            replacer = self._replace(substitutions, link.children, 1)
            link['refuri'] = subst_re.sub(replacer, link['refuri'])
            content = subst_re.sub(replacer, link[0])
            # Cleanup the temporary nodes and recreate the node's content.
            link.clear()
            del link['varlinks']
            link.append(nodes.Text(content))

        # Do the same with hyperlink targets.
        for link in self.document.traverse(nodes.target):
            substitutions = link.get('varlinks')
            if not substitutions:
                continue

            replacer = self._replace(substitutions, link.children, 0)
            link['refuri'] = subst_re.sub(replacer, link['refuri'])
            # Cleanup the temporary nodes.
            link.clear()
            del link['varlinks']
126116
def search(self, pattern):
        
        try:
            return self.advanced_search(pattern)
        except Exception:
            return self.basic_search(pattern)
260771
def do_search(self, arg=None):
        """"""
        new_cats = []
        for cat in self.cats:
            new_cat = cat.search(self.inputs.text,
                                 depth=self.inputs.depth)
            if len(list(new_cat)) > 0:
                new_cats.append(new_cat)
        if len(new_cats) > 0:
            self.done_callback(new_cats)
            self.visible = False
1231342
def history_search_backward(self, e): # ()
        '''
        self.l_buffer=self._history.history_search_backward(self.l_buffer)