parallel version of array.filter()
480966
function( fn ){
      var _p = this._private;
      var pass = _p.pass[0];

      return this.map( fn ).then(function( include ){
        var ret = [];

        for( var i = 0; i < pass.length; i++ ){
          var datum = pass[i];
          var incDatum = include[i];

          if( incDatum ){
            ret.push( datum );
          }
        }

        return ret;
      });
    }
820407
function filterBy (arr, search) {
  var arr = util.convertArray(arr)
  if (search == null) {
    return arr
  }
  if (typeof search === 'function') {
    return arr.filter(search)
  }
  // cast to lowercase string
  search = ('' + search).toLowerCase()
  var n = 2
  // extract and flatten keys
  var keys = Array.prototype.concat.apply([], util.toArray(arguments, n))
  var res = []
  var item, key, val, j
  for (var i = 0, l = arr.length; i < l; i++) {
    item = arr[i]
    val = (item && item.$value) || item
    j = keys.length
    if (j) {
      while (j--) {
        key = keys[j]
        if ((key === '$key' && contains(item.$key, search)) ||
            contains(util.getPath(val, key), search)) {
          res.push(item)
          break
        }
      }
    } else if (contains(item, search)) {
      res.push(item)
    }
  }
  return res
}
690044
function first (array, filter) {
  var i = 0;
  var length = array.length;
  var item;
  for (; i < length; i ++) {
    item = array[i];
    if (filter(item)) {
      return item;
    }
  }

  return null;
}
1298848
function parallel(list) {
  return new exports.Promise((resolve, reject) => {
    const result = [];
    let finishCount = 0;
    list.forEach((p, i) => {
      p.then(ret => {
        result[i] = ret;
        finishCount += 1;
        if (finishCount >= list.length) {
          resolve(result);
        }
      }).catch(err => {
        return reject(err);
      });
    });
  });
}
99187
function parallel (fns, next) {
  var len = fns.length;
  var values = [];
  var skip = false;
  function done(i, e, v) {
    values[i] = v;
    len--;
    if (!skip && (e || !len)) {
      skip = true;
      next(e, e ? null : values);
    }
  }
  fns.forEach(function (fn, i) {
    fn(function(e, v){done(i, e, v);});
  });
}
105792
@Override
    public ListT<W,T> filter(final Predicate<? super T> test) {
        return of(run.map(seq -> seq.filter(test)));
    }
751712
function(array, pred) {
      return _.filter(_.map(_.range(_.size(array)), function(i) {
        return pred(i, array[i]);
      }),
      existy);
    }
232980
public static <T> List<T> filter(final Iterable<T> unfiltered, final Predicate<T> filter) {
        return newArrayList(Iterables.filter(unfiltered, filter));
    }
1252061
function (filterArray) {
    return function (input) {
      return filterArray.reduce(function (previousValue, filter) {
        return filter.call(this, previousValue);
      }.bind(this), input);
    };
  }
1276496
function flattenArray(array, filter, map, result) {
  let index = -1;
  while (++index < array.length) {
    const value = array[index];
    if (Array.isArray(value)) {
      flattenArray(value, filter, map, result);
    } else if (filter(value)) {
      result.push(map(value));
    }
  }
  return result;
}
1040100
function parallel(tasks, params, last) {
    var onEnd = (typeof params === 'function') ? params : params.done || last,
        running = [],
        results = [],
        d = 0,
        t,
        l,
        i;

    if (typeof onEnd !== 'function')
      onEnd = noop;

    function cleanup() {
      running.forEach(function(r) {
        clearTimeout(r);
      });
    }

    function onTaskEnd(err, result) {
      // Adding results to accumulator
      results.push(result);

      if (err) {
        cleanup();
        return onEnd(err, results);
      }

      if (++d >= tasks.length) {

        // Parallel action is finished, returning
        return onEnd(null, results);
      }

      // Adding on stack
      t = tasks[i++];
      running.push(async(t, onTaskEnd));
    }

    for (i = 0, l = params.limit || tasks.length; i < l; i++) {
      t = tasks[i];

      // Dispatching the function asynchronously
      running.push(async(t, onTaskEnd));
    }
  }
669405
function find(arr, search) 
{
  var array = filterBy.apply(this, arguments);
  array.splice(1);
  return array;
}
714016
function(arr,filterFunc) {
	
	if (arr.filter) { return arr.filter(filterFunc); }
	
	var i = 0,
		l = 0,
		r = [];
	
	for (i = 0, l = arr.length; i < l; i++) {
		if (filterFunc(arr[i])) {
			r.push(arr[i]);
		}
	}
	
	return r;
}
622066
public Iterable<T> filter(final Iterable<T> iterable) {
        return new Iterable<T>() {

            @Override
            public Iterator<T> iterator() {
                return filter(iterable.iterator());
            }
        };
    }
220829
private static int _fillArrayName(Array arr, Resource directory, ResourceFilter filter, int count) {
	if (filter == null || filter instanceof ResourceNameFilter) {
	    ResourceNameFilter rnf = filter == null ? null : (ResourceNameFilter) filter;
	    String[] list = directory.list();
	    if (list == null || list.length == 0) return count;
	    for (int i = 0; i < list.length; i++) {
		if (rnf == null || rnf.accept(directory, list[i])) {
		    arr.appendEL(list[i]);
		}
	    }
	}
	else {
	    Resource[] list = directory.listResources();
	    if (list == null || list.length == 0) return count;
	    for (int i = 0; i < list.length; i++) {
		if (filter.accept(list[i])) {
		    arr.appendEL(list[i].getName());
		}
	    }
	}

	return count;
    }
284926
def mb_filter(fastq, cores):
    ''' 
    '''
    filter_mb = partial(umi_filter)
    p = multiprocessing.Pool(cores)

    chunks = tz.partition_all(10000, read_fastq(fastq))
    bigchunks = tz.partition_all(cores, chunks)
    for bigchunk in bigchunks:
        for chunk in p.map(filter_mb, list(bigchunk)):
            for read in chunk:
                sys.stdout.write(read)
657897
function filter(input) {
    var array = [];
    _.forEach(input, function(item) {
      if (_.isPlainObject(item)) {
        var space = parseInt(config.json.space) || config.json.space;
        array.push(timestamp(config.newline + JSON.stringify(item, null, space) + config.newline));
      } else {
        if (_.isArray(item)) {
          array.push(timestamp(stringify(item)));
        } else {
          array.push(timestamp(item.toString()));
        }
      }
    });
    return array;
  }