Filter a set of records by the conditions

 @param [Enumerable] records
   The set of records to be filtered

 @return [Enumerable]
   Whats left of the given array after the matching

 @api semipublic
2733
def match_records(records)
      conditions = self.conditions
      records.select { |record| conditions.matches?(record) }
    end
557494
def filter(cls, filters, iterable):
    ''''''
    if isinstance(filters, Filter):
      filters = [filters]

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

    return iterable
1319528
def filter(self, record: logging.LogRecord):
        
        update = types.Update.get_current(True)
        if update:
            for key, value in self.make_prefix(self.prefix, self.process_update(update)):
                setattr(record, key, value)

        return True
603493
def predicates_for_and_conditions(conditions)
      return nil if conditions.empty?

      predicates = conditions.map do |q|
        q = HashWithIndifferentAccess.new(Netzke::Support.permit_hash_params(q))

        attr = q[:attr]
        method, assoc = method_and_assoc(attr)

        arel_table = assoc ? Arel::Table.new(assoc.klass.table_name.to_sym) :
                       @model.arel_table

        value = q['value']
        op = q['operator']

        attr_type = attr_type(attr)

        case attr_type
        when :datetime
          update_predecate_for_datetime(arel_table[method], op, value.to_date)
        when :string, :text
          update_predecate_for_string(arel_table[method], op, value)
        when :boolean
          update_predecate_for_boolean(arel_table[method], op, value)
        when :date
          update_predecate_for_rest(arel_table[method], op, value.to_date)
        when :enum
          # HACKY! monkey patching happens here...
          update_predecate_for_enum(arel_table[method], op, value)
        else
          update_predecate_for_rest(arel_table[method], op, value)
        end
      end

      # join them by AND
      predicates[1..-1].inject(predicates.first) { |r, p| r.and(p)  }
    end
1114039
def filter_record(self, record):
        
        quality_scores = record.letter_annotations['phred_quality']

        # Simple case - window covers whole sequence
        if len(record) <= self.window_size:
            mean_score = mean(quality_scores)
            if mean_score >= self.min_mean_score:
                return record
            else:
                raise FailedFilter(mean_score)

        # Find the right clipping point. Start clipping at the beginning of the
        # sequence, then extend the window to include regions with acceptable
        # mean quality scores.
        clip_right = 0
        for i, a in enumerate(
                moving_average(quality_scores, self.window_size)):

            if a >= self.min_mean_score:
                clip_right = i + self.window_size
            else:
                break

        if clip_right:
            return record[:clip_right]
        else:
            # First window failed - record fails
            raise FailedFilter()
347455
def search(self, *args, **kwargs):
        """"""
        ret = []
        for record in Handler.ALL_VERS_DATA.values():
            matchArgs = list(kwargs.keys())
            for k,v in iteritems(kwargs): # restrict records based on key-value match requirement
                try:
                    if record[k] != v: break # a non-matching requirement means this record doesn't match
                except: break # record doesn't have required key 'k'
                matchArgs.remove(k)
            if matchArgs: continue # didn't match all required kwargs
            matchArgs = list(args)
            for k,v in iteritems(record): # find any record with a <value> in it
                if k in matchArgs: matchArgs.remove(k)
                if v in matchArgs: matchArgs.remove(v)
            if matchArgs: continue # didn't match all required args
            ret.append(record)
        return ret
339866
protected function get_list_of_favourites_from_records(array $records) {
        $list = [];
        foreach ($records as $index => $record) {
            $list[$index] = $this->get_favourite_from_record($record);
        }
        return $list;
    }
347867
def sort(records: Sequence[Record]) -> List[Record]:
    ""
    return sorted(records, key=_record_key)
273258
private function getRecordsByHandle(array $records): array
    {
        $recordsByHandle = [];
        foreach ($records as $record) {
            $modelClass = get_class($record);
            $converter = Craft::$app->controller->module->getConverter($modelClass);
            $index = $converter->getRecordIndex($record);
            $recordsByHandle[$index] = $record;
        }

        return $recordsByHandle;
    }
408804
private List<T> records(int index, List<T> records, boolean reverse){
        this.index = index;
        if(reverse)
            Collections.reverse(records);
        firstRow = records.get(0);
        lastRow = records.get(records.size()-1);
        return records;
    }
295481
def _filter_deleted_records(self, batches):
        
        for batch in batches:
            for record in batch:
                if not self.must_delete_record(record):
                    yield record
440878
def remove_record(self, record):
        
        assert self.has_record(record)

        record['_oai']['sets'] = [
            s for s in record['_oai']['sets'] if s != self.spec]
932208
function (record) {
      var recordToSend = { object: record };

      recordToSend.columnValues = this.getRecordColumnValues(record);
      recordToSend.searchKeywords = this.getRecordKeywords(record);
      recordToSend.filterValues = this.getRecordFilterValues(record);
      recordToSend.color = this.getRecordColor(record);

      return recordToSend;
    }
824387
def filter(self, record):
        
        found = self._pattern.search(record.getMessage())
        return not found
70634
def eachRecord( records = @records )
      if records and block_given?
         records.each { |record|
            if record.is_a?( REXML::Element) and record.name == "record"
               @record = record
               yield record
            end
         }
      end
      nil
   end
1200300
def filter_records(self, records):
        
        for record in records:
            try:
                filtered = self.filter_record(record)
                assert (filtered)
                # Quick tracking whether the sequence was modified
                if filtered.seq == record.seq:
                    self.passed_unchanged += 1
                else:
                    self.passed_changed += 1
                yield filtered
            except FailedFilter as e:
                self.failed += 1
                v = e.value
                if self.listener:
                    self.listener(
                        'failed_filter',
                        record,
                        filter_name=self.name,
                        value=v)
1188200
public void setRecords(java.util.Collection<Record> records) {
        if (records == null) {
            this.records = null;
            return;
        }

        this.records = new com.amazonaws.internal.SdkInternalList<Record>(records);
    }