run pre functions in sequence (obj, obj, fn) -> null
778862
function runPre (arr, argv, cb) {
  const nw = arr.map(function (el) {
    return el.bind(null, argv)
  })
  series(nw, cb)
}
1066430
function (obj, pred) {
      var t = {};
      var f = {};
      each(obj, function(x, i) {
        var branch = pred(x, i) ? t : f;
        branch[i] = x;
      });
      return {
        t: t,
        f: f
      };
    }
275114
function each(seq, pred, ctx) {
        return sequencep(seq)?  __each.call(seq, pred, ctx)
             : /* non-seq */    undefined
    }
114355
function runSync (fn, repeatTest = 0, args = []) {
    return (resolve, reject) =>
        Fiber(() => executeSync.call(this, fn, repeatTest, args).then(() => resolve(), reject)).run()
}
59375
protected void checkType(Object object) {
        if (object == null) {
            throw new NullPointerException("Sequences cannot contain null, use a List instead");
        }
        if (type != null) {
            if (!type.isInstance(object)) {
                throw new IllegalArgumentException(
                        "Invalid type of argument for sequence of type: "
                                + type.getName()
                                + " cannot add object: "
                                + object);
            }
        }
    }
12132
function each (obj, func) {
    if (obj.forEach) {
        obj.forEach(func);
    } else {
        var p;
        for (p in obj) {
            if (obj.hasOwnProperty(p)) {
                func.call(obj, obj[p], p, obj);
            }
        }
    }
}
1073112
function Runnable(title, fn) {
  this.title = title;
  this.fn = fn;
  this.body = (fn || '').toString();
  this.async = fn && fn.length;
  this.sync = !this.async;
  this._timeout = 2000;
  this._slow = 75;
  this._enableTimeouts = true;
  this.timedOut = false;
  this._retries = -1;
  this._currentRetry = 0;
  this.pending = false;
}
973119
def before_object(eng, objects, obj):
        """"""
        super(InvenioProcessingFactory, InvenioProcessingFactory)\
            .before_object(
            eng, objects, obj
        )
        if "_error_msg" in obj.extra_data:
            del obj.extra_data["_error_msg"]
        db.session.commit()
1131907
def run(self, tokens):
        """"""
        for fn in self._stack:
            results = []
            for i, token in enumerate(tokens):
                # JS ignores additional arguments to the functions but we
                # force pipeline functions to declare (token, i, tokens)
                # or *args
                result = fn(token, i, tokens)
                if not result:
                    continue
                if isinstance(result, (list, tuple)):  # simulate Array.concat
                    results.extend(result)
                else:
                    results.append(result)
            tokens = results

        return tokens
519564
function nextup(inst, orig, argv, event, cb) {
    return function nextupCallback(err, data) {
        if (err) return cb(err, null);
        if (_isQuoted(data)) return cb(null, _unquote(data));
        if (_isValue(data)) return cb(null, _entityToValue(data, inst.library));
        // Remove any nulls or undefineds from the list
        var compact = _compactList(data);
        // Allow the programmer to opt out for _minor_ perf gains
        if (inst.options.doIrreducibleListCheck) {
            // If no change, we'll keep looping forever, so just return
            if (IsEqual(orig, compact)) {
                Console.printWarning(inst, 'Detected irreducible list; exiting...');
                return cb(null, compact);
            }
        }
        return exec(inst, compact, argv, event, cb);
    };
}
451334
function objectEach(obj, fn, thisObj) {
  var keys = Object.keys(obj).sort(function (a,b) {
    a = a.toLowerCase()
    b = b.toLowerCase()
    return a === b ? 0 : a < b ? -1 : 1
  })
  for (var i = 0, l = keys.length; i < l; i++) {
    var key = keys[i]
    fn.call(thisObj, obj[key], key, obj)
  }
}
471221
def run(self):
        """"""
        resp = _wait_until(obj=self.obj, att=self.att,
                desired=self.desired, callback=None,
                interval=self.interval, attempts=self.attempts,
                verbose=False, verbose_atts=None)
        self.callback(resp)
621180
function genScheduler (initQueueSize, fn) {
        /**
         * All async promise will be scheduled in
         * here, so that they can be execute on the next tick.
         * @private
         */
        var fnQueue = Arr(initQueueSize)
            , fnQueueLen = 0;

        /**
         * Run all queued functions.
         * @private
         */
        function flush () {
            var i = 0;
            while (i < fnQueueLen) {
                fn(fnQueue[i], fnQueue[i + 1]);
                fnQueue[i++] = $undefined;
                fnQueue[i++] = $undefined;
            }

            fnQueueLen = 0;
            if (fnQueue.length > initQueueSize) fnQueue.length = initQueueSize;
        }

        return function (v, arg) {
            fnQueue[fnQueueLen++] = v;
            fnQueue[fnQueueLen++] = arg;

            if (fnQueueLen === 2) nextTick(flush);
        };
    }
680280
function(leafA, nextA, leafB, nextB)
{
    this.prevA = null;
    this.leafA = leafA;
    this.nextA = nextA;

    this.prevB = null;
    this.leafB = leafB;
    this.nextB = nextB;
}
1162683
function(obj) {
    var self = this
    if (obj.runMainInFiber) { // default is false
      console.warn('"runMainInFiber" is DEPRECATED. Please wrap all applications in "__" instead.')
      __(function() {
        self._invokeMain(obj)
      })
    } else {
      self._invokeMain(obj)
    }
  }
927625
function (initFunction) {
        if (_.isFunction(initFunction)) {
            Logger.info("Run init function");
            _customInitFuncton = initFunction;
            return initFunction(appHttp)
                .then(function () {
                    return initFunction(appHttps);
                });
        }
        return Q();
    }
834144
def fsplit(pred, objs):
    """"""
    t = []
    f = []
    for obj in objs:
        if pred(obj):
            t.append(obj)
        else:
            f.append(obj)
    return (t, f)