Runs a function many times without the function call overhead
327586
function benchmark(fn, times, name){
	fn = fn.toString();
	var s = fn.indexOf('{')+1,
		e = fn.lastIndexOf('}');
	fn = fn.substring(s,e);

	return benchmarkString(fn, times, name);
}
317074
function runtime(helpers, context, templateFunction) {
  return guard(templateFunction(helpers, context, guard, iter, helper)).toString();
}
1040947
function once (fn) {
  var called = false;
  return function () {
    var args = [], len = arguments.length;
    while ( len-- ) args[ len ] = arguments[ len ];

    if (called) { return }
    called = true;
    return fn.apply(this, args)
  }
}
358344
function each(ary, func) {
        if (ary) {
            var i;
            for (i = 0; i < ary.length; i += 1) {
                if (ary[i] && func(ary[i], i, ary)) {
                    break;
                }
            }
        }
    }
510166
def times( &action )
      i = @function.variable INT, 'i'
      @function << "#{@function.indent}for ( #{i} = 0; " +
                   "#{i} != #{self}; #{i}++ ) {\n"
      @function.indent_offset +1
      action.call i
      @function.indent_offset -1
      @function << "#{@function.indent}};\n"
      self
    end
19130
function once(fn) {
  var called, value;

  if (typeof fn !== 'function') {
    throw new Error('expected a function but got ' + fn);
  }

  return function wrap() {
    if (called) {
      return value;
    }
    called = true;
    value = fn.apply(this, arguments);
    fn = undefined;
    return value;
  };
}
1186320
def runcall(self, func, *args, **kw):
        
        # XXX where is this used ? can be removed ?
        self.enable_by_count()
        try:
            return func(*args, **kw)
        finally:
            self.disable_by_count()
632377
def memoized_ignoreargs(func):
    
    def wrapper(*args, **kwargs):
        if func not in _MEMOIZED_NOARGS:
            res = func(*args, **kwargs)
            _MEMOIZED_NOARGS[func] = res
            return res
        return _MEMOIZED_NOARGS[func]
    return wrapper
176047
function repeat(input, times){
    var output = "";
    for (var i = 0; i < times; i++){
        output += input;
    }
    return output;
}
24033
def call_async(func):
    """"""

    @wraps(func)
    def wrapper(self, *args, **kw):
        """Wraps instance method to be called on loop thread"""

        def call():
            """Calls function on loop thread"""
            try:
                func(self, *args, **kw)
            except Exception:
                logger.exception(
                    "failed to call async [%r] with [%r] [%r]", func, args, kw
                )

        self.loop.call_soon_threadsafe(call)

    return wrapper
702331
def timer(logger=None, level=logging.INFO,
          fmt="function %(function_name)s execution time: %(execution_time).3f",
          *func_or_func_args, **timer_kwargs):
    
    # store Timer kwargs in local variable so the namespace isn't polluted
    # by different level args and kwargs

    def wrapped_f(f):
        @functools.wraps(f)
        def wrapped(*args, **kwargs):
            with Timer(**timer_kwargs) as t:
                out = f(*args, **kwargs)
            context = {
                'function_name': f.__name__,
                'execution_time': t.elapsed,
            }
            if logger:
                logger.log(
                    level,
                    fmt % context,
                    extra=context)
            else:
                print(fmt % context)
            return out
        return wrapped
    if (len(func_or_func_args) == 1
            and isinstance(func_or_func_args[0], collections.Callable)):
        return wrapped_f(func_or_func_args[0])
    else:
        return wrapped_f
1233718
def _callable_once(func):
    

    def once(*args, **kwargs):
        if not once.called:
            once.called = True
            return func(*args, **kwargs)

    once.called = False
    return once
725024
def function_call(self, function, arguments):
        
        #push each argument to stack
        for arg in arguments:
            self.push(self.symbol(arg))
            self.free_if_register(arg)
        self.newline_text("CALL\t"+self.symtab.get_name(function), True)
        args = self.symtab.get_attribute(function)
        #generates stack cleanup if function has arguments
        if args > 0:
            args_space = self.symtab.insert_constant("{0}".format(args * 4), SharedData.TYPES.UNSIGNED)
            self.arithmetic("+", "%15", args_space, "%15")
862328
def avoid_parallel_execution(func):
    
    def func_wrapper(*args, **kwargs):
        if not getattr(func, "currently_executing", False):
            func.currently_executing = True
            try:
                return func(*args, **kwargs)
            finally:
                func.currently_executing = False
        else:
            logger.verbose("Avoid parallel execution of function {}".format(func))
    return func_wrapper
1183100
function() {
        self.tasksCount = 0;
        var list = [], i = 0;
        for(var t in self) {
            if( typeof(self[t]) == 'function') {
                list[i] = {
                    func: self[t],
                    cb: hasCallback(self[t])
                }
                ++i
            }
        }
        run(list)
    }
969881
def repeat_call(func, retries, *args, **kwargs):
    '''
    
    '''
    retries = max(0, int(retries))
    try_num = 0
    while True:
        if try_num == retries:
            return func(*args, **kwargs)
        else:
            try:
                return func(*args, **kwargs)
            except Exception as e:
                if isinstance(e, KeyboardInterrupt):
                    raise e
                try_num += 1
130116
function( fn ){
      var pass = this._private.pass.shift();

      return this.random().pass( pass ).run( fn );
    }