Return filtered list for passing functions
@param   {Number}    first
@param   {Number}    last
@return  {Array}
550184
function passChains (first, last, sequence) {
    return sequence.map(function (el) {
      return el._id;
    }).slice(first, last + 1);
  }
331990
def get_first_defined(data, keys, default_value=None):
    
    for key in keys:
        if key in data:
            return data[key]
    return default_value
781864
def _filtered_list(self, selector):
        
        res = []
        for elem in self.obj:
            self._append(elem, selector, res)
        return res
678736
def first_where(pred, iterable, default=None):
    
    return next(six.moves.filter(pred, iterable), default)
1371354
def previous_page(params = {}, opts = {})
      first_id = data.first.id

      params = filters.merge(ending_before: first_id).merge(params)

      list(params, opts)
    end
1255251
def filter(self, func):
        """"""  # noqa: E501
        return self.__class__([x for x in self.res if func(x)],
                              name="filtered %s" % self.listname)
950759
function filter(fp, opts) {
  if (opts && opts.filter) {
    return opts.filter(fp, opts);
  }
  return /[^x]\.js$/.test(fp);
}
1296237
function flatFilter(filterString) {

    var filter_list = [];

    if (typeof filterString == 'string') {
        filter_list = matches$1(filterString);
    } else if (Array.isArray(filterString)) {
        filter_list = filterString;
    }

    var allFilter = [];

    filter_list.forEach(function (filterObj) {
        var filterName = filterObj.arr[0];

        if (GLFilter[filterName]) {
            var f = makeFilterFunction(filterObj);

            if (f.type == 'convolution' || f.type == 'shader') {
                allFilter.push(f);
            } else {
                f.forEach(function (subFilter) {
                    allFilter = allFilter.concat(flatFilter(subFilter));
                });
            }
        }
    });

    // console.log(filter_list, allFilter)

    return allFilter;
}
978689
function getFirstHeader (req, header) {
  const value = req.headers[header]
  return (Array.isArray(value) ? value[0] : value).split(', ')[0]
}
662777
def filter(self, func):
        """"""
        return self.__class__( [ i for i in self.res if func(*i) ], name='filtered %s'%self.listname)
1252061
function (filterArray) {
    return function (input) {
      return filterArray.reduce(function (previousValue, filter) {
        return filter.call(this, previousValue);
      }.bind(this), input);
    };
  }
662534
def before_first_request(self, fn):
        
        self._defer(lambda app: app.before_first_request(fn))
        return fn
861088
def filter(self, func):
        
        return TList([v for k, v in self.items() if func(k, v)])
1273376
function filter(pred) {
  return function(xs) {
    var output = [];
    for (var idx = 0; idx < xs.length; idx += 1) {
      if (pred (xs[idx])) {
        output.push (xs[idx]);
      }
    }
    return output;
  };
}
1282829
function createFunctions() {
  const result = [];
  for (let i = 0; i < count; i++) {
    result.push(number => Promise.resolve(number + 1));
  }
  return result;
}
888366
function combineFilterFirstValues(options) {
	return function(inSet, gt) {
		var values = inSet.values.filter(function(value) {
			return options.values.test(value, gt.value);
		});
		var range = options.with ? new options.with(gt.value) : gt;
		return values.length ?
			options.combinedUsing([new options.arePut(values), range]) : range;
	};
}
871991
def functions(self):
        
        p = lambda o: isinstance(o, Function) and self._docfilter(o)
        return sorted(filter(p, self.doc.values()))