function definitions
488034
function insidePoint(element, x, y) {
        let offset = element.offset();
        if (x < offset.left || offset.left + element.outerWidth(true) < x)
          return false;
        if (y < offset.top || offset.top + element.outerHeight(true) < y)
          return false;
        return true;
      }
33202
function(/*, funs */){
      var funs = (_.isArray(arguments[0])) ? arguments[0] : arguments;

      return function(seed) {
        return _.reduce(funs,
                        function(l,r) { return r(l); },
                        seed);
      };
    }
1065295
function functionWrapperFunction () {
        // call original function - catching errors for logging
        try {
            var res = functionObj.apply(this, arguments)
        }
        catch (error) {
            var err = error
        }
        // if log client then do logging
        if (options.logClient) {
            // get number of arguments
            var argsLength = arguments.length
            // copy of arguments
            var args = []
            // create copy of arguments
            for (var i=0; i < argsLength; i++) {
                args[i] = arguments[i]
            }
            // log call
            options.logClient.log('functionCall', {
                functionName: functionName,
                args: args,
                res: err || res,
                isError: (err ? true : false),
                moduleCallId: (this ? this.moduleCallId : undefined),
                requestId: (this ? this.requestId : undefined),
            })
        }
        // if result was an error then throw original error
        if (err) {
            throw err
        }
        // otherwise return original result
        else {
            return res
        }
    }
1078180
function functionEntry (name) {
      const fn = functions[name]
      let syntax = SYNTAX[name] || (fn.doc && fn.doc.syntax && fn.doc.syntax[0]) || name
      syntax = syntax
        // .replace(/^math\./, '')
        .replace(/\s+\/\/.*$/, '')
        .replace(/;$/, '')
      if (syntax.length < 40) {
        syntax = syntax.replace(/ /g, '&nbsp;')
      }

      let description = ''
      if (fn.doc.description) {
        description = fn.doc.description.replace(/\n/g, ' ').split('.')[0] + '.'
      }

      return '[' + syntax + '](functions/' + name + '.md) | ' + description
    }
868474
function arity (n, fn) {
  switch (n) {
    case 0: return function () { return fn.apply(null, arguments) }
    case 1: return function (a0) { return fn.apply(null, arguments) }
    case 2: return function (a0, a1) { return fn.apply(null, arguments) }
    case 3: return function (a0, a1, a2) { return fn.apply(null, arguments) }
    case 4: return function (a0, a1, a2, a3) { return fn.apply(null, arguments) }
    case 5: return function (a0, a1, a2, a3, a4) { return fn.apply(null, arguments) }
    case 6: return function (a0, a1, a2, a3, a4, a5) { return fn.apply(null, arguments) }
    case 7: return function (a0, a1, a2, a3, a4, a5, a6) { return fn.apply(null, arguments) }
    case 8: return function (a0, a1, a2, a3, a4, a5, a6, a7) { return fn.apply(null, arguments) }
    default: throw new Error('First argument to _arity must be a non-negative integer no greater than eight')
  }
}
601051
def function(self, func_name):
        
        if self.functions.has_key(func_name):
            return self.functions[func_name]
        else:
            raise RpcException(ERR_METHOD_NOT_FOUND, 
                               "%s: Unknown function: '%s'", self.name, func_name)
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;
    }
195406
function functions(node) {
  if (!Node.Type.isFunction(node)) {
    return Node.Status.noChange(node);
  }

  for (let i = 0; i < FUNCTIONS.length; i++) {
    const nodeStatus = FUNCTIONS[i](node);
    if (nodeStatus.hasChanged()) {
      return nodeStatus;
    }
  }
  return Node.Status.noChange(node);
}
1003472
def functions(self):
        
        names = []

        for i, k in enumerate(self.obj):
            if _(self.obj[k]).isCallable():
                names.append(k)

        return self._wrap(sorted(names))
1125500
def func(nargs: Optional[int] = None, nouts: Optional[int] = None, ndefs: Optional[int] = None):
    
    return lambda f: wraps(f)(WrappedFunction(f, nargs=nargs, nouts=nouts, ndefs=ndefs))
1013685
public void setFunction(FunctionLibFunction function) {
	function.setFunctionLib(this);
	functions.put(function.getName(), function);
    }
362369
function (f) {
      // equivalent to arguments.slice(1)
      // starting at 1 because 0 is the f, makes things tricky.
      // Pay attention to what variable is where, and the -1 magic.
      // thankfully, we have tests for this.
      var args = new Array(arguments.length - 1);
      for (var i = 1; i < arguments.length; i++) args[i-1] = arguments[i];

      return function () {
        var newArgs = new Array(arguments.length);
        for (var j = 0; j < newArgs.length; j++) newArgs[j] = arguments[j];

        var all = args.concat(newArgs);
        return f.apply(null, all);
      };
    }
808778
function func(ast) {
  var params = list(ast["params"])
  var id = ast["id"] ? to_s(ast["id"]) : ""
  return "function " + id + "(" + params + ") " + to_s(ast["body"])
}
863773
def function_arguments(func):
    
    if getattr(inspect, 'signature', None) is None:
        return list(inspect.getargspec(func).args)
    else:
        return list(inspect.signature(func).parameters.keys())
794332
def _(f, x):
    
    result = {}
    for k, v in x.items():
        k_, v_ = f(k, v)
        result[k_] = v_
    return result
455157
def func(self):
        
        self.eat(TokenTypes.FUNC)
        name = Var(self.cur_token)
        self.eat(TokenTypes.VAR)
        self.eat(TokenTypes.LPAREN)
        sig = self.param_list()
        self.eat(TokenTypes.RPAREN)
        block = self.block()
        return FunctionDef(name, Function(sig, block))
190615
function(/* funs */) {
      var funs = arguments;

      return function(/* args */) {
        var args = arguments;
        return _.map(funs, function(f) {
          return f.apply(this, args);
        }, this);
      };
    }