prepare callback when done NOTE: callback may not necessarily return, if the number of arguments passed is incorrect
498379
function(result) {

		LOG.warn('execute ' + fullname + ' result: ', l_name);
		LOG.warn(result, l_name);

		var res_obj = {
			func: fullname,
			res: result
		};

		res_str = JSON.stringify(res_obj);
		callback();
	}
757405
def spawn_callback(self, callback: Callable, *args: Any, **kwargs: Any) -> None:
        
        self.add_callback(callback, *args, **kwargs)
943731
function (callbackError, callbackResult, otherArgs) {
        // forbid to call twice
        if (syncCallback.called) return;
        syncCallback.called = true;
        
        if (callbackError) {
            err = callbackError;
        }
        else if (otherArgs) {
            // Support multiple callback result values
            result = [];
            for (var i = 1, l = arguments.length; i < l; i++) {
                result.push(arguments[i]);
            }
        }
        else {
            result = callbackResult;
        }
        
        // Resume fiber if yielding
        if (yielded) fiber.run();
    }
259575
function (rep, callback) {
                if (_.isFunction(config.prepare)) {
                    config.prepare(rep, wrap(callback));
                } else {
                    callback(null, rep);
                }
            }
418129
def _execute_callback(self, *args):
        ""
        self._validate_key(args)      # Validate input key

        # Additional validation needed to ensure kwargs don't clash
        kdims = [kdim.name for kdim in self.kdims]
        kwarg_items = [s.contents.items() for s in self.streams]
        hash_items = tuple(tuple(sorted(s.hashkey.items())) for s in self.streams)+args
        flattened = [(k,v) for kws in kwarg_items for (k,v) in kws
                     if k not in kdims]

        if self._posarg_keys:
            kwargs = dict(flattened, **dict(zip(self._posarg_keys, args)))
            args = ()
        else:
            kwargs = dict(flattened)
        if not isinstance(self.callback, Generator):
            kwargs['_memoization_hash_'] = hash_items

        with dynamicmap_memoization(self.callback, self.streams):
            retval = self.callback(*args, **kwargs)
        return self._style(retval)
478384
def prepare(cls, *args, **kwargs):
        
        cls.args = args
        cls.kwargs = kwargs
        cls.prepared = True
711584
function(callbacks, args) {
            if (!callbacks.length) {
                return typeof done === 'function' ? done() : true;
            }

            var callback = callbacks.shift();
            callback.apply(context, args);

            // Is the callback synchronous ?
            if (callback.length === nbArguments) {
                iterator(callbacks, args, done);
            }
        }
1078193
def wrap_callback(function):
        """"""

        @wraps(function)
        def wrapped(task):
            task._callback_result = function(task)
            return task._callback_result

        return wrapped
524445
function( callback ){
      var tm = this;

      setTimeout(function () {
        var returnValue;

        //check for template existance.
        if (tm.template) {
          tm._tokenize();
          returnValue = tm._tokens;

          // execute callback.
          if (callback) {
            callback( returnValue );
          }
        } else {
          throw "ParseError: No template to parse.";
        }
      }, 0);
    }
881058
function callNormalizedCallback (callback, arg) {
        callback.fn.call(callback.scope, arg, callback.args);
    }
832727
def _call_wrapper(self, time, function, *args):
        """"""
        # execute the function
        function(*args)
        if function in self._callback.keys():
            repeat = self._callback[function][1]
            if repeat:
                # setup the call back again and update the id
                callback_id = self.tk.after(time, self._call_wrapper, time, function, *args)
                self._callback[function][0] = callback_id
            else:
                # remove it from the call back dictionary
                self._callback.pop(function)
73550
def make_call(method, params, opt = {})
      opt = {
        wait: true,
      }.merge(opt)

      ng_wait if opt[:wait]

      params << opt[:using] if opt.has_key?(:using)
      params << opt[:root_selector] if opt.has_key?(:root_selector)
      js_params = params.map do |p|
        if p.nil?
          'null'
        elsif p.is_a? String
          escaped = p.gsub(/'/, "\\\\'").gsub(/"/, '\\\\"')
          "'#{escaped}'"
        else
          p.to_s
        end
      end

      js = "#{method}(#{js_params.join(', ')});"
      logger.debug js
      js_result = page.evaluate_script(js);
#      logger.debug js_result

      js_result
    end
434909
def _run_callback(
        self, callback: Callable, *args: Any, **kwargs: Any
    ) -> "Optional[Future[Any]]":
        
        try:
            result = callback(*args, **kwargs)
        except Exception:
            self.handler.log_exception(*sys.exc_info())
            self._abort()
            return None
        else:
            if result is not None:
                result = gen.convert_yielded(result)
                assert self.stream is not None
                self.stream.io_loop.add_future(result, lambda f: f.result())
            return result
60143
def _handle_callback(self, data):
        """"""

        cb_id = data.get("id")
        args = data.get("args")
        event = self.__callbacks.pop(cb_id, None)
        if not event:
            return
        if not args:
            event.put(args)
            return
        err, info = args
        if err is None:
            event.put(info)
        else:
            LOGGER.warning("Callback returned error of %s", str(err))
            event.put(err)
768248
function(callback)
    {
        var self = this, items = [];
        
        var append = function(err, item) {
            if (err)
            {
                return callback(err);
            }
            if (item)
            {
                items.push(item);
                self.next(append);
            }
            else
            {
                callback(null, items);
            }
        };
        
        this.next(append);
    }
588059
def skip_prepare(func):
    
    @wraps(func)
    def _wrapper(self, *args, **kwargs):
        value = func(self, *args, **kwargs)
        return Data(value, should_prepare=False)
    return _wrapper
1274048
def validate_callback(callback):
    
    if not(hasattr(callback, '_validated')) or callback._validated == False:
        assert hasattr(callback, 'on_loop_start') \
               or hasattr(callback, 'on_loop_end'), \
               'callback must have `on_loop_start` or `on_loop_end` method'
        if hasattr(callback, 'on_loop_start'):
            setattr(callback, 'on_loop_start',
                    validate_callback_data(callback.on_loop_start))
        if hasattr(callback, 'on_loop_end'):
            setattr(callback, 'on_loop_end',
                    validate_callback_data(callback.on_loop_end))
        setattr(callback, '_validated', True)
    return callback