Convenient function
347808
function loadExternalFile(url, data, callback, errorCallback) {
    // Set up an asynchronous request
    const request = new XMLHttpRequest();
    request.open('GET', url, true);

    // Hook the event that gets called as the request progresses
    request.onreadystatechange = () => {
        // If the request is "DONE" (completed or failed)
        if (request.readyState == 4) {
            // If we got HTTP status 200 (OK)
            if (request.status == 200) {
                callback(request.responseText, data)
            } else { // Failed
                errorCallback(url);
            }
        }
    };

    request.send(null);    
}
948710
function traverser(element, content, next) {
    return function () {
      return minimize.traverse(element.children, content, sync, step(element, 'close', next))
    };
  }
796929
def open(self, pchPath, mode, unElementSize, unElements):
        """"""

        fn = self.function_table.open
        pulBuffer = IOBufferHandle_t()
        result = fn(pchPath, mode, unElementSize, unElements, byref(pulBuffer))
        return result, pulBuffer
1140335
function toSource$1(func) {
  if (func != null) {
    try {
      return funcToString$1.call(func);
    } catch (e) {}
    try {
      return func + '';
    } catch (e) {}
  }
  return '';
}
386929
function (f, cont) {
    var result = f();
    if (result && typeof result.always === 'function') {
      result.always(cont);
    } else {
      cont();
    }
  }
914234
def _functionFabric(func_name, argList, oargList, password):
    """"""

    def functionHandler(self, *args, **kwargs):
        call_args = {}

        for (key, value) in oargList.items():
            call_args[key] = value

        for i, arg in enumerate(argList):
            if i < len(args):
                call_args[arg] = args[i]

        for (key, value) in kwargs.items():
            call_args[key] = value

        return _callFunc(self, func_name, password, call_args)

    functionHandler.__name__ = str(func_name)
    return functionHandler
912597
def do_alternate(self, args):
        """"""
        func = getattr(args, 'func', None)
        if func is not None:
            # Call whatever sub-command function was selected
            func(self, args)
        else:
            # No sub-command was provided, so call help
            self.do_help('alternate')
1364942
function operate(l, r, sign, f) {
    switch (sign) {
        case '+': return (l + r) / f
        case '-': return (l - r) / f
        case '*': return (l * r) / (f * f)
        case '/': return (l / r)
    }
}
703262
function (i) {
      return function (e) {
        if (this.props.disabled) return;
        var position = this._getMousePosition(e);
        this._start(i, position[0]);
        this._addHandlers(this._getMouseEventMap());
        pauseEvent(e);
      }.bind(this);
    }
204741
def _function(self, type, name, args=""):
        
        return FunctionManager(self, type=type, name=name, args=args)
1356608
function(keysFunc, undefinedOnly) {
    return function(obj) {
      var length = arguments.length;
      if (length < 2 || obj === null) return obj;
      for (var index = 1; index < length; index++) {
        var source = arguments[index];
        var keys = keysFunc(source);
        var l = keys.length;

        for (var i = 0; i < l; i++) {
          var key = keys[i];
          if (!undefinedOnly || obj[key] === void 0) obj[key] = source[key];
        }
      }

      return obj;
    };
  }
1352236
function mod(a, b) {
    return function(e, k) {
      var action = !(e.shiftKey || e.ctrlKey || e.altKey || e.metaKey) ? a : b;
      return resolve(action, e, k);
    };
  }
58975
def tap(f):
    
    @wraps(f)
    def _cb(res, *a, **kw):
        d = maybeDeferred(f, res, *a, **kw)
        d.addCallback(lambda ignored: res)
        return d
    return _cb
735465
public void addFunction(IFunction function) {
        if ((function != null) && (!functions.contains(function))) {
            functions.add(function);
            colors.add(Color.black);
        }
    }
94113
function inspect(x) {
  if(x && isFunction(x.inspect)) {
    return ` ${x.inspect()}`
  }

  if(isFunction(x)) {
    return ' Function'
  }

  if(isArray(x)) {
    return ` [${arrayInspect(x) } ]`
  }

  if(isObject(x)) {
    return ` { ${Object.keys(x).reduce((acc, key) => {
      return acc.concat([ `${key}:${inspect(x[key])}` ])
    }, []).join(', ')} }`
  }

  if(isString(x)) {
    return ` "${x}"`
  }

  if(isSymbol(x) || isDate(x)) {
    return ` ${x.toString()}`
  }

  return ` ${x}`
}
1217329
function (f, direction) {

        if (typeof (f) !== 'function') {
            var prop = f;
            // make unary function
            f = function (v1) {

                return v1[prop];
            };
        }
        if (f.length === 1) {
            // f is a unary function mapping a single item to its sort score
            var uf = f;
            f = function (v1, v2) {

                return uf(v1) < uf(v2) ? -1 : uf(v1) > uf(v2) ? 1 : 0;
            };
        }
        if (direction === -1) {
            return function (v1, v2) {

                return -f(v1, v2);
            };
        }
        return f;
    }
865450
function use(attach) {
    var self = this
    var params = slice.call(arguments, 1)
    var index
    var length
    var fn

    /* Multiple attachers. */
    if ('length' in attach && typeof attach !== 'function') {
      index = -1
      length = attach.length

      /* So, `attach[0]` is a function, meaning its
       * either a list of `attachers` or its a `list`. */
      if (typeof attach[0] === 'function') {
        if (
          attach[1] !== null &&
          attach[1] !== undefined &&
          typeof attach[1] !== 'function'
        ) {
          self.use.apply(self, attach)
        } else {
          while (++index < length) {
            self.use.apply(self, [attach[index]].concat(params))
          }
        }
      } else {
        while (++index < length) {
          self.use(attach[index])
        }
      }

      return self
    }

    /* Single attacher. */
    fn = attach.apply(null, [self.context || self].concat(params))

    /* Store the attacher to not break `new Ware(otherWare)`
     * functionality. */
    if (!self.attachers) {
      self.attachers = []
    }

    self.attachers.push(attach)

    /* Pass `fn` to the original `Ware#use()`. */
    if (fn) {
      useFn.call(self, fn)
    }

    return self
  }