Implementation 
@class PlantOverviewResponse
@constructor
@param {String} jsonAnswer
324473
function PlantOverviewResponse(jsonAnswer) {
    var data = JSON.parse(jsonAnswer);
    data = data.result.overview;

    var currentProduction = data[0].value.replace(/\s/, "");
    var dayProduced = data[1].value.replace(/\s/, "");
    var totalProduced = data[2].value.replace(/\s/, "");

    /**
     * What is currently produces (Unit is W)
     *
     * @property currentProduction
     * @type {Number}
     */
    this.currentProduction = parseFloat(currentProduction);

    /**
     * What is the day production (Unit is W)
     *
     * @property dayProduced
     * @type {Number}
     */
    this.dayProduced = parseFloat(dayProduced) * 1000;
    /**
     * What is the total production (Unit is W)
     *
     * @property totalProduced
     * @type {Number}
     */
    this.totalProduced = parseFloat(totalProduced) * 1000;
    /**
     * Which Mode?
     *
     * @property mode
     * @type {String}
     */
    this.mode = data[3].value;
    /**
     * Is there an error?
     *
     * @property error
     * @type {String}
     */
    this.error = data[4].value;
}
1339595
function convertJSONViews(jsonViews, configuration) {
  if (!jsonViews) {
    return jsonViews;
  }

  const viewCatalog = configuration.views || {};

  jsonViews = Array.isArray(jsonViews) ? jsonViews : [jsonViews];
  return jsonViews
    .map(jsonView => {
      // Try to find a view definition
      const View = viewCatalog[jsonView.type] || DEFAULT_VIEW_CATALOG[jsonView.type];
      // Instantiate it
      if (View) {
        const viewProps = Object.assign({}, jsonView);
        delete viewProps.type;
        return new View(viewProps);
      }
      return null;
    })
    .filter(Boolean);
}
892766
function(json) {
        if (json.serverErrors) {
            this._handleNoCompiledCode(json.serverErrors);
        } else {
            json.compiledCode = this._header + json.compiledCode;

            if (this.file) {
                this._writeOutputTofile(json.compiledCode);
            }

            if (this.callback) {
                this.callback((this._passJson) ? json : json.compiledCode);
            }

            if (!this.file && !this.callback) {
                this.console.info('Code:', json.compiledCode);
            }
        }
    }
169199
<O extends Message> JsonResponseFuture<O> newProvisionalResponse(ClientMethod<O> method) {
    long requestId = RANDOM.nextLong();
    JsonResponseFuture<O> outputFuture = new JsonResponseFuture<>(requestId, method);
    inFlightRequests.put(requestId, outputFuture);
    return outputFuture;
  }
787985
function(response, options) {
        options = OpenLayers.Util.extend({}, options);
        OpenLayers.Util.applyDefaults(options, this.options);

        if(options.callback) {
            var request = response.priv;
            if(request.status >= 200 && request.status < 300) {
                // success
                var result = this.parseResponse(request, options.readOptions);
                if (result && result.success !== false) { 
                    if (options.readOptions && options.readOptions.output == "object") {
                        OpenLayers.Util.extend(response, result);
                    } else {
                        response.features = result;
                    }
                    response.code = OpenLayers.Protocol.Response.SUCCESS;
                } else {
                    // failure (service exception)
                    response.code = OpenLayers.Protocol.Response.FAILURE;
                    response.error = result;
                }
            } else {
                // failure
                response.code = OpenLayers.Protocol.Response.FAILURE;
            }
            options.callback.call(options.scope, response);
        }
    }
1246173
JsonNode readNextResponse() {
        try {
            String responseLine = this.stdout.readLine();
            if (responseLine == null) {
                String error = this.stderr.lines().collect(Collectors.joining("\n\t"));
                throw new JsiiException("Child process exited unexpectedly: " + error);
            }
            return JsiiObjectMapper.INSTANCE.readTree(responseLine);
        } catch (IOException e) {
            throw new JsiiException("Unable to read reply from jsii-runtime: " + e.toString(), e);
        }
    }
345613
function JSONPPolling (opts) {
  Polling.call(this, opts);

  // define global callbacks array if not present
  // we do this here (lazily) to avoid unneeded global pollution
  if (!callbacks) {
    // we need to consider multiple engines in the same page
    if (!global.___eio) global.___eio = [];
    callbacks = global.___eio;
  }

  // callback identifier
  this.index = callbacks.length;

  // add callback to jsonp global
  var self = this;
  callbacks.push(function (msg) {
    self.onData(msg);
  });

  // append to query string
  this.query.j = this.index;
}
38076
function displayResponse(response){
  
  // Gather and display HTTP response data
  var lines = [
    response.statusCode + ' ' + response.statusText,
    headersToString(response.headers)
  ];
  if(response.data){
    lines.push('');
    lines.push(prettyPrint(response.data));
  }
  output(lines.join('\n'));
  
  // Attach listeners to links so that clicking a link will auto-populate
  // the url field
  Array.from($output.querySelectorAll('.link')).forEach(function(link){
    link.addEventListener('click', function(){
      // Remove leading and trailing "
      $url.value = link.innerHTML.slice(1,-1);
      window.scrollTo(0, 0);
    });
  });
}
542577
public void submitAnswer(JSONObject answer, String realm) {
        if (answers == null) {
            answers = new JSONObject();
        }

        try {
            answers.put(realm, answer);
            if (isAnswersFilled()) {
                resendRequest();
            }
        } catch (Throwable t) {
            logger.error("submitAnswer failed with exception: " + t.getLocalizedMessage(), t);
        }
    }
1332623
public void doJson(StaplerRequest req, StaplerResponse rsp) throws IOException, ServletException {
        if (req.getParameter("jsonp") == null || permit(req)) {
            setHeaders(rsp);
            rsp.serveExposedBean(req,bean, req.getParameter("jsonp") == null ? Flavor.JSON : Flavor.JSONP);
        } else {
            rsp.sendError(HttpURLConnection.HTTP_FORBIDDEN, "jsonp forbidden; implement jenkins.security.SecureRequester");
        }
    }
964742
function extendHttpResponse(res) {
    res = res || express.response;

    function callbackFnFn(verbFunc) {
        return function (next, status) {
            var res = this;
            return function (err, result) {
                if (err) {
                    return next(err);
                }
                if (status) {
                    return res.status(status);
                }
                return verbFunc.call(res, result);
            };
        };
    }

    function laterFnFn(verbFunc) {
        return function (promise, next, status) {
            var res = this;
            return Q.when(promise).then(function (result) {
                if (status) {
                    res.status(status);
                }
                return verbFunc.call(res, result);
            }).fail(next).done();
        };
    }

    //
    // callback helpers
    //

    /**
     * create generic node.js callback function to invoke 'express.response.send()'.
     *
     * ex.
     * ```
     * var fs = require('fs');
     * app.get('/foo', function(req, res, next) {
     *   fs.readFile('foo.txt', res.sendCallbackFn(next));
     * });
     * ```
     * @param {function} next
     * @param {number} [status]
     * @returns {function(err, result)} generic node.js callback which send response.
     * @method
     * @memberOf {express.request}
     */
    res.sendCallbackFn = callbackFnFn(res.send);

    /**
     * create generic node.js callback function to invoke 'express.response.json()'.
     *
     * @param {function} next
     * @param {number} [status]
     * @returns {function(err, result)} generic node.js callback which send 'json' response.
     * @method
     * @memberOf {express.request}
     */
    res.jsonCallbackFn = callbackFnFn(res.json);

    /**
     * create generic node.js callback function to invoke 'express.response.jsonp()'.
     *
     * @param {function} next
     * @param {number} [status]
     * @returns {function(err, result)} generic node.js callback which send 'jsonp' response.
     * @method
     * @memberOf {express.request}
     */
    res.jsonpCallbackFn = callbackFnFn(res.jsonp);

    /**
     * create generic node.js callback function to invoke 'express.response.sendFile()'.
     *
     * @param {function} next
     * @param {number} [status]
     * @returns {function(err, result)} generic node.js callback which send 'sendFile' response.
     * @method
     * @memberOf {express.request}
     */
    res.sendFileCallbackFn = callbackFnFn(res.sendFile);

    /**
     * create generic node.js callback function to invoke 'express.response.redirect()'.
     *
     * @param {function} next
     * @param {number} [status]
     * @returns {function(err, result)} generic node.js callback which send 'redirect' response.
     * @method
     * @memberOf {express.request}
     */
    res.redirectCallbackFn = callbackFnFn(res.redirect);

    /**
     * ex.
     * ```
     * fs.stat('foo.txt', res.renderCallbackFn('stat_view', next));
     * ```
     *
     * @param {string} view
     * @param {function} next
     * @param {number} [status]
     * @returns {function(err, result)}
     * @memberOf {express.response}
     */
    res.renderCallbackFn = function (view, next, status) {
        var res = this;
        return function (err, result) {
            if (err) {
                return next(err);
            }
            if (status) {
                res.status(status);
            }
            return res.render(view, result);
        };
    };

    //
    // promise helpers
    //

    /**
     * promise version to invoke `express.response.send()`.
     *
     * ex.
     * ```
     * var FS = require('q-io/fs');
     * app.get('/foo', function (req, res, next) {
     *   res.sendLater(FS.readFile('foo.txt'), next);
     * })
     * ```
     *
     * @param {promise|*} promise of response.
     * @param {function} next
     * @param {number} [status]
     * @method
     * @memberOf {express.request}
     */
    res.sendLater = laterFnFn(res.send);

    /**
     * promise version of `express.response.json()`.
     *
     * @param {promise|*} promise of 'json' response.
     * @param {function} next
     * @param {number} [status]
     * @method
     * @memberOf {express.request}
     */
    res.jsonLater = laterFnFn(res.json);

    /**
     * promise version of `express.response.jsonp()`.
     *
     * @param {promise|*} promise of 'jsonp' response.
     * @param {function} next
     * @param {number} [status]
     * @method
     * @memberOf {express.request}
     */
    res.jsonpLater = laterFnFn(res.jsonp);

    /**
     * promise version of `express.response.sendFile()`.
     *
     * @param {promise|*} promise of 'sendFile' response.
     * @param {function} next
     * @param {number} [status]
     * @method
     * @memberOf {express.request}
     */
    res.sendFileLater = laterFnFn(res.sendFile);

    /**
     * promise version of `express.response.redirect()`.
     *
     * @param {promise|*} promise of 'redirect' response.
     * @param {function} next
     * @param {number} [status]
     * @method
     * @memberOf {express.request}
     */
    res.redirectLater = laterFnFn(res.redirect);

    /**
     *
     * ex.
     * ```
     * var FS = require('q-io/fs');
     * res.renderLater('stat_view', FS.stat('foo.txt'), next);
     * ```
     *
     * @param {string} view
     * @param {promise|*} promise of 'render' model.
     * @param {function} next
     * @param {number} [status]
     * @memberOf {express.response}
     */
    res.renderLater = function (view, promise, next, status) {
        var res = this;
        return Q.when(promise).then(function (result) {
            if (status) {
                res.status(status);
            }
            return res.render(view, result);
        }).fail(next).done();
    };
}
603673
function processAnswers(answers) {
    let config = {
        rules: {},
        env: {},
        parserOptions: {},
        extends: []
    };

    // set the latest ECMAScript version
    config.parserOptions.ecmaVersion = DEFAULT_ECMA_VERSION;
    config.env.es6 = true;
    config.globals = {
        Atomics: "readonly",
        SharedArrayBuffer: "readonly"
    };

    // set the module type
    if (answers.moduleType === "esm") {
        config.parserOptions.sourceType = "module";
    } else if (answers.moduleType === "commonjs") {
        config.env.commonjs = true;
    }

    // add in browser and node environments if necessary
    answers.env.forEach(env => {
        config.env[env] = true;
    });

    // add in library information
    if (answers.framework === "react") {
        config.parserOptions.ecmaFeatures = {
            jsx: true
        };
        config.plugins = ["react"];
    } else if (answers.framework === "vue") {
        config.plugins = ["vue"];
        config.extends.push("plugin:vue/essential");
    }

    // setup rules based on problems/style enforcement preferences
    if (answers.purpose === "problems") {
        config.extends.unshift("eslint:recommended");
    } else if (answers.purpose === "style") {
        if (answers.source === "prompt") {
            config.extends.unshift("eslint:recommended");
            config.rules.indent = ["error", answers.indent];
            config.rules.quotes = ["error", answers.quotes];
            config.rules["linebreak-style"] = ["error", answers.linebreak];
            config.rules.semi = ["error", answers.semi ? "always" : "never"];
        } else if (answers.source === "auto") {
            config = configureRules(answers, config);
            config = autoconfig.extendFromRecommended(config);
        }
    }

    // normalize extends
    if (config.extends.length === 0) {
        delete config.extends;
    } else if (config.extends.length === 1) {
        config.extends = config.extends[0];
    }

    ConfigOps.normalizeToStrings(config);
    return config;
}
427220
public void processResponse(Object results, Object status) {
        ElevationStatus pStatus = ElevationStatus.UNKNOWN_ERROR;
        
        if (status instanceof String && results instanceof JSObject) {
            pStatus = ElevationStatus.valueOf((String) status);
            if (ElevationStatus.OK.equals(pStatus)) {
                JSObject jsres = (JSObject) results;
                Object len = jsres.getMember("length");
                if (len instanceof Number) {
                    int n = ((Number)len).intValue();
                    ElevationResult[] ers = new ElevationResult[n];
                    for (int i = 0; i < n; i++) {
                        Object obj = jsres.getSlot(i);
                        if (obj instanceof JSObject) {
                            ers[i] = new ElevationResult((JSObject) obj);
                        }
                    }
                    callback.elevationsReceived(ers, pStatus);
                    return;
                }
            }
        }
        callback.elevationsReceived(new ElevationResult[]{}, pStatus);
    }
1086567
function (response) {
        var that = this,
            suggestions;

        if (!response || !$.isArray(response.suggestions)) {
            return false;
        }

        that.verifySuggestionsFormat(response.suggestions);
        that.setUnrestrictedValues(response.suggestions);

        if ($.isFunction(that.options.onSuggestionsFetch)) {
            suggestions = that.options.onSuggestionsFetch.call(that.element, response.suggestions);
            if ($.isArray(suggestions)) {
                response.suggestions = suggestions;
            }
        }

        return true;
    }
508036
function( jsonConfig, callback, jQuery ) {
        if ( jsonConfig instanceof Array ) {
            jsonConfig = JSONconfig.make( jsonConfig );
        }

        // optional
        if ( jQuery ) {
            $ = jQuery;
        }

        this.tree = TreeStore.createTree( jsonConfig );
        this.tree.positionTree( callback );
    }
1219232
function onResponse( response ) {
		res = response;
		if ( res.statusCode !== 200 ) {
			err = {
				'status': res.statusCode,
				'message': ''
			};
		}
		debug( 'Received a response from query endpoint.' );
		debug( 'Response status: %s.', res.statusCode );

		debug( 'Response headers: %s', JSON.stringify( res.headers ) );

		res.setEncoding( 'utf8' );
		res.on( 'data', onData );
		res.on( 'end', onEnd );
	}
757472
function onResponse( response ) {
		if ( response.statusCode !== 200 ) {
			err = {
				'status': response.statusCode,
				'message': ''
			};
		}
		debug( 'Received a response from query endpoint.' );
		debug( 'Response status: %s.', response.statusCode );
		debug( 'Response headers: %s', JSON.stringify( response.headers ) );

		response.setEncoding( 'utf8' );
		response.on( 'data', onData );
		response.on( 'end', onEnd );
	}