Filter certain entries with given name.
761573
def filter_data(df, filter_name, verbose=False):
    ""

    # pick only entries ending with 'Berlin' in column stop_name, incl. '(Berlin)' 
    # df = df[df.stop_name.apply(lambda cell: 'Berlin' in cell)]
    df = df[df.stop_name.apply(
        lambda cell: filter_name.encode('utf-8') in cell)]

    # remove ' (Berlin)' in column stop_name
    # df.stop_name = df.stop_name.apply(lambda cell: re.sub(' \(Berlin\)', '', cell))

    # remove initial 'S' and 'U' and 'S+U' in column stop_name
    # this creates a warning!
    # df.stop_name = df.stop_name.apply(lambda cell: re.sub('^([S\+U]+) +(.*)', lambda m: m.groups()[1], cell))

    if verbose:
        msg = '- Filtered down to %d entries containing "%s".'
        print(msg % (len(df), filter_name))

    return df
1080500
def filter(self, table, snapshots, filter_string):
        """"""
        query = filter_string.lower()
        return [snapshot for snapshot in snapshots
                if query in snapshot.name.lower()]
802665
def filter_host_by_name(name):
    

    def inner_filter(items):
        """Inner filter for host. Accept if host_name == name"""
        host = items["host"]
        if host is None:
            return False
        return host.host_name == name

    return inner_filter
295650
function filterForKeyword(extensionList, word) {
            var filteredList = [];
            extensionList.forEach(function (id) {
                var entry = self._getEntry(id);
                if (entry && self._entryMatchesQuery(entry, word)) {
                    filteredList.push(id);
                }
            });
            return filteredList;
        }
1323388
def filter_short(terms):
    '''
    
    '''
    return [term for i, term in enumerate(terms) if 26**(len(term)) > i]
803911
def simple_filter(self, key, value):
        ""
        searched = {key: value}
        return set([k for k, v in self.data.items() if
                    intersect(searched, v) == searched])
194568
def filter(self):  # noqa A001
        """"""

        return [tag for tag in self.get_contents(self.tag) if not self.is_navigable_string(tag) and self.match(tag)]
435058
private EntryImpl checkOldName(String baseName) {
        EntryImpl e = (EntryImpl) name2entry.get(baseName);
        if (e == null) {
            throw new IllegalArgumentException("Filter not found:" + baseName);
        }
        return e;
    }
165020
def filter(self, table, volume_types, filter_string):
        """"""
        query = filter_string.lower()
        return [volume_type for volume_type in volume_types
                if query in volume_type.name.lower()]
681763
def filter_all_contents(value: ecore.EPackage, type_):
        """"""
        return (c for c in value.eAllContents() if isinstance(c, type_))
449877
function filter( arr, str ) {
	var len = arr.length,
		out = [],
		i;

	for ( i = 0; i < len; i++ ) {
		if ( arr[ i ] !== str ) {
			out.push( arr[ i ] );
		}
	}
	return out;
}
1161378
def _filter_records(self, records, rtype=None, name=None, content=None, identifier=None):  # pylint: disable=too-many-arguments,no-self-use
        
        if not records:
            return []
        if identifier is not None:
            LOGGER.debug('Filtering %d records by id: %s', len(records), identifier)
            records = [record for record in records if record['id'] == identifier]
        if rtype is not None:
            LOGGER.debug('Filtering %d records by type: %s', len(records), rtype)
            records = [record for record in records if record['type'] == rtype]
        if name is not None:
            LOGGER.debug('Filtering %d records by name: %s', len(records), name)
            if name.endswith('.'):
                name = name[:-1]
            records = [record for record in records if name == record['name']]
        if content is not None:
            LOGGER.debug('Filtering %d records by content: %s', len(records), content.lower())
            records = [record for record in records if
                       record['content'].lower() == content.lower()]
        return records
268891
def _filter(self, filename):
        
        return self.name_filter is not None and re.search(self.name_filter, filename) is None
171962
def __StripName(self, name):
        """"""
        if not name:
            return name
        for prefix in self.__strip_prefixes:
            if name.startswith(prefix):
                return name[len(prefix):]
        return name
403360
def filter_by(self, string):
        """"""

        self._reatach()
        if string == '':
            self.filter_remove()
            return

        self._expand_all()
        self.treeview.selection_set('')

        children = self.treeview.get_children('')
        for item in children:
            _, detached = self._detach(item)
            if detached:
                self._detached.extend(detached)
        for i, p, idx in self._detached:
            # txt = self.treeview.item(i, 'text')
            self.treeview.detach(i)
        self.filter_on = True
149455
def filter_core_keywords(keywords):
    """"""
    matches = {}
    for kw, info in keywords.items():
        if kw.core:
            matches[kw] = info
    return matches
337229
def _filter_candidates(self, tokens, candidates):
        """"""
        results = []
        for abbr_span, long_span in candidates:
            abbr = tokens[abbr_span[0]:abbr_span[1]]
            long = tokens[long_span[0]:long_span[1]]
            if not all(a in long for a in abbr) and len(''.join(long)) > len(''.join(abbr)):
                results.append((abbr_span, long_span))
        return results