The wrapped function.

@api private
338302
function bro() {
    var self = this;

    //
    // Time has passed since we've generated this function so we're going to
    // assume that this function is already executed async.
    //
    if (+(new Date()) > start) {
      return fn.apply(self, arguments);
    }

    for (var i = 0, l = arguments.length, args = new Array(l); i < l; i++) {
      args[i] = arguments[i];
    }

    (global.setImmediate || global.setTimeout)(function delay() {
      fn.apply(self, args);
      self = args = null;
    }, 0);
  }
463913
function wrap(func) {
        if (typeof func !== 'function') {
            throw new Error('function argument is expected');
        }

        if (func.tasync_wraped === undefined) {
            func.tasync_wraped = function () {
                var args = arguments;
                var future = new Future();

                args[args.length++] = function (error, value) {
                    if (error) {
                        future.reject(error instanceof Error ? error : new Error(error));
                    } else {
                        future.resolve(value);
                    }
                };

                func.apply(this, args);

                if (future.state === STATE_LISTEN) {
                    return future;
                } else if (future.state === STATE_RESOLVED) {
                    return future.value;
                } else {
                    assert(future.state === STATE_REJECTED);
                    throw future.value;
                }
            };

            func.tasync_wraped.tasync_unwraped = func;
        }

        return func.tasync_wraped;
    }
735759
function () {
	var len, attr, g, args;

	args = arguments;

	len = args.length;

	if (len === 0) {
		g = noop;
	}
	else if (len === 1) {
		attr = args[0];

		g = function (obj) {
			return obj[attr];
		};
	}
	else {
		g = function (obj) {
			var i, tuple;

			tuple = [];

			for (i = 0; i < len; ++i) {
				tuple.push(obj[args[i]]);
			}

			return tuple;
		};
	}



	return g;
}
1065172
function caller() {
  const returnedArgs = Array.prototype.slice.call(arguments)
  const fn = returnedArgs.shift()
  const self = this

  return wrapPromise(function (resolve, reject) {
    returnedArgs.push(function (err, args) {
      if (err) {
        reject(err)
        return
      }

      resolve(args)
    })

    fn.apply(self, returnedArgs)
  })
}
763093
function serialized(func) {
  var currentPromise = null;
  var wrapped = function() {
    var self = this;
    var args = arguments;
    if (currentPromise) {
      return currentPromise.fin(function() {
        return wrapped.apply(self, args);
      });
    }

    currentPromise = func.apply(self, args);
    
    currentPromise
    .fin(function() {
      currentPromise = null;
    })
    .eat();
    
    return currentPromise;
  };
  return wrapped;
}
702125
function wrapify(fn, before = noop, after = noop) {
  return function(...args) {
    before.call(this);
    var ret = fn.call(this, ...args);
    after.call(this);
    return ret;
  };
}
784620
function () {
        return function () {
          var args = Array.prototype.slice.call(arguments, 0);
          var sig = (function () {
            var ret = [];
            for (var i = 0, len = args.length; i < len; i++) {
              ret.push(toType(args[i]));
            }
            return ret;
          })().join('::');

          if (map[sig]) {
            if (map[sig].inject) args.unshift(input);
            return map[sig].fn.apply(ctx || null, args);
          }

          return input && input.apply(ctx || null, args);
        }
      }
1287039
function wrapObject(object, methods) {
      if (!(methods instanceof Array)) methods = Array.prototype.slice.call(arguments, 1);
      methods.forEach(function (method) {
        object[method] = wrap(object[method]);
      });
    }
511914
function promisesWrapper(func) {
    return (options, callback) => {
        // options is an optional argument
        if (typeof options === 'function') {
            callback = options;
            options = undefined;
        }
        options = options || {};
        // just call the function otherwise wrap a promise around its execution
        if (typeof callback === 'function') {
            func(options, callback);
            return undefined;
        } else {
            return new Promise((fulfill, reject) => {
                func(options, (err, result) => {
                    if (err) {
                        reject(err);
                    } else {
                        fulfill(result);
                    }
                });
            });
        }
    };
}
700569
function wrap(fn) {
  // Error handling middleware
  if (fn.length === 4) {
    return async function wrappedErrorHandler(error, req, res, next) {
      next = _once(next);
      try {
        await fn(error, req, res, next);
        res.headersSent ? null : next();
      } catch(err) {
        res.headersSent ? null : next(err);
      }
    };
  }

  return async function wrappedMiddleware(req, res, next) {
    next = _once(next);
    try {
      await fn(req, res, next);
      res.headersSent ? null : next();
    } catch(err) {
      res.headersSent ? null : next(err);
    }
  };
}
666333
function wrapOrCreateObject() {
      if(isFunction(obj) && (exists(obj.$provide) || exists(obj.$inject) || provide || injects)){
        var instance = Object.create(obj.prototype);
        return obj.apply(instance,arguments) || instance;
      }
      return obj;
    }
415655
public function wrap($function=null, $wrapper=null) {
    list($function, $wrapper) = self::_wrapArgs(func_get_args(), 2);
    
    return self::_wrap(function() use ($wrapper, $function) {
      $args = array_merge(array($function), func_get_args());
      return call_user_func_array($wrapper, $args);
    });
  }
48913
function _Wrap(key, setFunction, _cacheGetter, _cacheSetter, ttl) {
    return new Promise((resolve, reject) => {
        // attempt to get the requested key (note, no prefix here, it's attached in the Get function)
        //  pass success directly through to resolve
        _cacheGetter.bind(this)(key).then(resolve, () => {
            // if cache miss, call the setFunction to get the new value we want
            setFunction().then((dataToCache) => {
                // work out ttl
                var options = {};
                if (ttl) {
                    //  if it's a function, call the function to get the required ttl
                    if (typeof ttl == "function") {
                        ttl = ttl();
                    }
                    options.ttl = ttl;
                }

                // store in cache
                _cacheSetter.bind(this)(key, dataToCache, options).then(() => {
                    // resolve with newly cached data
                    resolve(dataToCache);
                }, reject);
            }, reject);
        });
    });
}
285990
def decorate_method(wrapped):
    
    def wrapper(self):
        lines = Lines()
        if hasattr(self.model, wrapped.__name__):
            print('            . %s' % wrapped.__name__)
            lines.add(1, method_header(wrapped.__name__, nogil=True))
            for line in wrapped(self):
                lines.add(2, line)
        return lines
    functools.update_wrapper(wrapper, wrapped)
    wrapper.__doc__ = 'Lines of model method %s.' % wrapped.__name__
    return property(wrapper)
406364
function wrap (func) {
  return () => new Promise((resolve, reject) => {
    func()
      .then(x => resolve(x))
      .catch(err => {
        let status = _get(err, 'response.status')
        let text = _get(err, 'content.text')

        if (status || text) {
          console.warn(`API error: ${text} (${status})`)
          return resolve(null)
        }

        reject(err)
      })
  })
}
205185
function wrapHandler(handler) {
  return function (state, ...args) {
    return _.assign({}, state, handler(state, ...args));
  };
}
599179
function () {
        /*  generate new wrapper function  */
        var proxy = function () {
            /*  if context is an object, annotate it with
                the real "this" pointer of this method call  */
            if (_cs.istypeof(arguments.callee.__ctx__) === "object")
                arguments.callee.__ctx__.__this__ = this;

            /*  just pass execution through to wrapped function
                with our attached store as its execution context object  */
            return func.apply(arguments.callee.__ctx__, arguments);
        };

        /*  create the attached store object
            (either with fresh or cloned context)  */
        proxy.__ctx__ = (clonable ? _cs.clone(_cs.isdefined(this.__ctx__) ? this.__ctx__ : ctx) : ctx);

        /*  add ourself as the cloning function  */
        if (clonable)
            proxy.clone = generator;

        /*  set "guid" property to the same of original function,
            so it is garbage collected correctly  */
        proxy.guid = func.guid = (func.guid || proxy.guid || _cs.cid());

        /*  return the new wrapper function  */
        return proxy;
    }