Returns the elements in `iterable` that pass given `filters`
557494
def filter(cls, filters, iterable):
    ''''''
    if isinstance(filters, Filter):
      filters = [filters]

    for filter in filters:
      iterable = filter.generator(iterable)

    return iterable
652777
function(filter, result){
      var node;

      if (!result)
        result = [];

      this.reset();

      while (node = this.next(filter))
        result.push(node);

      return result;
    }
297945
def _match_filters(parameter, filters=None):
        """"""
        for filter_obj in (filters or []):
            key = filter_obj['Key']
            option = filter_obj.get('Option', 'Equals')
            values = filter_obj.get('Values', [])

            what = None
            if key == 'Type':
                what = parameter.type
            elif key == 'KeyId':
                what = parameter.keyid

            if option == 'Equals'\
                    and not any(what == value for value in values):
                return False
            elif option == 'BeginsWith'\
                    and not any(what.startswith(value) for value in values):
                return False
        # True if no false match (or no filters at all)
        return True
310793
def each_filter
            filters = self.Filter

            return enum_for(__method__) do
                case filters
                when NilClass then 0
                when Array then filters.length
                else
                    1
                end
            end unless block_given?

            return if filters.nil?

            if filters.is_a?(Array)
                filters.each do |filter| yield(filter) end
            else
                yield(filters)
            end

            self
        end
608441
def get_joined_filters(self, filters):
        
        retfilters = Filters(self.filter_converter, self.datamodel)
        retfilters.filters = self.filters + filters.filters
        retfilters.values = self.values + filters.values
        return retfilters
1051124
def getElements(self, filter):
		
		l = reduce(lambda l, e: l + e.getElements(filter), self.childNodes, [])
		if filter(self):
			l.append(self)
		return l
265781
private FilterList getFilterList(Filter filters)
    {
        FilterList filterList = null;
        if (filters != null)
        {
            if (FilterList.class.isAssignableFrom(filters.getClass()))
            {
                filterList = (FilterList) filters;
            }
            else
            {
                filterList = new FilterList();
                filterList.addFilter(filters);
            }
        }
        return filterList;
    }
1197017
def filters(self):
        
        objects = javabridge.get_env().get_object_array_elements(
            javabridge.call(self.jobject, "getFilters", "()[Lweka/filters/Filter;"))
        result = []
        for obj in objects:
            result.append(Filter(jobject=obj))
        return result
244933
public static <T> List<T> filter( Iterable<T> collection, Predicate<T> predicate)
    {
        List<T> filtered = new ArrayList<T>();
        for (T element : collection)
        {
        	if (predicate.isVerifiedBy(element))
        	{
        		filtered.add(element);
        	}
        }
        return filtered;
    }
247273
def iter_members(self):
        
        if self.everything:
            raise ValueError("Can not iterate everything")
        for coord in sorted(self.elements):
            yield coord
931980
def filtered_elements(self, model):
        """"""
        if isinstance(model, self.element_type):
            yield model
        yield from (e for e in model.eAllContents() if isinstance(e, self.element_type))
1349348
def documents(cls, filter=None, **kwargs):
        
        documents = [cls(document) for document in cls.find(filter, **kwargs)]
        return [document for document in documents if document.document]
1347037
function filterGenerator(filter) {
	if(typeof filter === "boolean")
		return () => filter;

	if(typeof filter === "function")
		return filter;

	if(filter instanceof RegExp)
		return input => filter.test(input);

	if(filter instanceof Set)
		return input => filter.has(input);

	if(filter instanceof Map)
		return input => !!filter.get(input);

	if(Array.isArray(filter))
		return input => filter.indexOf(input) !== -1;

	if(filter && typeof filter === "object")
		return input => !!filter[input];

	throw new TypeError("Invalid filter type.");
}
373380
def get_filters(self, filter_id=None, params=None):
        
        return self.transport.perform_request(
            "GET", _make_path("_ml", "filters", filter_id), params=params
        )
1154265
function arrayFilter (obj, iterate, context) {
  var result = []
  if (obj && iterate) {
    context = context || this
    if (obj.filter) {
      return obj.filter(iterate, context)
    }
    baseExports.each(obj, function (val, key) {
      if (iterate.call(context, val, key, obj)) {
        result.push(val)
      }
    })
  }
  return result
}
1365630
def filtered(self, efilter):
        '''
        
        '''
        if not self.params:
            self.params={'filter' : efilter}
            return self
        if not self.params.has_key('filter'):
            self.params['filter'] = efilter
            return self
        self.params['filter'].update(efilter)
        return self
605224
def readFILTERLIST(self):
        
        number = self.readUI8()
        return [self.readFILTER() for _ in range(number)]