------------------------------- Gets a callback response data builder
335531
function (callback) {
	return function (res) {
		var resData = "";
		res.setEncoding('utf8');
		res.on('data',function(chunk) { resData+=chunk; });
		res.on('end', function() { callback(res,resData); });
	};
}
1147113
function Response(req, res) {
  if (!(this instanceof Response))
    return new Response(req, res);

  EventEmitter.call(this);

  this.req = req;
  this.res = res;
  this.sent = false;
  this.readable = false;
  this.writable = true;
  this.statusCode = 200;
  this.res.statusCode = 200;

  if (req)
    this.init(req, res);
}
808663
def callback(response = {})
      if response.empty?
        raise ArgumentError, "No callback parameters found"
      end

      CallbackResponse.new(response, config)
    end
198272
function ProcessDataResponse(jsonAnswer) {
    var data = JSON.parse(jsonAnswer);
    data = data.result;

    var channels = [];
    for (var deviceId in data) {
        if (data[deviceId] !== undefined) {
            if (data[deviceId].length > 0) {
                channels = data[deviceId][0].channels;
            }
        }
    }

    /**
     * @property channels
     * @type {Array}
     */
    this.channels = channels;
}
924111
function( url, els, isHijax ) {
			$.get( url, function( data, status, xhr ) {
				els.trigger( "ajaxIncludeResponse", [ data, xhr ] );
			});
		}
404147
function(callback) {
            callback = callback || function() {};
            
            var that = this;
            var params = {
                count: this._pagesize,
                offset: this._offset
            };
            return this._endpoint(params, function(err, results) {
                if (err) {
                    callback(err);
                }
                else {                    
                    var numResults = (results.rows ? results.rows.length : 0);
                    that._offset += numResults;
                    
                    callback(null, results, numResults > 0);
                }
            });
        }
690326
function ajaxHandleResponses( s, jqXHR, responses ) {

	var contents = s.contents,
		dataTypes = s.dataTypes,
		responseFields = s.responseFields,
		ct,
		type,
		finalDataType,
		firstDataType;

	// Fill responseXXX fields
	for ( type in responseFields ) {
		if ( type in responses ) {
			jqXHR[ responseFields[type] ] = responses[ type ];
		}
	}

	// Remove auto dataType and get content-type in the process
	while( dataTypes[ 0 ] === "*" ) {
		dataTypes.shift();
		if ( ct === undefined ) {
			ct = s.mimeType || jqXHR.getResponseHeader( "content-type" );
		}
	}

	// Check if we're dealing with a known content-type
	if ( ct ) {
		for ( type in contents ) {
			if ( contents[ type ] && contents[ type ].test( ct ) ) {
				dataTypes.unshift( type );
				break;
			}
		}
	}

	// Check to see if we have a response for the expected dataType
	if ( dataTypes[ 0 ] in responses ) {
		finalDataType = dataTypes[ 0 ];
	} else {
		// Try convertible dataTypes
		for ( type in responses ) {
			if ( !dataTypes[ 0 ] || s.converters[ type + " " + dataTypes[0] ] ) {
				finalDataType = type;
				break;
			}
			if ( !firstDataType ) {
				firstDataType = type;
			}
		}
		// Or just use first one
		finalDataType = finalDataType || firstDataType;
	}

	// If we found a dataType
	// We add the dataType to the list if needed
	// and return the corresponding response
	if ( finalDataType ) {
		if ( finalDataType !== dataTypes[ 0 ] ) {
			dataTypes.unshift( finalDataType );
		}
		return responses[ finalDataType ];
	}
}
708258
function (url, callback) {
		var ajax = this.obj.$ajax;
		if (this._update_busy)
			return false;
		else
			this._update_busy = true;

		//this._loader = this._loader || new dtmlXMLLoaderObject(true);

		//this._loader.async=true;
		//this._loader.waitCall=callback;
		//this._loader.loadXML(url);
		ajax.get(url, callback);

	}
379204
function fetchOptions(handler, data, board, callback) {
  if (_.isEmpty(data)) {
    return callback(null, data);
  }

  async.eachSeries(board.selects, (item, next) => {
    if (item.select) {
      return join(handler, data, item, board.type, next);
    }
    next();
  }, err => callback(err, data));
}
690724
function compileCallback(callback, method) {
    var client = this.client;

    // Build the callback
    var builder = client.queryBuilder();
    callback.call(builder, builder);

    // Compile the callback, using the current formatter (to track all bindings).
    var compiler = client.queryCompiler(builder);
    compiler.formatter = this;

    // Return the compiled & parameterized sql.
    return compiler.toSQL(method || 'select');
  }
498043
function (callback) {
                var result = new Array(this.length), boundCallback = _gpfArrayBind(callback, arguments);
                _gpfArrayForEachOwn(this, function (item, index, array) {
                    result[index] = boundCallback(item, index, array);
                });
                return result;
            }
962040
def _server_begin_response_callback(self, response: Response):
        ''''''
        self._item_session.response = response

        if self._cookie_jar:
            self._cookie_jar.extract_cookies(response, self._item_session.request)

        action = self._result_rule.handle_pre_response(self._item_session)
        self._file_writer_session.process_response(response)

        return action == Actions.NORMAL
299413
function (isResponse, request, cb) {
                if (!this._filters) {
                    this.$callback(cb);
                    return;
                }
                var args = {
                    isResponse : isResponse,
                    request : request,
                    cb : cb,
                    filters : this._filters,
                    nbFilters : this._filters.length
                    // store the number of filters so that we do not call filters which were added after the call
                    // to _callFilters
                };
                if (this._filtersToBeLoaded > 0
                        && (request.sender == null || request.sender.classpath != "aria.core.FileLoader")) {
                    this._loadMissingFilters({
                        fn : this._continueCallingFilters,
                        args : args,
                        scope : this
                    });
                } else {
                    this._continueCallingFilters(null, args);
                }
            }
612695
function fireCallback(callbackName) {
      var data = [], len = arguments.length - 1;
      while ( len-- > 0 ) data[ len ] = arguments[ len + 1 ];

      /*
        Callbacks:
        beforeCreate (options),
        beforeOpen (xhr, options),
        beforeSend (xhr, options),
        error (xhr, status),
        complete (xhr, stautus),
        success (response, status, xhr),
        statusCode ()
      */
      var globalCallbackValue;
      var optionCallbackValue;
      if (globals[callbackName]) {
        globalCallbackValue = globals[callbackName].apply(globals, data);
      }
      if (options[callbackName]) {
        optionCallbackValue = options[callbackName].apply(options, data);
      }
      if (typeof globalCallbackValue !== 'boolean') { globalCallbackValue = true; }
      if (typeof optionCallbackValue !== 'boolean') { optionCallbackValue = true; }
      return (globalCallbackValue && optionCallbackValue);
    }
142276
function(callback)
    {
        var params = util.extend({count:1}, this.params);        
        this.api.doRequest("GET", this.path, params, function(err, res) {
            if (err)
            {
                return callback(err);
            }                    
            callback(null, res.count);
        });
    }
1039616
function fetch_callback($sql, callable $callback)
	{
		$result = null;
		$rs = $this->query($sql, MYSQLI_USE_RESULT);
		while ($row = $rs->fetch_assoc())
		{
		//	if (call_user_func_array($callback, [&$row, &$result]) === false)	//	alternative: when using references, the values MUST be passed via an array with call_user_func_array(), call_user_func() only passes by value!
			if ($callback($row, $result) === false)
				break;
		}
		$rs->free_result();
		return $result;
	}
185571
function prepareResponse(validDataSources, invalidDataSources, cb) {
  //There Were Errors Updating Data Sources, should return an error

  logger.debug("prepareResponse Before", validDataSources);
  //For The Valid Data Sources, Just want the updated Document JSON
  validDataSources = _.map(validDataSources, function(validDataSourceData) {
    return processDataSourceResponse(validDataSourceData.document.toJSON());
  });

  logger.debug("prepareResponse After", validDataSources);

  var returnError;
  if (invalidDataSources.length > 0) {
    returnError = buildErrorResponse({
      error: new Error("Error Updating Data Sources"),
      code: ERROR_CODES.FH_FORMS_UNEXPECTED_ERROR
    });
  }

  return cb(returnError, {
    validDataSourceUpdates: validDataSources,
    invalidDataSourceUpdates: invalidDataSources
  });
}