13 Function Definition
500363
function parseFunctionSourceElements() {
        var sourceElement, sourceElements = [], token, directive, firstRestricted, oldLabelSet, oldInIteration, oldInSwitch, oldInFunctionBody;

        expect('{');

        while (index < length) {
            token = lookahead();
            if (token.type !== Token.StringLiteral) {
                break;
            }

            sourceElement = parseSourceElement();
            sourceElements.push(sourceElement);
            if (sourceElement.expression.type !== Syntax.Literal) {
                // this is not directive
                break;
            }
            directive = sliceSource(token.range[0] + 1, token.range[1] - 1);
            if (directive === 'use strict') {
                strict = true;
                if (firstRestricted) {
                    throwError(firstRestricted, Messages.StrictOctalLiteral);
                }
            } else {
                if (!firstRestricted && token.octal) {
                    firstRestricted = token;
                }
            }
        }

        oldLabelSet = labelSet;
        oldInIteration = inIteration;
        oldInSwitch = inSwitch;
        oldInFunctionBody = inFunctionBody;

        labelSet = {};
        inIteration = false;
        inSwitch = false;
        inFunctionBody = true;

        while (index < length) {
            if (match('}')) {
                break;
            }
            sourceElement = parseSourceElement();
            if (typeof sourceElement === 'undefined') {
                break;
            }
            sourceElements.push(sourceElement);
        }

        expect('}');

        labelSet = oldLabelSet;
        inIteration = oldInIteration;
        inSwitch = oldInSwitch;
        inFunctionBody = oldInFunctionBody;

        return {
            type: Syntax.BlockStatement,
            body: wrapBlock(sourceElements)
        };
    }
791323
def p_function_declaration(self, p):
        
        if len(p) == 8:
            p[0] = ast.FuncDecl(
                identifier=p[2], parameters=None, elements=p[6])
        else:
            p[0] = ast.FuncDecl(
                identifier=p[2], parameters=p[4], elements=p[7])
1072894
function(f,c){
  var fn=f;
  var cn=c;
  return function(){
    fn.apply(cn,Array.prototype.slice.call(arguments));
  };
}
397015
function nOrMore ( n, p ) {
				return function () {
					var originalPos = pos,
						result = [],
						parsed = p();

					while ( parsed !== null ) {
						result.push( parsed );
						parsed = p();
					}

					if ( result.length < n ) {
						pos = originalPos;

						return null;
					}

					return result;
				};
			}
676796
function partial1 (f, x) {
    return function partiallyApplied1 () {
      // Using slice or splice on `arguments` causes the function to be
      // unoptimizable. Who doesn't like optimization?
      var args = map(identity, arguments);

      args.unshift(x);
      return f.apply(null, args);
    };
  }
1093541
def p_function_expr_1(self, p):
        
        if len(p) == 7:
            p[0] = ast.FuncExpr(
                identifier=None, parameters=None, elements=p[5])
        else:
            p[0] = ast.FuncExpr(
                identifier=None, parameters=p[3], elements=p[6])
1248098
@Pure
	public static <P1, P2, P3, RESULT> Function2<P2, P3, RESULT> curry(final Function3<? super P1, ? super P2, ? super P3, ? extends RESULT> function,
			final P1 argument) {
		if (function == null)
			throw new NullPointerException("function");
		return new Function2<P2, P3, RESULT>() {
			@Override
			public RESULT apply(P2 p2, P3 p3) {
				return function.apply(argument, p2, p3);
			}
		};
	}
100049
public function getEan13() : ?string 
    {
        if ( ! $this->hasEan13()) {
            $this->setEan13($this->getDefaultEan13());
        }
        return $this->ean13;
    }
984335
function functionParameters(f) {
  assert(typeof f === 'function');
  var matches = functionRegex.exec(f.toString());
  if(!matches || !matches[2].length) {
    return [];
  }
  return matches[2].split(/[,\s]+/).filter(function(str) {
    return str.length;
  });
}
948044
public final <R> R map(Function<? super T1, ? extends R> function) {
        return function.apply(v1);
    }
1294967
def transform_32_33(inst, new_inst, i, n, offset,
                    instructions, new_asm):
    
    add_size = xdis.op_size(new_inst.opcode, opcode_33)
    if inst.opname in ('MAKE_FUNCTION','MAKE_CLOSURE'):
        # Previous instruction should be a load const which
        # contains the name of the function to call
        prev_inst = instructions[i-1]
        assert prev_inst.opname == 'LOAD_CONST'
        assert isinstance(prev_inst.arg, int)

        # Add the function name as an additional LOAD_CONST
        load_fn_const = Instruction()
        load_fn_const.opname = 'LOAD_CONST'
        load_fn_const.opcode = opcode_33.opmap['LOAD_CONST']
        load_fn_const.line_no = None
        prev_const = new_asm.code.co_consts[prev_inst.arg]
        if hasattr(prev_const, 'co_name'):
            fn_name = new_asm.code.co_consts[prev_inst.arg].co_name
        else:
            fn_name = 'what-is-up'
        const_index = len(new_asm.code.co_consts)
        new_asm.code.co_consts = list(new_asm.code.co_consts)
        new_asm.code.co_consts.append(fn_name)
        load_fn_const.arg = const_index
        load_fn_const.offset = offset
        load_fn_const.starts_line = False
        load_fn_const.is_jump_target = False
        new_asm.code.instructions.append(load_fn_const)
        load_const_size = xdis.op_size(load_fn_const.opcode, opcode_33)
        add_size += load_const_size
        new_inst.offset = offset + add_size
        pass
    return add_size
1256666
def rec_apply(func, n):
    
    if n > 1:
        rec_func = rec_apply(func, n - 1)
        return lambda x: func(rec_func(x))
    return func
392674
function exampleBookFunction(element, uniqueId) {
          expect(element).not.toBeUndefined();
          expect(element.length).toBe(1);
          expect($('.inline-edit-btn-' + uniqueId).length).toBe(2); // two because there are two buttons per section
          expect($('.inline-edit-btn-' + uniqueId + '-fa-book').length).toBe(1);
          buttonSetupRunCount += 1;
        }
993937
def function(self, rule, args, **kwargs):
        
        fname = rule.function
        try:
            return self.functions[fname](args)
        except KeyError:
            raise FilteringRuleException("Invalid function name '{}'".format(fname))
707838
def p_function_header_pre(p):
    
    if p[1] is None or p[2] is None:
        p[0] = None
        return

    forwarded = p[1].entry.forwarded

    p[0] = p[1]
    p[0].appendChild(p[2])
    p[0].params_size = p[2].size
    lineno = p.lineno(3)

    previoustype_ = p[0].type_
    if not p[3].implicit or p[0].entry.type_ is None or p[0].entry.type_ == TYPE.unknown:
        p[0].type_ = p[3]
        if p[3].implicit and p[0].entry.kind == KIND.function:
            api.errmsg.warning_implicit_type(p[3].lineno, p[0].entry.name, p[0].type_)

    if forwarded and previoustype_ != p[0].type_:
        api.errmsg.syntax_error_func_type_mismatch(lineno, p[0].entry)
        p[0] = None
        return

    if forwarded:  # Was predeclared, check parameters match
        p1 = p[0].entry.params  # Param list previously declared
        p2 = p[2].children

        if len(p1) != len(p2):
            api.errmsg.syntax_error_parameter_mismatch(lineno, p[0].entry)
            p[0] = None
            return

        for a, b in zip(p1, p2):
            if a.name != b.name:
                warning(lineno, "Parameter '%s' in function '%s' has been renamed to '%s'" %
                        (a.name, p[0].name, b.name))

            if a.type_ != b.type_ or a.byref != b.byref:
                api.errmsg.syntax_error_parameter_mismatch(lineno, p[0].entry)
                p[0] = None
                return

    p[0].entry.params = p[2]

    if FUNCTION_LEVEL[-1].kind == KIND.sub and not p[3].implicit:
        syntax_error(lineno, 'SUBs cannot have a return type definition')
        p[0] = None
        return

    if FUNCTION_LEVEL[-1].kind == KIND.function:
        api.check.check_type_is_explicit(p[0].lineno, p[0].entry.name, p[3])

    if p[0].entry.convention == CONVENTION.fastcall and len(p[2]) > 1:
        kind = 'SUB' if FUNCTION_LEVEL[-1].kind == KIND.sub else 'FUNCTION'
        warning(lineno, "%s '%s' declared as FASTCALL with %i parameters" % (kind, p[0].entry.name,
                                                                             len(p[2])))
164643
function () {
            var f = {};

            f.valueOf = function () {
                return +n;
            };

            f.text = String(goodFrac(n) || n);

            return f;
        }
711662
function memoizeFunction(fn) {
  var memo = {}, counter = 0;

  return function(key) {
    if (hasOwn(memo, key)) {
      return memo[key];
    }
    // istanbul ignore if
    if (counter === INTERNAL_MEMOIZE_LIMIT) {
      memo = {};
      counter = 0;
    }
    counter++;
    return memo[key] = fn(key);
  };
}