query stringlengths 9 14.6k | document stringlengths 8 5.39M | metadata dict | negatives listlengths 0 30 | negative_scores listlengths 0 30 | document_score stringlengths 5 10 | document_rank stringclasses 2
values |
|---|---|---|---|---|---|---|
Modifying an Existing Session A successful INVITE request (see Section 13) establishes both a dialog between two user agents and a session using the offeranswer model. Section 12 explains how to modify an existing dialog using a target refresh request (for example, changing the remote target URI of the dialog). This se... | invite(delegate, options) {
this.logger.log(`INVITE dialog ${this.id} sending INVITE request`);
if (this.early) {
// FIXME: TODO: This should throw a proper exception.
throw new Error("Dialog not confirmed.");
}
// Note that a UAC MUST NOT initiate a new INVITE tr... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function SetDataOnNewSession() {\n var requestObject = EAUtils.ExtractRequestObject();\n var checkSession = Transaction.wrap(function() {\n return CheckAgentForSession.checkAgent(requestObject.employeeId, requestObject.passcode, requestObject.storeId);\n });\n if(requestObject.appCurrency != dw.... | [
"0.56471574",
"0.5453326",
"0.5360881",
"0.53603786",
"0.53067625",
"0.52794045",
"0.52601993",
"0.5243599",
"0.52370036",
"0.52370036",
"0.5210802",
"0.52026176",
"0.5186132",
"0.5101409",
"0.5070176",
"0.506616",
"0.5061965",
"0.5041348",
"0.5036517",
"0.5031764",
"0.502264... | 0.5925827 | 0 |
REFER is a SIP request and is constructed as defined in [1]. A REFER request MUST contain exactly one ReferTo header field value. | refer(delegate, options) {
this.logger.log(`INVITE dialog ${this.id} sending REFER request`);
if (this.early) {
// FIXME: TODO: This should throw a proper exception.
throw new Error("Dialog not confirmed.");
}
// FIXME: TODO: Validate Refer-To header field value.
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function isValidReferer(req)\n{\n //FOR DEBUGGING!\n // return false;\n return _.startsWith(req.header('host'),'localhost') || _.includes(req.header('referer'),'localhost');\n}",
"function checkReferrer () {\n if ($F('referrer') == 4 || $F('referrer') == 5 || $F('referrer') == 6) {\n $('specify_refe... | [
"0.51269895",
"0.51007706",
"0.50068825",
"0.5002586",
"0.4937783",
"0.48535004",
"0.48371086",
"0.48101485",
"0.47677192",
"0.46060184",
"0.453549",
"0.44473648",
"0.43570578",
"0.4354927",
"0.43544513",
"0.43544513",
"0.43499663",
"0.43499663",
"0.43485242",
"0.43376267",
"... | 0.61810863 | 0 |
If not in a stable signaling state, rollback to prior stable signaling state. | signalingStateRollback() {
if (this._signalingState === SignalingState.HaveLocalOffer ||
this.signalingState === SignalingState.HaveRemoteOffer) {
if (this._rollbackOffer && this._rollbackAnswer) {
this._signalingState = SignalingState.Stable;
this._offer ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async rollback() {\n return Promise.resolve()\n }",
"rollback() {\n const isNew = this.get('isNew');\n this.rollbackAttributes();\n if (isNew) { return; }\n let trackerInfo = Tracker.metaInfo(this);\n let rollbackData = Tracker.rollbackData(this, trackerInfo);\n let normalized = Tracker.nor... | [
"0.6094144",
"0.5886347",
"0.58479905",
"0.5767719",
"0.57589996",
"0.57589996",
"0.55950975",
"0.55938005",
"0.55938005",
"0.53587246",
"0.5339905",
"0.5317632",
"0.5288879",
"0.5278843",
"0.52632916",
"0.5255512",
"0.5254117",
"0.5246048",
"0.52440184",
"0.52440184",
"0.522... | 0.74680626 | 0 |
computePingPongQuote is same as computeTopJoinQuote but need to use params.mode === Models.QuotingMode.PingPong | function computePingPongQuote(input) {
let genQt = getQuoteAtTopOfMarket(input);
if (input.params.mode === Models.QuotingMode.PingPong && genQt.bidSz > .2) {
genQt.bidPx += input.minTickIncrement;
}
let minBid = input.fv.price - input.params.width / 2.0;
genQt.bidPx = Math.min(minBid, genQt.... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"pingPong(isInternalCall = false) {\n this.updateStates('isPingPong');\n }",
"_sendPong ( nonce ) {\n const message = this.messages.Pong( nonce );\n this.sendMessage( message );\n }",
"pingPongReverse() {\n this.reverse(true);\n\n this.pingPong();\n }",
"function usePing() {\... | [
"0.52862686",
"0.52536684",
"0.5040134",
"0.49320155",
"0.48796713",
"0.4878928",
"0.4788566",
"0.4788566",
"0.47766104",
"0.4746564",
"0.4706205",
"0.46447596",
"0.45591626",
"0.44802615",
"0.4462107",
"0.44083804",
"0.4401067",
"0.4400936",
"0.43771538",
"0.43692768",
"0.42... | 0.73752373 | 0 |
Add the overlay element to the graph when mouse interaction takes place. This needs to be on top | function addOverlay() {
//Mouseover focus and crossline
// if (!isChartDiscrete) {
// focus = ChartElementService.appendFocus(mainChart);
// crossLine = ChartElementService.appendCrossLine(focus);
// currSeries.forEach(function (metric) {
// if (metric.data.length === 0... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function _addOverlay() {\n\t var overlayDiv = $(Constants.DIV_COMP, {\n\t \"class\": Constants.OVERLAY_STYLE\n\t });\n\t overlayDiv(_createOverlayNode({\n\t width: Utils.getFullWindowWidth() + Constants.PX,\n\t height: Utils.getFullWindowHeight() + Constants.PX,\n\t top: 0,\n\t... | [
"0.6859656",
"0.66199344",
"0.66082907",
"0.6535566",
"0.644778",
"0.6400055",
"0.63907",
"0.6229752",
"0.6214854",
"0.61978626",
"0.6167002",
"0.61208946",
"0.61181813",
"0.60944366",
"0.6080004",
"0.6066391",
"0.60506374",
"0.6049653",
"0.60254556",
"0.601502",
"0.6010494",... | 0.782723 | 0 |
sync vertical focus line across charts, mouseX is the timestamp | function syncChartMouseMove(mouseX) {
if (mouseX < x.domain()[0] || mouseX > x.domain()[1]) {
// mouseOutChart
ChartElementService.hideFocusAndTooltip(mouseMoveElement, tooltip);
} else {
mouseOverChart(true);
var mousePositionData = {
mouseX: mouseX,
positionX: x(mouseX)... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function interMouseMove() {\n var m = d3.mouse(this);\n\n //Coordinates are slightly behind mouse so cannot click on self\n line.attr(\"x2\", m[0]-3)\n .attr(\"y2\", m[1]-3);\n}",
"function onMouseMove() { // mouse moving over canvas\n var mouse = d3.mouse(this);\n\n console.log... | [
"0.6669742",
"0.647484",
"0.6359154",
"0.632655",
"0.6315184",
"0.6297836",
"0.6267164",
"0.6250062",
"0.62314713",
"0.62314713",
"0.62314713",
"0.62314713",
"0.6207995",
"0.6160583",
"0.6144134",
"0.6143385",
"0.61314034",
"0.61314034",
"0.61314034",
"0.61314034",
"0.6078307... | 0.65328944 | 1 |
clear vertical lines and tooltip when move mouse off the focus chart | function syncChartMouseOut() {
ChartElementService.hideFocusAndTooltip(mouseMoveElement, tooltip);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function OCG_remove_corsshair()\n{\n\tOCG_config.plot.plot.clearCrosshair();\n}",
"hideHighlightedDataPoint() {\n this.graphContainer.select('.highlight-datum')\n .style('display', 'none');\n this.graphContainer.select('.highlight-datum-outline')\n .style('display', 'none');\n... | [
"0.66451126",
"0.65634984",
"0.6551308",
"0.6482413",
"0.648051",
"0.642191",
"0.6375",
"0.6356483",
"0.6352513",
"0.63522923",
"0.63493764",
"0.6338972",
"0.6314058",
"0.6301716",
"0.62615055",
"0.62406737",
"0.623843",
"0.6231558",
"0.6180288",
"0.61755633",
"0.61740583",
... | 0.7451726 | 0 |
redraw the graph with new series | function redraw () {
if (ChartToolService.isBrushInNonEmptyRange(x.domain(), dateExtent)) {
ChartElementService.redrawGraphs(seriesBeingDisplayed, scope.sources, chartType, graph, mainChart, extraGraph);
}
ChartElementService.redrawAxis(xAxis, xAxisG, yAxis, yAxisG, yAxisR, yAxisRG, extraYAxisR, ex... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function refresh() {\n var chart = Ext.getCmp('chartCmp'),\n series = chart.series.items,\n len = series.length,\n rc = rendererConfiguration,\n color, grayscale, radius, s,\n \n func = function (a,b, attr) {\n return attr;\n ... | [
"0.740372",
"0.71468145",
"0.71402484",
"0.7090299",
"0.7061596",
"0.6981424",
"0.69543326",
"0.6936615",
"0.68851954",
"0.68280053",
"0.67890465",
"0.6776318",
"0.67706037",
"0.6752629",
"0.67133176",
"0.670556",
"0.66975623",
"0.66848433",
"0.6628839",
"0.66244483",
"0.6572... | 0.7246785 | 1 |
Crea un nuevo material en la plataforma. | createMaterial() {
this.materialService
.createMaterial(this.newMaterial)
.then((data) => {
this.alertService.showMessage(MESSAGES.addedMaterial);
this.getMaterial();
this.newMaterial = new Material();
this.newMaterial.category = this.id;
window.$("#new-material")... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"create(req, res) {\n\t\tMaterial.create(req.body)\n\t\t.then(function (nuevoMaterial) {\n\t\t\tres.status(200).json(nuevoMaterial);\n\t\t})\n\t\t.catch(function (error){\n\t\t\tres.status(500).json(error);\n\t\t});\n\t}",
"create({ body }, res) {\n\t\tconsole.log(body)\n\t\tvar material = new Material(body);\n\t... | [
"0.66815317",
"0.66388446",
"0.6447043",
"0.63568467",
"0.61525357",
"0.6073368",
"0.5972607",
"0.5895082",
"0.58423513",
"0.58067006",
"0.5799341",
"0.5748281",
"0.5748048",
"0.574749",
"0.572743",
"0.5622312",
"0.56149006",
"0.5603745",
"0.5596332",
"0.5596332",
"0.5573341"... | 0.72872967 | 0 |
GET NOTIFICATIONS Opens a websocket connection to a specific Chat Room stream | function createNotificationWebsocketConnection() {
// Creates the new websocket connection
const socket = new WebSocket(webSocketUrl);
// When the connection is 1st created, this code runs subscribing the clien to a specific chatroom stream in the ChatRoomChannel
socket.onopen = function(event) {
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"socketOpen() {\n this.subscribeToChannel('ChatChannel', {\n room: this.room.id,\n });\n }",
"function onWebSocketOpen() {\n // NOTE: Two stun servers, with two different ip addresses binded\n // to different tcp ports are needed in the general case\n // https://stackoverflow.com/questions/75... | [
"0.67967486",
"0.60913163",
"0.6021779",
"0.60104686",
"0.5976187",
"0.59717685",
"0.5888721",
"0.58557206",
"0.5849001",
"0.5828966",
"0.582282",
"0.5732287",
"0.5726892",
"0.5712996",
"0.5689138",
"0.568642",
"0.5644873",
"0.5627037",
"0.5619354",
"0.5604096",
"0.55852556",... | 0.68181556 | 0 |
Generate the environment variables to pass to the AWS CLI tool | function createEnvVars(s3AccessKeyId, s3SecretAccessKey) {
return {
ignoreReturnCode: true,
silent: false,
env: {
'AWS_ACCESS_KEY_ID': s3AccessKeyId || "",
'AWS_SECRET_ACCESS_KEY': s3SecretAccessKey || "",
'AWS_DEFAULT_REGION': 'us-east-1',
}
}... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async function main() {\n //[START rcloadenv_quickstart]\n // import the npm module\n const rcloadenv = require('@google-cloud/rcloadenv');\n\n async function quickstart() {\n // Just load raw variables from the Runtime Config service:\n const vars = await rcloadenv.getVariables('my-config');\n consol... | [
"0.64257187",
"0.6368647",
"0.6352938",
"0.6250622",
"0.6219777",
"0.621446",
"0.6176907",
"0.6054746",
"0.6033173",
"0.58933395",
"0.5845525",
"0.58026165",
"0.57669663",
"0.57623523",
"0.5759158",
"0.57552785",
"0.57328147",
"0.57043266",
"0.569644",
"0.56654567",
"0.565085... | 0.6918066 | 0 |
Show filters on a page | function showFilters() {
$('#filters').slideToggle('fast');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function showFilters () {\n $.ajax({\n method: 'POST',\n url: custom_filter.ajax_url,\n action: 'get_filters',\n data: {\n 'action': 'get_filters'\n },\n dataType: 'json',\n success: function (msg) {\n renderFilters(msg)\n handleIncomingUrlParams()\n ... | [
"0.77974683",
"0.7304126",
"0.716146",
"0.703902",
"0.6874428",
"0.68523455",
"0.67889917",
"0.6729581",
"0.6696326",
"0.6664354",
"0.6664354",
"0.6664354",
"0.6664354",
"0.6664354",
"0.6664354",
"0.6664354",
"0.6664354",
"0.6664354",
"0.6664354",
"0.6664354",
"0.6664354",
... | 0.7450498 | 1 |
Shows the formatting guide | function showFormatting() {
$('#formatting_guide').toggle('fast');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function formatWizard() {\n const codePropC = getSourceEditor();\n const currentLine = codePropC.getCursorPosition()['row'] + 1;\n codePropC.setValue(prettyCode(codePropC.getValue()));\n codePropC.focus();\n codePropC.gotoLine(currentLine);\n}",
"function formatStyling(formatted, special, specifier, precisi... | [
"0.63320506",
"0.6152802",
"0.5877519",
"0.58102995",
"0.57564414",
"0.5687396",
"0.5648729",
"0.5611518",
"0.55952996",
"0.5513181",
"0.5453657",
"0.5450378",
"0.5437914",
"0.5423264",
"0.5423088",
"0.5419225",
"0.5372993",
"0.53695565",
"0.533396",
"0.5292759",
"0.5274564",... | 0.68460006 | 0 |
Create a redirect rule | function createRedirectRule(article_name,category_name,article_id) {
send_data = "action=redirectRule&article=" + article_id + "&name=" + article_name + "&category=" + category_name;
$.post('functions/ajax.php', send_data, function(theResponse) {
var returned = theResponse.split('+++');
if (returned['0'] == "... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function createRedirectDirectoryListener () {\n\t return function redirect () {\n\t if (this.hasTrailingSlash()) {\n\t this.error(404)\n\t return\n\t }\n\n\t // get original URL\n\t var originalUrl = parseUrl.original(this.req)\n\n\t // append trailing slash\n\t originalUrl.path = null... | [
"0.6392055",
"0.6392055",
"0.6308478",
"0.62166685",
"0.61929625",
"0.61929625",
"0.61929625",
"0.61929625",
"0.61929625",
"0.61929625",
"0.61929625",
"0.61929625",
"0.61929625",
"0.6190895",
"0.6190895",
"0.6190895",
"0.6190895",
"0.6127962",
"0.57609576",
"0.5747582",
"0.56... | 0.65135384 | 0 |
Updates a category's default article | function makeDefault(id,article) {
send_data = "action=make_default&id=" + id + "&article=" + article;
$.post('functions/ajax.php', send_data, function(theResponse) {
var returned = theResponse.split('+++');
if (returned['0'] == "1") {
// Old default
html = "<a href=\"#\" onClick=\"makeDefault('" + retu... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function cambiarDefault() {\n var categoriaId = $$(this).val();\n var categorias = almacenamientoCategorias.get();\n var tipo = $$(this).parents('ul.listado').data('tipo');\n\n for (var i in categorias) {\n if(tipo == categorias[i].tipo) {\n categorias[i].esDefault = categoriaId == categori... | [
"0.6346492",
"0.6018731",
"0.57713497",
"0.5290917",
"0.5269901",
"0.5223759",
"0.5200037",
"0.5147596",
"0.5103983",
"0.5099224",
"0.5023554",
"0.5004044",
"0.4953353",
"0.49293616",
"0.49009666",
"0.4898835",
"0.4872363",
"0.48673004",
"0.4839643",
"0.48341665",
"0.4829729"... | 0.6130242 | 1 |
Give user a badge | function giveBadge() {
id = $('#badge_give').val();
send_data = "action=give_badge&user=" + user_id + "&id=" + id;
$.post('functions/ajax.php', send_data, function(theResponse) {
var returned = theResponse.split('+++');
if (returned['0'] == "1") {
$("#new_badge").before(returned['1']);
showSa... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function createBadge() {\n badges = game.add.physicsGroup();\n var badge = badges.create(88, 457, 'badge');\n badge.animations.add('spin');\n badge.animations.play('spin', 10, true);\n}",
"function updateBadge () {\n let label = ''\n const unapprovedTxCount = controller.txController.getUnapprovedTxCoun... | [
"0.6840726",
"0.6791865",
"0.6779722",
"0.67568123",
"0.66908693",
"0.6673348",
"0.66413623",
"0.66394854",
"0.6633176",
"0.6633176",
"0.6621129",
"0.6615753",
"0.6589126",
"0.6553612",
"0.64958596",
"0.6483138",
"0.6460299",
"0.6437559",
"0.6425391",
"0.6401397",
"0.6398308"... | 0.70743066 | 0 |
inputs which neurons to vary the inputs of. Currently only supports 2. which_output Which neuron's output to compute. Default is first neuron in output layer. | compute(inputs, which_output) {
if (inputs === undefined) {
inputs = new Array(this.network.num_neurons[0]);
for (let ii=0; ii < this.dims.length; ii++){
inputs[this.dims[ii]] = 0;
}
}
if (typeof(inputs) !== 'object' || inputs.length !== this.network.num_neurons[0]) {
throw(... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"parse_output(which_output) {\n if (which_output === undefined) {\n return [this.network.layers.length - 1, 0];\n }\n\n if (typeof(which_output) !== 'object' || which_output.length !== 2) {\n throw \"Invalid output: require [layer, index]\";\n }\n\n const [layer, index] = which_output;\n\n ... | [
"0.65471244",
"0.6486287",
"0.62845933",
"0.6229504",
"0.619762",
"0.5929104",
"0.56679904",
"0.56366396",
"0.55213743",
"0.54933065",
"0.54819775",
"0.54775906",
"0.5359234",
"0.52985257",
"0.52748185",
"0.5248072",
"0.5222055",
"0.5217862",
"0.5216911",
"0.518234",
"0.51792... | 0.663396 | 0 |
privateish// Loop through the range of input values at the specified neuron and compute the output values at the specified output neuron. Recursive strategy: for each input variance, recursively call map_one for all of its upstream neurons so the final output contains all input variances visible to the specified neuron... | map_one(inputs, index, which_output) {
const [output_layer, output_index] = this.parse_output(which_output);
// For this input index, loop through input space and compute outputs
const outputs = this.input_space[index].map((x, jj) => {
// this is in-place modification of inputs, but that's ok.
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"map(value, domainMin, domainMax, rangeMin, rangeMax) {\n var self = this;\n return self.__innerP5.map(value, domainMin, domainMax, rangeMin, rangeMax);\n }",
"getOutputs(inputs) {\n\t\tif (inputs.length > this.maxInputCount) {\n\t\t\tthis.maxInputCount = inputs.length;\n\t\t}\n\n\t\tvar outputs ... | [
"0.53366894",
"0.5325792",
"0.5257585",
"0.51579493",
"0.5048216",
"0.5021826",
"0.49883685",
"0.49770057",
"0.48835105",
"0.48815757",
"0.48699567",
"0.48594728",
"0.48535407",
"0.48505044",
"0.48461097",
"0.48233977",
"0.48033142",
"0.47353306",
"0.47224346",
"0.4710165",
"... | 0.5984296 | 0 |
Validate the which_output value and return as a multiassignable array. | parse_output(which_output) {
if (which_output === undefined) {
return [this.network.layers.length - 1, 0];
}
if (typeof(which_output) !== 'object' || which_output.length !== 2) {
throw "Invalid output: require [layer, index]";
}
const [layer, index] = which_output;
if (layer <= 0 ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function addInputOutputToArray(array, input, output) {\n let newArr = [];\n Array.prototype.push.apply(newArr, array);\n if (!array.includes(input)) {\n newArr.push(input);\n }\n if (!array.includes(output)) {\n newArr.push(output);\n }\n retur... | [
"0.5406862",
"0.538181",
"0.536535",
"0.5107754",
"0.5012827",
"0.49865898",
"0.4960075",
"0.495726",
"0.495726",
"0.495726",
"0.49223652",
"0.49149367",
"0.49060202",
"0.49058464",
"0.48818904",
"0.48752588",
"0.48745406",
"0.48724258",
"0.48533022",
"0.48515195",
"0.4843507... | 0.57571465 | 0 |
by callilng movieInfo we will make an api request to omdb and then log the movie data to the console | function movieInfo(movieTitle) {
if (movieTitle == undefined) {
request("http://www.omdbapi.com/?t=mr.nobody&y=&plot=short&apikey=trilogy", function (error, response, body) {
if (!error && response.statusCode === 200) {
var data = JSON.parse(body);
}
logMovie(data);
});
} else {
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function movieInfo(movie) {\n // if no movie is provided, LIRI defaults to 'Mr. Nobody'\n if (movie === undefined) {\n movie = 'Mr Nobody';\n }\n\n else {\n \tmovie = songOrMovie;\n }\n\n var urlHit = \"http://www.omdbapi.com/?t=\" + movie+ \"&y=&plot=full&tomatoes=true&r=json\";\n\n request(urlHit,... | [
"0.8390075",
"0.8263075",
"0.82014894",
"0.8164063",
"0.8111818",
"0.8089923",
"0.80342007",
"0.7959896",
"0.7936712",
"0.7933932",
"0.79273117",
"0.7909291",
"0.79001117",
"0.78889674",
"0.7849002",
"0.78457385",
"0.7836403",
"0.78251827",
"0.78080904",
"0.77752894",
"0.7749... | 0.8357374 | 1 |
Update the given directory. | function update(directory, log, callback) {
log.info('Updating %s', directory);
var options = {
cwd: directory,
};
runCommand('git pull', options, log, function(error, result) {
if (error) {
return callback(error);
}
runCommand('npm install', options, log, function(error, result) {
if (error) {
re... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async update(path) {\n await this._updatePath(path);\n\n let parentPath = Path.dirname(path);\n\n try {\n let data = await this.db.get(uuid(parentPath, UUID_NAMESPACE));\n\n // Update parent directory. i.e. we traverse up the tree\n // Fileindexer calls udpate ... | [
"0.6625525",
"0.64756024",
"0.6305949",
"0.6291878",
"0.6115625",
"0.59366065",
"0.59105086",
"0.58825094",
"0.585012",
"0.5838039",
"0.58268756",
"0.5819286",
"0.57517695",
"0.57215",
"0.57215",
"0.57215",
"0.57215",
"0.57215",
"0.57215",
"0.57215",
"0.57215",
"0.57215",
... | 0.6736244 | 0 |
Run a command with the given options. | function runCommand(command, options, log, callback) {
child_process.exec(command, options, function(error, stdout, stderr) {
if (error) {
return callback(command + ': ' + error + ', ' + stderr);
}
log.info(command + ': ' + stdout);
callback(null);
});
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function run() {\n var args = process.argv.slice(2);\n if (args.length === 0) {\n printUsage();\n }\n\n var command = commands[args[0]];\n if (!command) {\n console.error('Command `%s` unrecognized', args[0]);\n printUsage();\n return;\n }\n\n command[0](args, Config.get(__dirname, defaultConfig... | [
"0.6410509",
"0.60393953",
"0.601024",
"0.582175",
"0.58089536",
"0.57369524",
"0.5722997",
"0.5714853",
"0.5712965",
"0.57022107",
"0.5685351",
"0.5668845",
"0.56482196",
"0.56456286",
"0.5645338",
"0.56357276",
"0.5608133",
"0.5585921",
"0.5522891",
"0.5492715",
"0.54622227... | 0.63821274 | 1 |
Clean all paths, get the test modules. Returns a structure with test and app attributes. | function getTestModules(log) {
var start = path.resolve(TEST_DIRECTORY);
for (var cached in require.cache) {
if (cached.contains(start)) {
delete require.cache[cached];
}
}
return {
test: require('../' + TEST_DIRECTORY + '/test.js'),
app: require('../' + TEST_DIRECTORY + '/lib/app.js'),
};
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function packager_test__clean() {\n return del(\n ['test/build/', 'test/node_modules/', 'test/fixtures/*/build/', 'test/fixtures/*/dist/'],\n GLOB_OPTS\n )\n}",
"function loadAllTest() {\n var testPathVar = [];\n for (var p in conf.test) {\n var testObj = [p];\n conf.test[p].forEach(item => {\n ... | [
"0.60485655",
"0.5934317",
"0.54989547",
"0.5352165",
"0.5160836",
"0.5029412",
"0.5019565",
"0.49819937",
"0.49353608",
"0.49240953",
"0.49228176",
"0.48453003",
"0.48318303",
"0.4818516",
"0.48084158",
"0.47805214",
"0.4755074",
"0.47488695",
"0.47448063",
"0.4736136",
"0.4... | 0.6645487 | 0 |
Check if there is any error in load tests. Returns null if everything OK, error otherwise. | function checkLoadTestError(result) {
if (!result) {
return 'Empty load test results';
}
if (!result.totalRequests) {
return 'No total requests in load test';
}
if (result.totalRequests != LOADTEST_REQUESTS) {
return 'Missing requests in load test';
}
if (result.totalErrors) {
return result.totalErrors +... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function loadError () {\n\n }",
"static async checkErrors() {\n await this._checkRPGMakerVersion();\n await this._checkWebStorage();\n }",
"function FrameworkUnitTestFail() {}",
"function failingLoader(callback) {\n setImmediate(function () {\n callback(new Error('load error'));\n... | [
"0.5988983",
"0.5936301",
"0.5633716",
"0.5609441",
"0.5604335",
"0.5380609",
"0.5306888",
"0.5298208",
"0.5280517",
"0.5274335",
"0.5271836",
"0.5259541",
"0.5234391",
"0.52299845",
"0.52173036",
"0.5208754",
"0.5199382",
"0.5192212",
"0.51666653",
"0.51617485",
"0.51617485"... | 0.7084058 | 0 |
var count = 1; console.log(count); } sample1(); 2 | function sample2() {
console.log(count);
var count = 1;
return count;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function sample5() {\n console.log(num);\n num++\n console.log(num);\n}",
"function awe() {\n console.count();\n}",
"function counter(count) {\n // ...\n}",
"function count() {\n\tcounter++;\n\tconsole.log(\"count\", counter);\n\t// can add other functions within this function\n\t// doThis()\n\t// doT... | [
"0.72302884",
"0.7210056",
"0.71330875",
"0.7042869",
"0.6981132",
"0.6980598",
"0.68595755",
"0.6834861",
"0.6822018",
"0.680903",
"0.6684858",
"0.6682833",
"0.667322",
"0.66670513",
"0.6664402",
"0.66417843",
"0.6602226",
"0.6596956",
"0.6574348",
"0.6554732",
"0.6531435",
... | 0.8837525 | 0 |
Places constructor. Handles searching for places based on a search query. | function Places() {
var mMap = null;
var mPlacesService = null;
var mPlaces = [];
var mAllPlaces = null;
var mSearchRadius = 10000;//in meters
var mSearchQuery = null;
var mDirection = {
north: "north",
south: "south",
east: "east",
west: "west"
};
/**... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function searchBoxPlaces(searchBox) {\n hideMarkers(placeMarkers);\n this.places = searchBox.getPlaces();\n if (places.length == 0) {\n window.alert('We did not find any places matching that search!');\n } else {\n // For each place, get the icon, name and location\n createMarkersForPlaces(places);\n ... | [
"0.745258",
"0.7365846",
"0.68853426",
"0.67902434",
"0.6673292",
"0.6540086",
"0.651286",
"0.64745915",
"0.6448128",
"0.642423",
"0.64004356",
"0.63788176",
"0.63648254",
"0.63281614",
"0.6277917",
"0.62450784",
"0.61957335",
"0.61942655",
"0.61530244",
"0.6149057",
"0.60665... | 0.73964345 | 1 |
Populate the map with the places | function populateMap(direction, places) {
places = filterByDirection(direction, places);
for (var i in places) {
var filteredPlace = places[i];
createMarker(filteredPlace, mLocation);
}
if (places.length == 0) {
showNoPlaces(mSearchQuery);
} e... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function populateMap(places) {\n for (var i in places) {\n\t\t// if place does not have lat/lng, geocode\n\t\tif (!places[i].Lat && !places[i].Lng) {\n\t\t\tvar geocode_options = {\n\t\t\t\ttype: \"update\",\n\t\t\t\tdata: places[i]\n\t\t\t};\n\t\t\tvar query_string = places[i].Street + ' ' + places[i].City + '... | [
"0.78109545",
"0.7455181",
"0.7364909",
"0.7203482",
"0.70657796",
"0.7038658",
"0.69189143",
"0.69075036",
"0.69027233",
"0.6895336",
"0.6867825",
"0.6810789",
"0.6799364",
"0.6741451",
"0.6720386",
"0.6705135",
"0.6691979",
"0.66914725",
"0.6690782",
"0.6675349",
"0.6655146... | 0.7462339 | 1 |
Finds the closest place to current location and sets the map bounds to include both | function setClosest(places) {
var closestIndex = 0;
var closest;
for (var i in places) {
var place = places[i].geometry.location;
var lat = Math.pow(place.lat() - mLocation.lat ,2);
var lng = Math.pow(place.lng() - mLocation.lng ,2);
var distance ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getClosestRes(current_loc, resource_map)\n{\n\tconst map_length = resource_map.length;\n\tvar closest_location = null;\n\tvar closest_dist = 1000;\n\n\tfor (let y = 0; y < map_length; y++){\n\t for (let x = 0; x < map_length; x++){\n if (resource_map[y][x] && square_distance({x,y}, current_loc... | [
"0.6352829",
"0.61042726",
"0.6074566",
"0.60716033",
"0.5993378",
"0.59268934",
"0.588095",
"0.58227766",
"0.58205044",
"0.5786804",
"0.5764396",
"0.57598144",
"0.5725558",
"0.57165873",
"0.57163894",
"0.56958485",
"0.5685544",
"0.5680115",
"0.5678667",
"0.5675832",
"0.56730... | 0.75128376 | 0 |
Parse the response from the places api | function parseResponse(results, status) {
//console.log("Got response", results);
if (status == google.maps.places.PlacesServiceStatus.OK) {
for (var i in results) {
var placeResult = results[i];//PlaceResult objects
if (placeResult.name == mSearchQuery) {
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getPlacesAPI() {\n client.getPlaceSearch('Michigan').then(function (response) {\n var places = response.getPlaces();\n for (var i = 0, len = places.length; i < len; i++) {\n var place = places[i];\n output('Place', {\n original:... | [
"0.6711284",
"0.6410852",
"0.63851964",
"0.63242793",
"0.62458605",
"0.61753243",
"0.6112863",
"0.5992871",
"0.5992064",
"0.59659123",
"0.5951453",
"0.5939304",
"0.593314",
"0.58905184",
"0.5871265",
"0.58619463",
"0.58113813",
"0.5810944",
"0.58058554",
"0.57967025",
"0.5758... | 0.71309185 | 0 |
return number(9/5) define a function getFahrenheit(celsius) | function getFahrenheit(celsius) {
return (multiplyByNineFifths(celsius) + 32);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function convertToF(celsius){\n let fahrenheit = celsius * 9/5 + 32\n return fahrenheit\n}",
"function convertToFahrenheit(celsius) {\n let fahrenheit = celsius * 9/5 + 32\n\n return fahrenheit;\n}",
"function celsiusToFahrenheit(celsius) {\n let fahrenheit = (celsius * (9 / 5)) + 32\n return fah... | [
"0.8742633",
"0.87021947",
"0.86716104",
"0.86709046",
"0.86437225",
"0.85993695",
"0.8586371",
"0.8573183",
"0.8570293",
"0.84927315",
"0.848597",
"0.8480452",
"0.8475587",
"0.84683204",
"0.8462132",
"0.8408042",
"0.8397261",
"0.8384812",
"0.8363606",
"0.83202153",
"0.831118... | 0.9047475 | 0 |
Function to collect the list of images | function collectImages(list){
return new Promise(function(resolve, reject){
var imageCollection = [];
list.forEach(function (url, index){
getImage(url).then(function(image){
image.url = url;
imageCollection.push(image);
if (imageColl... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function collect_images(images){\n\tdebugger;\n\timagestrings = ''\n\timage_elements = Array.from(images)\n\t$.each(image_elements,function(key,value){\n\t\timagestrings += '<div class=\"class=\" carousel carousel-item\"\"><img class=\"mr-100\" src=\"'+value.src+'\"\" alt=\"Italian Trulli\"></div>'\n\t})\n\n\tretu... | [
"0.7604249",
"0.7340113",
"0.72996783",
"0.71830016",
"0.71516436",
"0.70481277",
"0.70096004",
"0.6990702",
"0.69486517",
"0.69313496",
"0.6927129",
"0.6918559",
"0.69081426",
"0.689637",
"0.6896091",
"0.6892038",
"0.6853525",
"0.68481225",
"0.684158",
"0.6802548",
"0.678939... | 0.76121145 | 0 |
The 'passLatLong()' function gets the geocoordinates of the clicked area in the map and passes this coordinates to the 'getWeatherStat()' function to get the 'onwater' and 'weather' status of location via an API | function passLatLong() {
var currentLat = document.getElementById("lat").value;
var currentLong = document.getElementById("long").value;
if (currentLat.length != 0 || currentLong.length != 0) {
//weather api reqest
getWeatherStat(currentLat, currentLong)
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getWeather(lat, long) {\n const root = \"https://fcc-weather-api.glitch.me/api/current?\";\n fetch(`${root}lat=${lat}&lon=${long}`, { method: \"get\" })\n .then(resp => resp.json())\n .then(data => {\n updateDataToUI(data.name, data.weather, data.main.temp);\n })\n .catch(function(err) {\n ... | [
"0.6290499",
"0.6066082",
"0.6032827",
"0.60148627",
"0.598162",
"0.5871799",
"0.57804227",
"0.57408166",
"0.57345295",
"0.56982386",
"0.56867963",
"0.56752807",
"0.5675015",
"0.5665849",
"0.56478167",
"0.5645835",
"0.5639328",
"0.5634502",
"0.56323695",
"0.5622272",
"0.56031... | 0.69638765 | 0 |
The 'getWeatherStat(args)' function sends request to two endpoints It sends a request to 'api.onwater.io' to check if coordinates are on water or on land, the feedback of this resquest is a json object. Given that wild fire does not occur on water bodies, if the 'water' key of the json object is 'true' it reutrns a war... | async function getWeatherStat(lat, long) {
//checks if coordinates of location is water or land
var onWater_API_KEY = "UFVBXbyPrStt_o2Ed6Wg";
var onWater_API_endpoint = `https://api.onwater.io/api/v1/results/${lat},${long}?access_token=${onWater_API_KEY}`;
var onWater_API_response = await fetch(onWater_... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getWeatherReport(lat, lon)\n\t{\n\t\tvar coordinates = lat + \",\"+ lon;\n\t\t$.ajax({\n\t\t\turl: \"http://api.wunderground.com/api/\"+apiKey+\"/conditions/q/\"+coordinates+\".json\",\n\t\t\tdataType: \"jsonp\"\n\t\t})\n\t\t.done(function(data)\n\t\t{\n\t\t\tpopulateWeather(data);\n\t\t})\n\t\t.fail(func... | [
"0.62746537",
"0.62507695",
"0.61624736",
"0.61514306",
"0.60969627",
"0.60846776",
"0.6057097",
"0.60531974",
"0.60414374",
"0.6035673",
"0.6026442",
"0.60136664",
"0.6001324",
"0.5964493",
"0.59509706",
"0.5924561",
"0.5920584",
"0.5918964",
"0.59049803",
"0.5889423",
"0.58... | 0.6467451 | 0 |
The 'queryModel(args) function takes in 'latitude', 'longitude' and 'weather_data' as arguments to be used as features for the machine learning model which will be used to make predictions. The machine learning model is hosted on a seperate domain and served on a flask server. The fuction sends a request to the model d... | async function queryModel(lat, long, weather_data) {
//get prediction from the Machine Learning Model
var m_l_model_API_endpoint = `http://127.0.0.1:5000/get_BT?lat=${lat}&long=${long}`;
var response = await fetch(m_l_model_API_endpoint);
var ml_data = await response.json();
var prediction = ml_data... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async execute(request_model) {\n // 2. validation\n let validation_result = this.validator.validate(request_model);\n if(!validation_result.isValid) {\n const response_model = new ResponseModel(null,\n validation_result.error_msg);\n return response_model;\... | [
"0.59321856",
"0.56905955",
"0.5600542",
"0.55951893",
"0.553793",
"0.54799575",
"0.5449967",
"0.5442395",
"0.5407859",
"0.5402154",
"0.5377464",
"0.5373946",
"0.5333708",
"0.53242624",
"0.5292384",
"0.5238015",
"0.52117336",
"0.5208556",
"0.51933223",
"0.51821226",
"0.517558... | 0.7351385 | 0 |
colorIntensityBarClass(arg) takes in the prediction of the model as parameter, this function assigns color specific features to intensity bar based on the percentile it falls under and returns a string which will be used as style class for the bar HTML. | function colorIntensityBarClass(prediction) {
if (prediction >= 0 && prediction <= 25) {
return "first-percentile";
} else if (prediction >= 26 && prediction <= 50) {
return "second-percentile";
} else if (prediction >= 51 && prediction <= 75) {
return "third-percentile";
} else ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function determineClassColor(rank) {\n if (rank <= 10) {\n return 'legendary';\n }\n if (rank <= 100) {\n return 'epic';\n }\n if (rank <= 250) {\n return 'rare';\n }\n if (rank == '-') {\n return 'default'\n }\n ... | [
"0.53911227",
"0.53310823",
"0.5311209",
"0.5208771",
"0.5010328",
"0.4962259",
"0.49400848",
"0.49301514",
"0.49188513",
"0.49188513",
"0.49098969",
"0.48902187",
"0.4889143",
"0.4884512",
"0.48843157",
"0.48833266",
"0.483657",
"0.4798487",
"0.47940752",
"0.4764036",
"0.476... | 0.8006205 | 0 |
A middleware that gzip's the response content (see Options may be any of node's zlib options (see | function gzip(app, options) {
return function (conn) {
return conn.call(app).then(function () {
var response = conn.response;
var headers = response.headers;
if (shouldGzipContentType(headers['Content-Type']) && conn.acceptsEncoding('gzip')) {
response.content = response.content.pipe(zl... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function gzip(input,options){options = options || {};options.gzip = true;return deflate(input,options);}",
"function gzip(input,options){options=options||{};options.gzip=true;return deflate(input,options);}",
"function gzip(input,options){options=options||{};options.gzip=true;return deflate$1(input,options);}"... | [
"0.7031204",
"0.69974625",
"0.69009197",
"0.6865284",
"0.68473494",
"0.68473494",
"0.6756717",
"0.67423445",
"0.67423445",
"0.67423445",
"0.67423445",
"0.66819954",
"0.66819954",
"0.66819954",
"0.66819954",
"0.66819954",
"0.66819954",
"0.66819954",
"0.66819954",
"0.66819954",
... | 0.7499715 | 0 |
Function for verifying if the subscription passed in does exist in the list of available subscriptions. | function checkIfSubscriptionExists(subscriptionId, subscriptions) {
var indexOfSubscription = subscriptions.findIndex(function(s) {
return s.id === argsProvided.subscription;
});
if(indexOfSubscription < 0) {
console.error("Requested subscription %s does not exist in list of available subscr... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function checkSubscriptions() {\n let existingSubscriber = false;\n pubsub\n .getSubscriptions()\n .then(results => {\n const subscriptions = results[0];\n\n subscriptions.forEach(resultSubscription => {\n\n// If subscri... | [
"0.8205104",
"0.6882069",
"0.6827004",
"0.66120464",
"0.6433688",
"0.6365971",
"0.6191676",
"0.58050805",
"0.5804957",
"0.57782304",
"0.57659495",
"0.5742542",
"0.573505",
"0.5694016",
"0.5584577",
"0.55486566",
"0.55318666",
"0.55275565",
"0.55013907",
"0.54735714",
"0.54735... | 0.83364064 | 0 |
Function for retrieving a network interface card resource within the selected resource group | async function getNicWithPrivateIp(resourceGroup, privateIp, subscription, credentials) {
var results = [];
console.log("Retrieving network interfaces and searching for interface with IP %s...", privateIp);
var networkClient = new NetworkManagementClient(credentials, subscription);
await networkClient.... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"card() {\n return this.mu.http.get('/card')\n .then(res => this._getRes(res, this._setCard))\n .catch(() => this._setCard(null));\n }",
"function YNetwork_nextNetwork()\n { var resolve = YAPI.resolveFunction(this._className, this._func);\n if(resolve.errorType != YAPI_SUCCESS) return nu... | [
"0.5460743",
"0.4998706",
"0.49802238",
"0.49783885",
"0.49564457",
"0.49551487",
"0.48973247",
"0.48945272",
"0.48617923",
"0.4838552",
"0.4826741",
"0.48257938",
"0.48170254",
"0.47854036",
"0.47720343",
"0.47579908",
"0.47489914",
"0.47263333",
"0.46553928",
"0.46473143",
... | 0.56067955 | 0 |
Query the list of connected devices and figure out how many video inputs we have. | async queryDevices() {
try {
const devices = await navigator.mediaDevices.enumerateDevices();
this.hasMultipleCameras = devices.filter(d => d.kind == 'videoinput').length > 1;
}
catch (e) {
this.onPhoto(e);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function gotDevices(deviceInfos) {\n for (let i = 0; i !== deviceInfos.length; ++i) {\n const deviceInfo = deviceInfos[i];\n if (deviceInfo.kind == \"videoinput\") {\n console.log(deviceInfo);\n }\n }\n}",
"function gotDevices(deviceInfos) {\n for (var i = 0; i !== deviceIn... | [
"0.73366815",
"0.67650694",
"0.6713085",
"0.66119576",
"0.6286157",
"0.6222259",
"0.6210585",
"0.6184479",
"0.61524695",
"0.6048155",
"0.6032897",
"0.6023551",
"0.59623426",
"0.5955786",
"0.5930884",
"0.59194165",
"0.59158266",
"0.59119755",
"0.58330935",
"0.5821757",
"0.5820... | 0.7329445 | 1 |
In TypeScript, import statements that only import types should be removed. This does not count bare imports. | pruneTypeOnlyImports() {
this.nonTypeIdentifiers = _getNonTypeIdentifiers.getNonTypeIdentifiers.call(void 0, this.tokens, this.options);
for (const [path, importInfo] of this.importInfoByPath.entries()) {
if (
importInfo.hasBareImport ||
importInfo.hasStarExport ||
importInfo.expor... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function isImport(t) {\n const sentinel = t.substr(0, 1);\n if (sentinel == \"*\") return true; else return false;\n }",
"function WildcardImport() {\n}",
"function tryConsumeImport() {\n var token = ts.scanner.getToken();\n if (token === 91 /* ImportKeyword */) {\n ... | [
"0.63009095",
"0.6038009",
"0.59639204",
"0.5876748",
"0.5860597",
"0.58578354",
"0.5824881",
"0.5815942",
"0.58119214",
"0.5788588",
"0.5707911",
"0.5690861",
"0.5644841",
"0.5635323",
"0.55925626",
"0.55814177",
"0.5530178",
"0.55082947",
"0.5498708",
"0.54303306",
"0.54301... | 0.79969114 | 0 |
Get a mutable import info object for this path, creating one if it doesn't exist yet. | getImportInfo(path) {
const existingInfo = this.importInfoByPath.get(path);
if (existingInfo) {
return existingInfo;
}
const newInfo = {
defaultNames: [],
wildcardNames: [],
namedImports: [],
namedExports: [],
hasBareImport: false,
exportStarNames: [],
has... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"static $import(...args) {\n\t\treturn importFresh(...args);\n\t}",
"ImportDeclaration(path) { // { opts = {} }\n const { node } = path\n\n const { specifiers, source } = node\n const src = source.value.replace(/\\\\/g, '/')\n\n const shouldInterop = !this.noImportInteropPrefixesRegexp.test(sr... | [
"0.5405409",
"0.53580993",
"0.5101594",
"0.5095188",
"0.50241464",
"0.49796137",
"0.49081662",
"0.49081662",
"0.48918217",
"0.48380178",
"0.4827903",
"0.48051932",
"0.47922125",
"0.47882718",
"0.47809836",
"0.46814156",
"0.46301723",
"0.46280986",
"0.4602462",
"0.45910826",
"... | 0.7777441 | 0 |
Return the code to use for the import for this path, or the empty string if the code has already been "claimed" by a previous import. | claimImportCode(importPath) {
const result = this.importsToReplace.get(importPath);
this.importsToReplace.set(importPath, "");
return result || "";
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"get usedCode() {\n\t\treturn this.__usedCode;\n\t}",
"function getSupplier(code) {\n let pos = code.indexOf(\":\");\n return \"Code: \" + code.substring(0, pos);\n}",
"_loadFilename(path) {\n const module = this._modules[path];\n if (!module) {\n throw new Error('Could not find file \"' + path... | [
"0.5666492",
"0.5595022",
"0.55711764",
"0.5531037",
"0.54395306",
"0.538369",
"0.5237387",
"0.5237387",
"0.5237387",
"0.5237387",
"0.5225279",
"0.5223747",
"0.5223747",
"0.5223747",
"0.5223747",
"0.5223747",
"0.5223747",
"0.5223747",
"0.5223747",
"0.5223747",
"0.5223747",
... | 0.7545108 | 0 |
Return all imported/exported names where we might be interested in whether usages of those names are shadowed. | getGlobalNames() {
return new Set([
...this.identifierReplacements.keys(),
...this.exportBindingsByLocalName.keys(),
]);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"getName() {\n let normalized = this[_normalized];\n let collected = this.getCollected();\n\n let names = collected\n .map(path => {\n let modulePath = null;\n\n if (isModule(path)) {\n modulePath = isModule.resolve(path);\n } else {\n modulePath = pa... | [
"0.58085024",
"0.5762161",
"0.57604784",
"0.5627299",
"0.5591615",
"0.5586721",
"0.55749553",
"0.5528854",
"0.54968154",
"0.546185",
"0.5452245",
"0.54271495",
"0.54214865",
"0.54116595",
"0.5408008",
"0.5406261",
"0.53982365",
"0.5395249",
"0.53846544",
"0.53456515",
"0.5319... | 0.6571022 | 0 |
Represents a class that provides general information about exception | function ExceptionInfo()
{
/**
*Exception message-Gets the exception message for exception
*
* @property message
* @type String
* @default null
*/
this.message=null;
/**
*Class name - Gets base class name where exception occurred.
* @property className
* @type ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function Exception(value) {\n this.name = this.constructor.name;\n this.value = value;\n}",
"function ErrorInfo(message, details) {\n this._message = message;\n this._details = details;\n }",
"function Exception(name, message)\n{\n if (name)\n this.name = name;\n if (message)\n ... | [
"0.676731",
"0.6658838",
"0.6650909",
"0.65461683",
"0.6542784",
"0.6403338",
"0.6401013",
"0.6397152",
"0.63959754",
"0.63010323",
"0.6123037",
"0.60721743",
"0.60667783",
"0.6063012",
"0.6059293",
"0.59822625",
"0.5912526",
"0.5871927",
"0.58336604",
"0.5806142",
"0.5788609... | 0.7867264 | 0 |
Append options 112 to month dropdown | function buildMonthDropdown()
{
var month = 1;
while(month <= 12)
{
$("#month").append("<option>" + month + "</option>");
month+=1; // month++ or month=month+1
}
/*
for(var month=1; month <=12; month++)
{
$("#month").append("<option>" + month + "</option>");
}
*/
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function listmonth(thisMonth){\n\t\tif(document.getElementById(\"month\").childNodes.length > 0) {\n\t\t\tdocument.getElementById(\"month\").innerHTML = '';\n\t\t}\n\t\tfor(i=0;i<=11;i++){\n\t\t\tvar node = document.createElement(\"option\"); // Create a text node\n\t\t\tif(i == thisMonth) {\n\t\t\t\tn... | [
"0.7767013",
"0.7729622",
"0.7701911",
"0.76669127",
"0.75949264",
"0.73804367",
"0.7349092",
"0.72918534",
"0.72904474",
"0.7258864",
"0.724519",
"0.7212921",
"0.71253055",
"0.71124494",
"0.7075934",
"0.7065101",
"0.70422065",
"0.69244057",
"0.6891013",
"0.6885612",
"0.68395... | 0.79168963 | 0 |
Append options 131 to day dropdown | function buildDayDropdown()
{
var day = 1;
while(day <= 31)
{
$("#day").append("<option>" + day + "</option>");
day+=1; // day++ or day=day+1
}
/*
for(var day=1; day <=31; day++)
{
$("#day").append("<option>" + day + "</option>");
}
*/
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function createDayList() {\n const select = document.getElementById(\"daySelect\");\n for (var i = 1; i < days.length; i++) {\n let day = days[i].toUpperCase();\n let listElem = document.createElement(\"option\");\n listElem.innerHTML = day;\n select.appendChild(listElem);\n }\n }",
... | [
"0.7305519",
"0.7294872",
"0.7238241",
"0.71574765",
"0.7086266",
"0.7082504",
"0.70692873",
"0.6944619",
"0.68264216",
"0.67707723",
"0.6717248",
"0.6707641",
"0.67054695",
"0.66542137",
"0.6636537",
"0.6626452",
"0.66105026",
"0.6605625",
"0.65929514",
"0.65861285",
"0.6543... | 0.73789847 | 0 |
Append options to year dropdown Start at current year and go back yearCount of years | function buildYearDropdown(yearCount)
{
var date = new Date();
var startYear = parseInt(date.getFullYear());
for(var year = startYear; year > (startYear-yearCount); year--)
{
$("#year").append("<option>" + year + "</option>");
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function populateYears() {\n // get this year as a number\n var date = new Date();\n var year = date.getFullYear();\n\n var startDateYearSelect = document.querySelector('#startDateYearSelector');\n var endDateYearSelect = document.querySelector('#endDateYearSelector');\n\n // Make this year, and the 100 year... | [
"0.83270586",
"0.8319361",
"0.8269564",
"0.8236596",
"0.8071472",
"0.79194736",
"0.77460575",
"0.77427125",
"0.7730078",
"0.7717232",
"0.77140176",
"0.76920885",
"0.76240426",
"0.751909",
"0.7487481",
"0.7481385",
"0.7443134",
"0.7409308",
"0.7404245",
"0.73977137",
"0.731933... | 0.87113976 | 0 |
When there is an error in fetching the location the location with these coordinates is mocked. | function errorLocation() {
setLongitude(12.9716)
setLatitude(77.5946)
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async setupLocation() {\n\n // Get the cached location info if it exists.\n const locationPath = this.fm.joinPath(this.fm.libraryDirectory(), \"weather-cal-location\")\n const locationExists = this.fm.fileExists(locationPath)\n let cachedLocation\n if (locationExists) {\n cachedLocation = JSON.... | [
"0.61738485",
"0.61600894",
"0.6112936",
"0.6026683",
"0.6020604",
"0.5999465",
"0.5970986",
"0.5960341",
"0.59533685",
"0.59405506",
"0.5934799",
"0.59297156",
"0.59297156",
"0.59297156",
"0.59222376",
"0.59067696",
"0.5834539",
"0.5802843",
"0.5767871",
"0.5759427",
"0.5752... | 0.65599996 | 0 |
Opens extension options page | function openOptionsPage() {
if (browser.runtime.openOptionsPage) {
browser.runtime.openOptionsPage();
} else {
window.open(browser.runtime.getURL('src/options/options.html'));
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function openOptionPage () {\r\n if (chrome.runtime.openOptionsPage) {\r\n chrome.runtime.openOptionsPage();\r\n } else {\r\n window.open(chrome.runtime.getURL('options.html'));\r\n }\r\n }",
"function open_options(openPage)\n{\n // If an open page is set\n if(openPage)\n {\n ... | [
"0.8231009",
"0.7652081",
"0.7221763",
"0.72004706",
"0.69482166",
"0.69436216",
"0.6835738",
"0.6542735",
"0.64942145",
"0.6428408",
"0.6396857",
"0.6379689",
"0.6228447",
"0.6228447",
"0.62234306",
"0.61428624",
"0.6114546",
"0.6114546",
"0.6094955",
"0.6052752",
"0.6016797... | 0.83034605 | 0 |
SINGLE REGISTRATION Functions related to Single Registration ////////////////////// Called upon clicking "single register" link determines if event status will allow registration and takes user to correct page | function EventRegister(eventstatus, eventcd) {
//alert('here!');
if (eventstatus<2){
if (eventstatus==1){
alert('This event is full. If you would like to be placed on a waiting list please select OK to complete the registration form.')
}
if (CUSTOMERCD != ""){
location='../Registerdll.dll/RegistrationFo... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"_handleRegister() {\r\n window.history.pushState({}, null, '#/registration');\r\n window.dispatchEvent(new CustomEvent('location-changed'));\r\n }",
"function check_for_existing_user(event) {\n var sidCookieValue = Get_Cookie('sid');\n if (null == sidCookieValue && true == can_show_registratio... | [
"0.6636574",
"0.6516862",
"0.6506041",
"0.6450125",
"0.6424862",
"0.641133",
"0.6266967",
"0.6198249",
"0.6131234",
"0.6094374",
"0.602696",
"0.60256714",
"0.60007054",
"0.5968278",
"0.5959457",
"0.5939907",
"0.5934246",
"0.5929102",
"0.59106183",
"0.5838238",
"0.58338296",
... | 0.652922 | 1 |
runs search for guests to add | function searchGuests(formName){
if(formName.LASTNAME.value != ''){
formName.LASTNAME.value += '~';
}
if(formName.ORGNAME.value != ''){
formName.ORGNAME.value += '~';
}
formName.submit();
//location.href = "List?EMAIL="+document.resultlist.searchf.value+"&SORT=LASTNAME&RANGE=1/100&WHP=searchHeader.ht... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async function addGuest() {\n const response = await fetch(`${baseUrl}/`, {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json',\n },\n body: JSON.stringify({ firstName: firstName, lastName: lastName }),\n });\n const createdGuest = await response.json();\n co... | [
"0.57966805",
"0.5454134",
"0.54173946",
"0.5294506",
"0.5271477",
"0.52487856",
"0.5196534",
"0.5194409",
"0.51767343",
"0.516786",
"0.5165373",
"0.5159689",
"0.514017",
"0.51118875",
"0.50926334",
"0.5089101",
"0.50865155",
"0.5074114",
"0.5066182",
"0.506386",
"0.5063053",... | 0.59373885 | 0 |
write Tool : textalign | WriteToolAlign(mode){
let list = ["aleft","acenter","aright","afull"];
for(let i = 0; i<4; i++) if(i !== mode && document.querySelector("#write_"+list[i]).classList.contains("active")) document.querySelector("#write_"+list[i]).classList.remove("active");
if(mode == 0) document.execCommand("ju... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function textAlign(style) {\n\t return draw(function () {\n\t if (exports.DEBUG)\n\t console.log(\"textAlign: attach\");\n\t var arg1_next = Parameter.from(style).init();\n\t return function (tick) {\n\t var arg1 = arg1_next(tick.clock);\n\t if (exports.DEBU... | [
"0.69011104",
"0.6707613",
"0.6690124",
"0.66345674",
"0.66007006",
"0.6457768",
"0.6454387",
"0.6369629",
"0.6336485",
"0.63204825",
"0.6295274",
"0.62832135",
"0.6051827",
"0.6014342",
"0.60043347",
"0.59487075",
"0.59483206",
"0.5946672",
"0.5928224",
"0.59267294",
"0.5889... | 0.7252876 | 0 |
You know that a piece of paper has a thickness of 0.0001m Given distance in units of meters, calculate how many times you have to fold the paper to make the paper reach this distance. | function foldTo(distance) {
let thickness = 0.0001;
let folds = 0;
if (distance < 0 || distance === 0) return null;
while (thickness < distance) {
thickness *= 2;
folds++;
}
return folds;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function folds(dist) {\n if (dist < 0) return null;\n var distMeters = dist * 1000;\n var distanceCovered = 0.0001;\n var foldCount = 0;\n while (distanceCovered <= distMeters) {\n foldCount++;\n distanceCovered += distanceCovered;\n // console.log( 'distanceCovered: ', distanceCovered );\n }\n con... | [
"0.7161965",
"0.6974861",
"0.6833396",
"0.60034156",
"0.5984451",
"0.5970853",
"0.58364975",
"0.5818939",
"0.57957023",
"0.5716674",
"0.5637794",
"0.54836684",
"0.5475432",
"0.5465053",
"0.5418567",
"0.5416985",
"0.54153556",
"0.5403025",
"0.53926",
"0.5386724",
"0.536652",
... | 0.76984817 | 0 |
Read the humidity and temperature from the sensor. | function read() {
var readout = sensorLib.read(); //#C
console.log(
"Temperature: " +
readout.temperature.toFixed(2) +
"C, " + //#D
"humidity: " +
readout.humidity.toFixed(2) +
"%"
);
return {
hum: readout.humidity.toFixed(2),
temp: readout... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function read() {\n var readout = dht.read();\n temperature = readout.temperature;\n humidity = readout.humidity;\n io.sockets.emit('tempSensor', {value: temperature}, {value: humidity});\n if (temperature == 30 && !tempSent) {\n sendNotification(notif.tempMsg);\n tempSent = true;\n ... | [
"0.813726",
"0.7063181",
"0.6939931",
"0.69238937",
"0.69105726",
"0.68449616",
"0.6792781",
"0.677675",
"0.6748727",
"0.650288",
"0.6467789",
"0.626296",
"0.6199257",
"0.61587554",
"0.61249864",
"0.6114308",
"0.6057669",
"0.6050717",
"0.6001264",
"0.59841615",
"0.5944339",
... | 0.76261884 | 1 |
Retrieves all teachers list from teacher(TB_Teacher) table | function getTeachers() {
return Teachers.findAll();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"getAllTeachers() {\n return this.dbTeacher;\n }",
"async getTeachers(req, res) {\n AuthService.findAllTeachers()\n .then((users) => {\n res.status(users.status).send({\n status: users.status,\n message: users.message,\n teachers: users.teachers.rows,\n }... | [
"0.76164174",
"0.7215519",
"0.721377",
"0.6843001",
"0.67879736",
"0.6673957",
"0.6436647",
"0.64299285",
"0.6257328",
"0.6133837",
"0.6043864",
"0.5990985",
"0.5872998",
"0.57926846",
"0.5704571",
"0.5668099",
"0.55465484",
"0.5498435",
"0.5434478",
"0.5393864",
"0.52974087"... | 0.7621991 | 0 |
Retrieves teacher details from teacher(TB_Teacher) table, based on id | function getTeacher(id) {
logger.info(EVTC+ `Searching for a teacher based on id:${id}`);
return Teachers.findAll({
where: {
teacherId: id,
},
});
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getTeacherById(id) {\n return teachers.find(t => t.id == id);\n}",
"function getClassByTeacherId(id) {\n return db(\"classes\").where(\"teacherId\", id);\n}",
"function getAllStudentsByTeacherId(id) {\n return db(\"class_learners\").where(\"classId\", id);\n}",
"function details(req, res) {\n ... | [
"0.8383244",
"0.750186",
"0.7309153",
"0.6888408",
"0.66954803",
"0.65749717",
"0.6553275",
"0.6547873",
"0.64522195",
"0.6418607",
"0.6323426",
"0.6321252",
"0.62482655",
"0.6109997",
"0.60440373",
"0.59066206",
"0.5901541",
"0.58016944",
"0.57817745",
"0.5757854",
"0.573645... | 0.8628834 | 0 |
Inserts teacher details in teacher(TB_Teacher) table | function createTeacher(req) {
logger.info(EVTC, 'req.body.id %s', req.body.teacherId);
return Teachers.create({
teacherId: req.body.teacherId,
name: req.body.name,
mailId: req.body.mailId,
},
);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"static async create(req, res) {\n try {\n const { firstName, lastName, patronymic, subjects, institutionId } = req.body\n\n const newTeacher = new TeacherModel({\n firstName,\n lastName,\n patronymic,\n institution: institutionId,\n subjects\n })\n\n consol... | [
"0.6058203",
"0.5955545",
"0.58884895",
"0.5821713",
"0.5775374",
"0.5771385",
"0.5740613",
"0.57391155",
"0.56067544",
"0.5569266",
"0.5504148",
"0.5474843",
"0.54260564",
"0.5363916",
"0.532502",
"0.532197",
"0.52832973",
"0.5215873",
"0.51843125",
"0.5173668",
"0.51676095"... | 0.6845061 | 0 |
Updates teacher details in teacher(TB_Teacher) table, based on id | function updateTeacher(req) {
return Teachers.update({
name: req.body.name,
mailId: req.body.mailId,
},
{ where: {
teacherId: req.body.teacherId,
},
});
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function updateTeacher(req, res) {\n db.query('select * from teacher_details where tch_id = ?', req.body.tch_id, function (err, result) {\n res.render('superAdmin/teacher_update', {details: result, err: ''});\n });\n return 1;\n}",
"editTeacher(values, form, callback) {\n this.props.meteorCall... | [
"0.7418521",
"0.6691292",
"0.6431667",
"0.6416114",
"0.6412392",
"0.6243782",
"0.60240424",
"0.58852595",
"0.57819384",
"0.57672584",
"0.56855506",
"0.56216383",
"0.560403",
"0.5595681",
"0.5488809",
"0.5436637",
"0.53673524",
"0.5354236",
"0.5329139",
"0.53274775",
"0.527052... | 0.7526018 | 0 |
Deletes teacher from teacher(TB_Teacher) table, based on id | function deleteTeacher(teacherId) {
return Teachers.destroy({
where: {
teacherId,
},
});
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function deleteTeacher(teacherId) {\n $.ajax({\n url: 'api/teacher/' + teacherId,\n type: 'DELETE',\n success: function() {\n alert('deleted');\n },\n error: function() {\n alert('not deleted');\n }\n });\... | [
"0.7488472",
"0.6753568",
"0.6438014",
"0.62294114",
"0.6129508",
"0.61243355",
"0.59770525",
"0.59173566",
"0.59082794",
"0.5887688",
"0.5881296",
"0.5841487",
"0.58048165",
"0.5769761",
"0.57502836",
"0.57459885",
"0.57352984",
"0.57349825",
"0.57229483",
"0.5708665",
"0.57... | 0.7977164 | 0 |
Convert a combination of keys separated by + into the corresponding code string. | _keyComboToCodeString(keyCombo) {
// if single "+"
if (keyCombo === '+') {
return keyToCode(keyCombo);
}
return keyCombo
// Convert to string so numbers are supported
.toString()
.split('+')
.map(keyToCode)
// Sort keys for easy comparison
.sort()
.join('... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function codestring(un, k1, k2) {\n\tvar hex2bin = {}, bin2hex = {};\n\tfor (var i=0; i<16; i++) {\n\t\thex2bin[i.toString(16)]=('000'+i.toString(2)).substr(-4);\n\t\tbin2hex[hex2bin[i.toString(16)]]=i.toString(16);}\n\tvar binary = [];\n\tfor (var i=0,len=un.length; i<len; i++)\n\t\tbinary.push(hex2bin[un[i]]);\n... | [
"0.60921806",
"0.5917358",
"0.58295554",
"0.5740338",
"0.55871594",
"0.5561403",
"0.5523541",
"0.5456574",
"0.54444647",
"0.540699",
"0.5384613",
"0.5368111",
"0.5362607",
"0.5355624",
"0.5355624",
"0.5306096",
"0.5306096",
"0.5306096",
"0.5306096",
"0.5306096",
"0.5306096",
... | 0.79441017 | 0 |
Update given task in the given index | function edit(task, index) {
var tasks = getAll();
tasks[index] = task;
save(tasks);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"editTask(index, updatedTask) {\n var tasks = this.state.tasks.slice();\n tasks[index] = updatedTask;\n this.setState({\n tasks\n });\n }",
"function change_task(ind)\n{\n\tindex = parseInt(ind);\n\ttasks[index].change_state();\n\tshow_tasks();\n}",
"updateTask(edit_myName, edit_description, e... | [
"0.74933285",
"0.6986503",
"0.6948366",
"0.6914171",
"0.69127095",
"0.68976563",
"0.68709797",
"0.6677837",
"0.6613926",
"0.65628314",
"0.656047",
"0.6548261",
"0.6545577",
"0.65356266",
"0.644739",
"0.6404049",
"0.6366247",
"0.6350006",
"0.6334181",
"0.6328879",
"0.63186413"... | 0.77490705 | 0 |
Remove a task from storage based on a given index | function remove(index) {
var tasks = getAll();
tasks.splice(index, 1);
save(tasks);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"deleteTask(index) {\n this.tasks.splice(index, 1);\n this.#updateIndexes();\n }",
"function delete_task(index) {\n /*return if no index or index item doesn't exist*/\n if (index === undefined || !task_list[index]) return;\n\n delete task_list[index];\n update_ta... | [
"0.82939726",
"0.78028286",
"0.77590525",
"0.77223843",
"0.74715096",
"0.74625933",
"0.7445781",
"0.7434936",
"0.7362989",
"0.7292631",
"0.728049",
"0.72735935",
"0.7242878",
"0.72371906",
"0.7216037",
"0.7207696",
"0.7204754",
"0.6984024",
"0.6978268",
"0.6899612",
"0.689846... | 0.7851018 | 1 |
Drawing the point on the canvas based on the coordinates and the label | drawDataPoint() {
stroke(255);
this.label == 1 ? fill(0) : fill(255);
const pX = this.getPixelXCoordinate();
const pY = this.getPixelYCoordinate();
ellipse(pX, pY, 15, 15);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function drawCoordinates(x, y){\n context.fillStyle = pointColor;\n context.beginPath();\n context.arc(x, y, pointSize, 0, Math.PI * 2, true);\n context.fill();\n drawLabel(x, y);\n }",
"draw() {\n stroke(255);\n point(this.x, this.y);\n }",
"_drawLabelAtWorldSpaceP... | [
"0.7569232",
"0.7147095",
"0.6927152",
"0.6808925",
"0.6768866",
"0.6752727",
"0.66527677",
"0.6607222",
"0.6592547",
"0.6574835",
"0.6502483",
"0.6489974",
"0.64874303",
"0.64789087",
"0.6469201",
"0.6460677",
"0.64596057",
"0.6442937",
"0.6430741",
"0.64255404",
"0.6415468"... | 0.71633106 | 1 |
wrapper to send data to FireBase | function firebaseSend(signalingID, key, data) {
signalingIDRef.child(signalingID).child(key).set(data);
console.log('firebaseSend - ' + key + ' - ' + data);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function sendFirebase() {\n // Make an object with data in it\n var data = {\n name: nameInput.value(),\n adjective: adjectiveInput.value(),\n }\n\n var madlibs = database.ref('madlibs');\n var madlib = madlibs.push(data, finished);\n console.log(\"Firebase generated key: \" + madlib.key);\n\n // Relo... | [
"0.6463548",
"0.6419702",
"0.6374471",
"0.63068736",
"0.6247966",
"0.62283033",
"0.61701703",
"0.6135059",
"0.6126286",
"0.59686744",
"0.595164",
"0.59094787",
"0.5908519",
"0.5884042",
"0.5877899",
"0.5861786",
"0.58533055",
"0.58514374",
"0.58498406",
"0.58480966",
"0.58319... | 0.6650616 | 0 |
wrapper function to receive data from FireBase with callback function | function firebaseReceive(signalingID, type, cb) {
signalingIDRef.child(signalingID).child(type).on("value", function(snapshot, key) {
var data = snapshot.val();
if (data) {
cb(data);
console.log('firebaseReceive - ' + type + ' - ' + data);
}
});
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getDataFromFirebase(){\n\n\n\t}",
"fetchNotes(callback) {\n this.database.ref('notes').on('value', (snapshot) => {\n const newNoteState = snapshot.val();\n callback(newNoteState);\n });\n }",
"static getplayerInfo(){\r\nvar playerInforef=db.ref(\"players\");\r\nplayerInforef.on(\"val... | [
"0.70689625",
"0.6368075",
"0.63329685",
"0.62530726",
"0.6184397",
"0.61711514",
"0.6164811",
"0.61457217",
"0.6141235",
"0.61378",
"0.6132173",
"0.61295784",
"0.61071163",
"0.6100997",
"0.6078667",
"0.6048628",
"0.60290635",
"0.60218966",
"0.6016366",
"0.6014049",
"0.600971... | 0.6628721 | 1 |
run npm read parameters and create datachannels | function npmStart() {
// chef if parameters are correct
if (!parametersValidate()) {
return;
}
// parse parameters
parametersParse();
var npmChannelLabels = [];
npmChannelLabels.push('timestamp');
for (var label in parameters) {
console.log('netPerfMeter - send');
if (parameters.hasOwnProperty(label)) ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function DataChannelInit() {\n}",
"function main() {\n var args = process_commandline_args();\n config = load_config_file(args.config);\n\n init();\n\n var channel = construct_channel_name(args);\n var metric_prefix = construct_statsd_metric_prefix(config);\n\n stats_timeout_id = setTimeout(send_su... | [
"0.58961296",
"0.5886858",
"0.582377",
"0.57622325",
"0.5588188",
"0.5534414",
"0.54737914",
"0.5470011",
"0.54082924",
"0.5370675",
"0.53692544",
"0.52436703",
"0.5193361",
"0.51891714",
"0.51282984",
"0.5111799",
"0.5106918",
"0.5103201",
"0.50982267",
"0.50712603",
"0.5070... | 0.62189233 | 0 |
reset npm for next benchmark | function npmReset() {
for (var label in channels) {
if (channels.hasOwnProperty(label)) {
if (label != 'control') {
delete channels[label];
}
}
}
for (var label in parameters) {
if (parameters.hasOwnProperty(label)) {
if (label != 'control') {
delete parameters[label];
}
}
}
channelSt... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function reset() {\n delete require.cache[\n require.resolve('../../../app/scripts/coalescence/bloom-filter')\n ];\n bloom = require('../../../app/scripts/coalescence/bloom-filter');\n}",
"function resetCjs() {\n module = undefined;\n exports = undefined;\n process = undefined;\n }",
"disableBe... | [
"0.5771716",
"0.5684221",
"0.56439036",
"0.5618517",
"0.56027687",
"0.5600023",
"0.54440355",
"0.54210114",
"0.5390348",
"0.5370442",
"0.53356653",
"0.53313994",
"0.5326122",
"0.5309121",
"0.529612",
"0.52730095",
"0.5224117",
"0.52145404",
"0.52088076",
"0.51999843",
"0.5199... | 0.65892446 | 0 |
clone the first row from dc parameters and append it after the last row | function parametersRowAdd() {
npmcDcCounter++;
var cloneRow = $('.npmChannelParametersBlank').clone();
cloneRow.removeClass('npmChannelParametersBlank');
cloneRow.show();
cloneRow.find('[name=toggleActive]').val('o' + npmcDcCounter);
cloneRow.find('[name=toggleActive]').html(npmcDcCounter);
$('#npmChannelParamet... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function addtoArray() {\n\t\t\t\t\t\t//console.info(\"getRowCount\" + self.backendApi.getRowCount());\n\t\t\t\t\t\tself.backendApi.eachDataRow(function (rownum, row) {\n\t\t\t\t\t\t\t//console.info(\"rownum \" + rownum);\n\t\t\t\t\t\t\tlastrow = rownum;\n\t\t\t\t\t\t\t//do something with the row..\n\n\t\t\t\t\t\t}... | [
"0.5267328",
"0.52540594",
"0.51787525",
"0.5081657",
"0.5053535",
"0.49819237",
"0.49787644",
"0.49409994",
"0.49087143",
"0.4889639",
"0.487253",
"0.48572618",
"0.4850829",
"0.4850829",
"0.4850829",
"0.48231968",
"0.48115635",
"0.47968164",
"0.47903213",
"0.47852784",
"0.47... | 0.63199705 | 0 |
read parameters from table and save in parameters object | function parametersParse() {
$('#npmChannelParameters > tbody > tr').each(function() {
parameters[$(this).find('button[name="toggleActive"]').val()] = {
active: $(this).find('button[name="toggleActive"]').hasClass("btn-success"),
label: $(this).find('button[name="toggleActive"]').val(),
pktSize: $(this).fin... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function prepareParameters() {\t\n\tvar i = 0;\n\t// Override defaults with parameters from the URL\n\tgConfig.maxRecords = $.request.parameters.get(\"maxrecs\") || gConfig.maxRecords;\t\n\tgConfig.minDelayMS = $.request.parameters.get(\"mindelayms\") || gConfig.minDelayMS;\n\tgConfig.serviceProvider = $.request.p... | [
"0.57642776",
"0.565886",
"0.564554",
"0.564373",
"0.55277413",
"0.5514396",
"0.54943275",
"0.53948987",
"0.53619665",
"0.5342488",
"0.5310099",
"0.52956533",
"0.5282041",
"0.52358586",
"0.52263916",
"0.5204482",
"0.51998466",
"0.51505536",
"0.51188326",
"0.50505346",
"0.5028... | 0.57152075 | 1 |
bind the channel events | function bindEvents(channel) {
channel.onopen = function() {
// datachannel openend on offerer-side
if (role == 'offerer') {
if (channel.label == "control") {
$('#npmRun').prop('disabled', false);
} else {
$('#npmRun').prop('disabled', true);
// start netperfmeter after defined delay
setTim... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function bindPusherEvents() {\n var pusher = new Pusher('bf3b73f9a228dfef0913');\n var channel = pusher.subscribe(divvy.channel);\n\n channel.bind('commentWasDeleted', commentWasDeleted);\n channel.bind('commentWasLeft', commentWasLeft);\n channel.bind('commentWasModified', comme... | [
"0.7148425",
"0.68126625",
"0.68126625",
"0.6790425",
"0.6712672",
"0.67033064",
"0.66386676",
"0.66183704",
"0.64688814",
"0.6438049",
"0.6428011",
"0.63679796",
"0.6356154",
"0.6334059",
"0.6271202",
"0.6271202",
"0.61846185",
"0.6163318",
"0.6126054",
"0.6113705",
"0.60876... | 0.7454268 | 0 |
handle incoming json messages on controlchannel and deliver to specific function | function msgHandleJson(message) {
var messageObject = JSON.parse(message);
var tempChannelLabel = messageObject.label;
switch (messageObject.type) {
// statistics
case 'statistics':
break;
// timestamp - echo timestamp to sender
case 'timestamp':
msgHandlePing(messageObject);
break;
// times... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"messageHandler(event) {\n var jsonMessage = JSON.parse(event.data);\n switch (jsonMessage.Key){\n case \"Init\":\n console.log(\"[TripCo] Init Reply\");\n this.initiateWebPage(jsonMessage);\n break;\n case \"Contient\":\n this.updateCountry(jsonMessage);\n break;\... | [
"0.7177715",
"0.69313514",
"0.6734394",
"0.66472954",
"0.66233176",
"0.6568217",
"0.64484596",
"0.64451104",
"0.64421856",
"0.6429074",
"0.63839793",
"0.63782394",
"0.63543403",
"0.63121563",
"0.62966216",
"0.6290033",
"0.6266683",
"0.6251706",
"0.623112",
"0.61994183",
"0.61... | 0.72036004 | 0 |
Echo received timestamp to peer | function msgHandlePing(message) {
var timestampEcho = message;
timestampEcho.type = 'timestampEcho';
channels['control'].channel.send(JSON.stringify(timestampEcho));
console.log('handlePing - echo received timestamp to peer: ' + timestampEcho.timestamp);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function msgSendPing() {\n\tvar date = new Date();\n\ttimestampMessage = {\n\t\ttype: 'timestamp',\n\t\ttimestamp: date.getTime(),\n\t};\n\tchannels['control'].channel.send(JSON.stringify(timestampMessage));\n\tconsole.log('ping - sending timestamp to peer: ' + timestampMessage.timestamp);\n}",
"function sendTim... | [
"0.70819056",
"0.65656006",
"0.65656006",
"0.645199",
"0.6426506",
"0.6150764",
"0.61339605",
"0.5998745",
"0.5986613",
"0.58830345",
"0.5845164",
"0.584261",
"0.5660745",
"0.5658727",
"0.5570399",
"0.5555932",
"0.5535913",
"0.55204725",
"0.5517755",
"0.5496663",
"0.5485844",... | 0.6842296 | 1 |
Send a message to peer with local timestamp | function msgSendPing() {
var date = new Date();
timestampMessage = {
type: 'timestamp',
timestamp: date.getTime(),
};
channels['control'].channel.send(JSON.stringify(timestampMessage));
console.log('ping - sending timestamp to peer: ' + timestampMessage.timestamp);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"sendMessage(user, message, ts) {\n const message = {\n user: user,\n content: message,\n timestamp: ts\n }\n socket.emit('client:message', message);\n return message;\n }",
"function sendTime() {\n io.emit('time', { time: new Date().toJSON() });\n}",
"function sendTime() {\n i... | [
"0.6786881",
"0.6576454",
"0.6576454",
"0.6436114",
"0.6401485",
"0.63991004",
"0.6344893",
"0.63358104",
"0.63073945",
"0.6217116",
"0.61389875",
"0.61013466",
"0.6075879",
"0.6068645",
"0.6056664",
"0.60545623",
"0.604644",
"0.6037568",
"0.6030807",
"0.60303944",
"0.6018361... | 0.7909645 | 0 |
update the PeerConnectionStatus Table | function statsPcStatusUpdate(event) {
$('#signalingState').html(pc.signalingState);
$('#iceConnectionState').html(pc.iceConnectionState);
$('#iceGatheringState').html(pc.iceGatheringState);
console.log('PeerConnection - Change signaling state:' + pc.signalingState);
return true;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function statusUpdate() {\n\tauroraAPI.getInfo()\n\t\t.then(function(info) {\n\t\t\tStartPollingTimer();\n\t\t\t// update States\n\t\t\twriteStates(JSON.parse(info));\n\t\t})\n\t\t.catch(function(err) {\n\t\t\tStopPollingTimer();\n\t\t\tadapter.unsubscribeStates(\"*\");\t\t\t\t\t\t\t\t// unsubscribe state changes\... | [
"0.6482615",
"0.6263172",
"0.5744188",
"0.57211334",
"0.5683595",
"0.5671616",
"0.56556195",
"0.56288904",
"0.5597564",
"0.5576406",
"0.5570785",
"0.54900295",
"0.54861516",
"0.54796594",
"0.5471118",
"0.5460668",
"0.54183364",
"0.5413639",
"0.54135317",
"0.54112166",
"0.5360... | 0.6322463 | 1 |
Save the channel settings to webstorage | function channelSettingsSave() {
$('#npmChannelParameters > tbody > tr > td > input').each(function() {
$(this).attr('value', $(this).val());
});
//var channelSettingsHTML = $("#npmChannelParameters tbody").html();
localStorage.setItem('npmChannelSettings', $("#npmChannelParameters tbody").html());
localStorage... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function app_savesettingslocally()\n{\n chrome.storage.local.set({\"grblmode\":grblmode},function(){});\n chrome.storage.local.set({\"safez\":safez},function(){});\n chrome.storage.local.set({\"g0feed\":g0feed},function(){});\n chrome.storage.local.set({\"theme\":theme},function(){});\n chrome.storage.local.s... | [
"0.7247088",
"0.72008574",
"0.7145451",
"0.71051717",
"0.7035019",
"0.6955392",
"0.6952996",
"0.6943187",
"0.6926626",
"0.6870621",
"0.6864846",
"0.6788293",
"0.67728555",
"0.6758525",
"0.66921216",
"0.6646833",
"0.6635827",
"0.66352826",
"0.6574572",
"0.65664005",
"0.654479"... | 0.77048415 | 0 |
load channel settings from webstorage | function channelSettingsLoad() {
var channelSettingsHTML = localStorage.getItem('npmChannelSettings');
var localIceFilter = localStorage.getItem('localIceFilter');
if (localIceFilter) {
$("#localIceFilter").val(localIceFilter);
}
if (channelSettingsHTML) {
$("#npmChannelParameters tbody").html(channelSettin... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async function loadSettings() {\n let { settings } = await browser.storage.local.get({ settings: {} })\n settings.version = browser.runtime.getManifest().version\n\n for (let key of Object.keys(settings)) {\n if (settings[key] === undefined) continue\n this.state[key] = settings[key]\n }\n}",
"function... | [
"0.70095414",
"0.65745676",
"0.64947486",
"0.6404856",
"0.6381844",
"0.63154936",
"0.6264191",
"0.6233054",
"0.6225712",
"0.6203884",
"0.6200062",
"0.6153515",
"0.6134969",
"0.6128351",
"0.61016595",
"0.60822785",
"0.6066265",
"0.6029489",
"0.59949356",
"0.59943074",
"0.59573... | 0.7288238 | 0 |
this function starts the close sequence and should be called from the panel close button using ebCommand. Example: fscommand("ebCommand", "customClosePanel()"); | function customClosePanel()
{
try
{
if(SKParamsObj.currentStatus != "Closing")
{
SKParamsObj.currentStatus = "Closing";
SKParamsObj.distanceToScroll = SKParamsObj.expandedScrollWidth - SKParamsObj.originalScrollWidth;
if(SKParamsObj.distanceToScroll > 0) // check if any scroll is neccesary
{
gEbDb... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function EZclose(commandStatus)\n{\n\tEZsavePrefs();\n\tEZcommandStatus(commandStatus)\n\twindow.close();\n}",
"function EZclose(commandStatus)\n{\n\tEZsavePrefs();\n\tEZcommandStatus(commandStatus)\n\twindow.close();\n}",
"closeAll(event){this._openPanels.forEach(panel=>{panel.dispatchNodeEvent(new NodeEvent(... | [
"0.67817354",
"0.67817354",
"0.6724443",
"0.67180556",
"0.6606972",
"0.6575819",
"0.6556983",
"0.65494573",
"0.6516429",
"0.6457734",
"0.6447372",
"0.64291734",
"0.6400646",
"0.6363141",
"0.6358426",
"0.6345437",
"0.6308178",
"0.6260473",
"0.62261575",
"0.62047154",
"0.618958... | 0.7335856 | 0 |
draw.fillRect(unit,unit,unit,unit); draw.fillRect(unit,unit,unit,unit); draw.fillRect(unit,unit,unit,unit); draw.fillRect(unit,unit,unit,unit); draw.fillRect(unit,unit,unit,unit); draw.fillRect(unit,unit,unit,unit); draw.fillRect(unit,unit,unit,unit); draw.fillRect(unit,unit,unit,unit); draw.fillRect(unit,unit,unit,uni... | function drawCharmander(){
draw.fillStyle = 'black';
draw.fillRect(0*unit,4*unit,1*unit,3*unit);
draw.fillRect(1*unit,2*unit,1*unit,2*unit);
draw.fillRect(2*unit,1*unit,1*unit,1*unit);
draw.fillRect(3*unit,0*unit,1*unit,1*unit);
draw.fillRect(4*unit,1*unit,1*unit,3*unit);
draw.fillRect(5*uni... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function draw() {\n // we draw a lot of rectangle\n for (i = 0; i <= 32; ++i) {\n for (j = 0; j < 15; ++j) {\n // set Fill color\n fill(((i * 5 + j * 15 + frameCount) % 255));\n rect(i * 20 + 2, j * 20 + 2,15,15); \n }\n }\n}",
"function t(t,e,n,o,l,i){t.fillStyle=e,t.fillRect(n,o,l,i)}",
"func... | [
"0.715063",
"0.70147634",
"0.7000736",
"0.68596894",
"0.68509096",
"0.67935693",
"0.6790123",
"0.6784399",
"0.6752983",
"0.6721171",
"0.67149365",
"0.6712293",
"0.6678932",
"0.66645736",
"0.6657621",
"0.66426194",
"0.6641885",
"0.6614369",
"0.6605041",
"0.6586445",
"0.6585855... | 0.8063491 | 0 |
validates the special characters for quick search | function validateQuickSearchInput(){
var iChars = ":~^&(){\"}][~";
for (var i = 0; i < document.forms[0].searchterm.value.length; i++) {
if (iChars.indexOf(document.forms[0].searchterm.value.charAt(i)) != -1) {
//alert("in the condition");
return false;
}
}
return true;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function validateSpecialCharsAdvancedSearch(inputStr)\r\n\t{\r\n\r\n \r\n \r\n\t\tvar iChars = \":~^&(){\\\"}][~\";\r\n\t\tif(inputStr!=\"\" && inputStr != null)\r\n\t\t\t{\r\n\t\t\t\r\n\r\n\t\tfor (var i = 0; i < inputStr.length; i++) {\r\n\t\t\t\r\n\t\t\tif (iChars.indexOf(inputStr.charAt(i))... | [
"0.7966708",
"0.72323024",
"0.72088915",
"0.71911204",
"0.71013004",
"0.69851387",
"0.69768775",
"0.6932074",
"0.6909502",
"0.6895801",
"0.6754107",
"0.67528266",
"0.6743859",
"0.67249334",
"0.66961545",
"0.66811985",
"0.6677012",
"0.66645193",
"0.66365427",
"0.6613006",
"0.6... | 0.7607425 | 1 |
validates the special characters for advanced search | function validateSpecialCharsAdvancedSearch(inputStr)
{
var iChars = ":~^&(){\"}][~";
if(inputStr!="" && inputStr != null)
{
for (var i = 0; i < inputStr.length; i++) {
if (iChars.indexOf(inputStr.charAt(i)) != -1) {
return false;
}
}
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function validateQuickSearchInput(){\r\n\r\n\r\n\tvar iChars = \":~^&(){\\\"}][~\";\r\n\r\n\tfor (var i = 0; i < document.forms[0].searchterm.value.length; i++) {\r\n\t\tif (iChars.indexOf(document.forms[0].searchterm.value.charAt(i)) != -1) {\r\n\t\t\t//alert(\"in the condition\");\r\n\t\t\r\n\t\treturn false;\r\... | [
"0.72544485",
"0.6917645",
"0.6813726",
"0.6808517",
"0.6780252",
"0.6719838",
"0.67051536",
"0.6702241",
"0.6701911",
"0.6556212",
"0.64954627",
"0.64921105",
"0.6436045",
"0.6432445",
"0.6424372",
"0.64222246",
"0.6419989",
"0.6373752",
"0.6355818",
"0.6346959",
"0.6323374"... | 0.8039195 | 0 |
to check the advance search all advanced search fields are empty or not | function hasEmptyFields()
{
if(
document.forms['KualiForm'].mainEntryPersonalNameComposite.value==""
&&document.forms['KualiForm'].modifyingAgency.value==""
&&document.forms['KualiForm'].name.value==""
&&document.forms['KualiForm'].fullerFormName.value==""
&&document.forms['KualiForm'].dateAssociatedWith... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function areFieldsEmpty () {\n if (titleFormField.value.length == 0 || authorFormField.value.length == 0 || pagesFormField.value.length == 0) {\n alert(\"Please fill in all fields.\")\n } else {\n return true;\n }\n}",
"function isAllFilled() {\n if (isEmpty('descricao') || isEmpty('cod... | [
"0.66317713",
"0.630317",
"0.6278427",
"0.6270323",
"0.62075543",
"0.6203372",
"0.6201025",
"0.61825436",
"0.61441916",
"0.61382437",
"0.6135971",
"0.6133642",
"0.6077284",
"0.6076535",
"0.6071903",
"0.6023732",
"0.6008992",
"0.5978055",
"0.5977191",
"0.5960809",
"0.5936057",... | 0.6746693 | 0 |
store the given start date in localStorage. the key were created by concatinate the global current_work_item_data_key with the id of given issue. | function storeCurrentWork(startDate, issue) {
console.log("storeCurrentWork");
localStorage.setItem(buildCurrentWorkItemId(issue), startDate.toUTCString());
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function setStartTime() {\n let startTime = new Date().getTime();\n localStorage.setItem(\"startTime\", JSON.stringify(startTime));\n }",
"store() {\n /* var n = window.localStorage.length;\n while (window.localStorage.getItem(n.toString()) !== null) {\n n += 1;\n ... | [
"0.66808194",
"0.65489453",
"0.5806393",
"0.5788114",
"0.57519925",
"0.5750272",
"0.57113534",
"0.56592417",
"0.5653701",
"0.56372094",
"0.5524879",
"0.5518552",
"0.5510395",
"0.5510395",
"0.5502636",
"0.5501547",
"0.5486077",
"0.54794806",
"0.5478951",
"0.54371786",
"0.53844... | 0.7995984 | 0 |
Write a function that accepts an array of grades (numerical values) and returns the average. The returned average should also be rounded to the nearest unit. (no decimals, please!) Edit only the code between the lines (below) | function calculateAverage(grades) {
let average = 0;
grades.forEach((grade) => {
average += grade;
});
return Number((average / grades.length).toFixed(0));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function calculateAverage(grades) {\n let sum = grades.reduce(function (sum, grade) {\n return sum + grade;\n }, 0);\n\n return Math.round(sum / grades.length);\n}",
"function avg(grades) {\n let total = 0;\n for (let i = 0; i < grades.length; i++) {\n total += grades[i].score;\n }\n return (total /... | [
"0.83011144",
"0.79321796",
"0.79312855",
"0.7858832",
"0.7674921",
"0.76740354",
"0.75942194",
"0.74708396",
"0.7404833",
"0.73454636",
"0.7212439",
"0.71952647",
"0.7178259",
"0.71698606",
"0.71418566",
"0.7127209",
"0.7099916",
"0.7066359",
"0.7042195",
"0.7033141",
"0.703... | 0.8035552 | 1 |
[R Squared]( The rsquared value of data compared with a function `f` is the sum of the squared differences between the prediction and the actual value. | function r_squared(data, f) {
if (data.length < 2) return 1;
// Compute the average y value for the actual
// data set in order to compute the
// _total sum of squares_
var sum = 0, average;
for (var i = 0; i < data.length; i++) {
sum += data[i][1];
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function r_squared(data, f) {\n if (data.length < 2) return 1;\n\n // Compute the average y value for the actual\n // data set in order to compute the\n // _total sum of squares_\n var sum = 0, average;\n for (var i = 0; i < data.length; i++) {\n sum += data[i][... | [
"0.802487",
"0.802487",
"0.802487",
"0.6447701",
"0.6109366",
"0.6061148",
"0.6061148",
"0.60346746",
"0.60338414",
"0.59392756",
"0.59372693",
"0.59372693",
"0.589237",
"0.5866603",
"0.5860268",
"0.5764583",
"0.5698077",
"0.5662878",
"0.56602526",
"0.56298745",
"0.55699515",... | 0.80724907 | 0 |
geometric mean a mean function that is more useful for numbers in different ranges. this is the nth root of the input numbers multiplied by each other This runs on `O(n)`, linear time in respect to the array | function geometric_mean(x) {
// The mean of no numbers is null
if (x.length === 0) return null;
// the starting value.
var value = 1;
for (var i = 0; i < x.length; i++) {
// the geometric mean is only valid for positive numbers
if (x[i] <= 0) retu... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function geometric_mean(x) {\n // The mean of no numbers is null\n if (x.length === 0) return null;\n\n // the starting value.\n var value = 1;\n\n for (var i = 0; i < x.length; i++) {\n // the geometric mean is only valid for positive numbers\n if (x[i] <= ... | [
"0.77458894",
"0.77458894",
"0.77458894",
"0.7560721",
"0.74069583",
"0.74069583",
"0.72302186",
"0.72267616",
"0.7178153",
"0.7178153",
"0.71730715",
"0.71703017",
"0.71192783",
"0.7108216",
"0.7087695",
"0.7083719",
"0.7071042",
"0.7058851",
"0.70323545",
"0.6997909",
"0.69... | 0.775728 | 0 |
harmonic mean a mean function typically used to find the average of rates this is the reciprocal of the arithmetic mean of the reciprocals of the input numbers This runs on `O(n)`, linear time in respect to the array | function harmonic_mean(x) {
// The mean of no numbers is null
if (x.length === 0) return null;
var reciprocal_sum = 0;
for (var i = 0; i < x.length; i++) {
// the harmonic mean is only valid for positive numbers
if (x[i] <= 0) return null;
re... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function harmonic_mean(x) {\n // The mean of no numbers is null\n if (x.length === 0) return null;\n\n var reciprocal_sum = 0;\n\n for (var i = 0; i < x.length; i++) {\n // the harmonic mean is only valid for positive numbers\n if (x[i] <= 0) return null;\n\n ... | [
"0.80195415",
"0.80195415",
"0.80195415",
"0.7525469",
"0.7497216",
"0.74832785",
"0.74832785",
"0.7406781",
"0.7406781",
"0.7405718",
"0.73911464",
"0.73694193",
"0.7305038",
"0.72661567",
"0.72483057",
"0.72205055",
"0.71890694",
"0.7187777",
"0.71685153",
"0.714996",
"0.71... | 0.80760396 | 0 |
root mean square (RMS) a mean function used as a measure of the magnitude of a set of numbers, regardless of their sign this is the square root of the mean of the squares of the input numbers This runs on `O(n)`, linear time in respect to the array | function root_mean_square(x) {
if (x.length === 0) return null;
var sum_of_squares = 0;
for (var i = 0; i < x.length; i++) {
sum_of_squares += Math.pow(x[i], 2);
}
return Math.sqrt(sum_of_squares / x.length);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function rms(arr) {\n // Return Root Mean Square of numbers in the given array.\n const sumSquares = arr.reduce((sum, num) => sum + num * num, 0);\n return Math.sqrt(sumSquares / arr.length);\n}",
"function root_mean_square(x) {\n if (x.length === 0) return null;\n\n var sum_of_squares = 0... | [
"0.8072399",
"0.7365461",
"0.7365461",
"0.7259295",
"0.70745736",
"0.70662075",
"0.7024952",
"0.7020578",
"0.7020578",
"0.70108247",
"0.70108247",
"0.69766057",
"0.69692284",
"0.69645345",
"0.6952385",
"0.6951369",
"0.6906664",
"0.6893094",
"0.68905723",
"0.68810856",
"0.6835... | 0.749266 | 1 |
The sum of deviations to the Nth power. When n=2 it's the sum of squared deviations. When n=3 it's the sum of cubed deviations. depends on `mean()` | function sum_nth_power_deviations(x, n) {
var mean_value = mean(x),
sum = 0;
for (var i = 0; i < x.length; i++) {
sum += Math.pow(x[i] - mean_value, n);
}
return sum;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function sum_nth_power_deviations(x, n) {\n var mean_value = mean(x),\n sum = 0;\n\n for (var i = 0; i < x.length; i++) {\n sum += Math.pow(x[i] - mean_value, n);\n }\n\n return sum;\n }",
"function sum_nth_power_deviations(x, n) {\n var mean_value = me... | [
"0.8048812",
"0.8048812",
"0.8048812",
"0.6356031",
"0.6310635",
"0.62361884",
"0.6194732",
"0.60456944",
"0.6030951",
"0.59974945",
"0.59951395",
"0.59229195",
"0.5899951",
"0.5891317",
"0.58622456",
"0.58383054",
"0.58286303",
"0.5789525",
"0.57768965",
"0.57616264",
"0.575... | 0.81506526 | 0 |
[covariance]( sample covariance of two datasets: how much do the two datasets move together? x and y are two datasets, represented as arrays of numbers. depends on `mean()` | function sample_covariance(x, y) {
// The two datasets must have the same length which must be more than 1
if (x.length <= 1 || x.length !== y.length) {
return null;
}
// determine the mean of each dataset so that we can judge each
// value of the dataset fair... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function sample_covariance(x, y) {\n\n // The two datasets must have the same length which must be more than 1\n if (x.length <= 1 || x.length != y.length){\n return null;\n }\n\n // determine the mean of each dataset so that we can judge each\n // value of the dataset... | [
"0.84681994",
"0.84681994",
"0.8427239",
"0.76488054",
"0.6170967",
"0.59765846",
"0.59765846",
"0.59765846",
"0.5970664",
"0.5825057",
"0.5756792",
"0.5753898",
"0.57146615",
"0.5712681",
"0.56820256",
"0.55459416",
"0.53847814",
"0.537934",
"0.5270664",
"0.5201194",
"0.5193... | 0.85039616 | 0 |
[correlation]( Gets a measure of how correlated two datasets are, between 1 and 1 depends on `sample_standard_deviation()` and `sample_covariance()` | function sample_correlation(x, y) {
var cov = sample_covariance(x, y),
xstd = sample_standard_deviation(x),
ystd = sample_standard_deviation(y);
if (cov === null || xstd === null || ystd === null) {
return null;
}
return cov / xstd / ystd;
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function sample_correlation(x, y) {\n var cov = sample_covariance(x, y),\n xstd = sample_standard_deviation(x),\n ystd = sample_standard_deviation(y);\n\n if (cov === null || xstd === null || ystd === null) {\n return null;\n }\n\n return cov / xstd / ys... | [
"0.7763894",
"0.7763894",
"0.7763894",
"0.658802",
"0.65657896",
"0.6516854",
"0.6516854",
"0.6498199",
"0.64351535",
"0.5708285",
"0.55945176",
"0.54724485",
"0.547048",
"0.54499865",
"0.54344094",
"0.5330867",
"0.52150875",
"0.51707053",
"0.51508427",
"0.51249516",
"0.51033... | 0.7816878 | 0 |
[median]( The middle number of a list. This is often a good indicator of 'the middle' when there are outliers that skew the `mean()` value. | function median(x) {
// The median of an empty list is null
if (x.length === 0) return null;
// Sorting the array makes it easy to find the center, but
// use `.slice()` to ensure the original array `x` is not modified
var sorted = x.slice().sort(function (a, b) { return a ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function median(x) {\n // The median of an empty list is null\n if (x.length === 0) return null;\n\n // Sorting the array makes it easy to find the center, but\n // use `.slice()` to ensure the original array `x` is not modified\n var sorted = x.slice().sort(function (a, b) { ret... | [
"0.80452234",
"0.80452234",
"0.80452234",
"0.7963132",
"0.79479796",
"0.77886695",
"0.7757685",
"0.7732732",
"0.7706489",
"0.77019495",
"0.76757205",
"0.7644808",
"0.760158",
"0.7569406",
"0.7552327",
"0.7552327",
"0.7550998",
"0.75418663",
"0.7510901",
"0.74994844",
"0.74820... | 0.81580085 | 0 |
[ttest]( This is to compute a onesample ttest, comparing the mean of a sample to a known value, x. in this case, we're trying to determine whether the population mean is equal to the value that we know, which is `x` here. usually the results here are used to look up a [pvalue]( which, for a certain level of significanc... | function t_test(sample, x) {
// The mean of the sample
var sample_mean = mean(sample);
// The standard deviation of the sample
var sd = standard_deviation(sample);
// Square root the length of the sample
var rootN = Math.sqrt(sample.length);
// Compute t... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function t_test(sample, x) {\n // The mean of the sample\n var sample_mean = mean(sample);\n\n // The standard deviation of the sample\n var sd = standard_deviation(sample);\n\n // Square root the length of the sample\n var rootN = Math.sqrt(sample.length);\n\n // C... | [
"0.7702026",
"0.7702026",
"0.7702026",
"0.61199665",
"0.61199665",
"0.61199665",
"0.61199665",
"0.5679534",
"0.5679534",
"0.5665887",
"0.56528133",
"0.54896605",
"0.54896605",
"0.54896605",
"0.54771197",
"0.534885",
"0.5319238",
"0.5269503",
"0.5269503",
"0.5269503",
"0.52282... | 0.78155816 | 0 |
[2sample ttest]( This is to compute two sample ttest. Tests whether "mean(X)mean(Y) = difference", ( in the most common case, we often have `difference == 0` to test if two samples are likely to be taken from populations with the same mean value) with no prior knowledge on standard deviations of both samples other than... | function t_test_two_sample(sample_x, sample_y, difference) {
var n = sample_x.length,
m = sample_y.length;
// If either sample doesn't actually have any values, we can't
// compute this at all, so we return `null`.
if (!n || !m) return null;
// default differe... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function t_test_two_sample(sample_x, sample_y, difference) {\n var n = sample_x.length,\n m = sample_y.length;\n\n // If either sample doesn't actually have any values, we can't\n // compute this at all, so we return `null`.\n if (!n || !m) return null ;\n\n // default... | [
"0.8488704",
"0.8488704",
"0.84813416",
"0.66947514",
"0.66459024",
"0.66459024",
"0.66459024",
"0.5437922",
"0.5358606",
"0.5335871",
"0.5308346",
"0.5303883",
"0.5273353",
"0.5208545",
"0.5208545",
"0.50155705",
"0.50155705",
"0.50155705",
"0.50155705",
"0.49420086",
"0.494... | 0.8492979 | 0 |
sample Create a [simple random sample]( from a given array of `n` elements. | function sample(array, n, randomSource) {
// shuffle the original array using a fisher-yates shuffle
var shuffled = shuffle(array, randomSource);
// and then return a subset of it - the first `n` elements.
return shuffled.slice(0, n);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function sample(array, n, randomSource) {\n // shuffle the original array using a fisher-yates shuffle\n var shuffled = shuffle(array, randomSource);\n\n // and then return a subset of it - the first `n` elements.\n return shuffled.slice(0, n);\n }",
"function sample(array, n, rand... | [
"0.84278136",
"0.84278136",
"0.8014934",
"0.7701098",
"0.76675117",
"0.76526797",
"0.759238",
"0.757188",
"0.75718707",
"0.7470328",
"0.7380201",
"0.7340079",
"0.73395723",
"0.73395723",
"0.73395723",
"0.73395723",
"0.73395723",
"0.73395723",
"0.73395723",
"0.73395723",
"0.73... | 0.84493124 | 0 |
quantile This is a population quantile, since we assume to know the entire dataset in this library. Thus I'm trying to follow the [Quantiles of a Population]( algorithm from wikipedia. Sample is a onedimensional array of numbers, and p is either a decimal number from 0 to 1 or an array of decimal numbers from 0 to 1. I... | function quantile(sample, p) {
// We can't derive quantiles from an empty list
if (sample.length === 0) return null;
// Sort a copy of the array. We'll need a sorted array to index
// the values in sorted order.
var sorted = sample.slice().sort(function (a, b) { return a -... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function quantile(sample, p) {\n\n // We can't derive quantiles from an empty list\n if (sample.length === 0) return null;\n\n // Sort a copy of the array. We'll need a sorted array to index\n // the values in sorted order.\n var sorted = sample.slice().sort(function (a, b) { ret... | [
"0.83466077",
"0.83466077",
"0.83466077",
"0.77317023",
"0.7678068",
"0.7678068",
"0.7678068",
"0.6882983",
"0.67595625",
"0.6292534",
"0.62839365",
"0.608685",
"0.608685",
"0.608685",
"0.5841834",
"0.5717309",
"0.5550441",
"0.531477",
"0.5312047",
"0.5307783",
"0.5307783",
... | 0.8427583 | 0 |
[Interquartile range]( A measure of statistical dispersion, or how scattered, spread, or concentrated a distribution is. It's computed as the difference between the third quartile and first quartile. | function iqr(sample) {
// We can't derive quantiles from an empty list
if (sample.length === 0) return null;
// Interquartile range is the span between the upper quartile,
// at `0.75`, and lower quartile, `0.25`
return quantile(sample, 0.75) - quantile(sample, 0.25);
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function iqr(sample) {\n // We can't derive quantiles from an empty list\n if (sample.length === 0) return null;\n\n // Interquartile range is the span between the upper quartile,\n // at `0.75`, and lower quartile, `0.25`\n return quantile(sample, 0.75) - quantile(sample, 0.25);... | [
"0.6004634",
"0.6004634",
"0.6004634",
"0.588832",
"0.58481616",
"0.5787282",
"0.5770567",
"0.56408036",
"0.56166583",
"0.5608016",
"0.5608016",
"0.56069356",
"0.5605754",
"0.5522942",
"0.5461025",
"0.53922904",
"0.53819543",
"0.5364714",
"0.52755713",
"0.52052784",
"0.520330... | 0.62600684 | 0 |
[Median Absolute Deviation]( The Median Absolute Deviation (MAD) is a robust measure of statistical dispersion. It is more resilient to outliers than the standard deviation. | function mad(x) {
// The mad of nothing is null
if (!x || x.length === 0) return null;
var median_value = median(x),
median_absolute_deviations = [];
// Make a list of absolute deviations from the median
for (var i = 0; i < x.length; i++) {
median... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function mad(dat) {\n var med = d3.median(dat);\n var vals = dat.map(function(d) { return Math.abs(d - med); })\n return d3.median(vals);\n }",
"function mad(x) {\n // The mad of nothing is null\n if (!x || x.length === 0) return null;\n\n var median_value = median(x)... | [
"0.74714863",
"0.71423846",
"0.71423846",
"0.71423846",
"0.68615997",
"0.67620903",
"0.6700102",
"0.6691233",
"0.6669889",
"0.6575293",
"0.65666574",
"0.6546365",
"0.6504521",
"0.64542514",
"0.64316416",
"0.63677025",
"0.6353782",
"0.63411075",
"0.63152295",
"0.6312737",
"0.6... | 0.72065526 | 1 |
Pull Breaks Values for Jenks the second part of the jenks recipe: take the calculated matrices and derive an array of n breaks. | function jenksBreaks(data, lower_class_limits, n_classes) {
var k = data.length,
kclass = [],
countNum = n_classes;
// the calculation of classes will never include the upper
// bound, so we need to explicitly set it
kclass[n_classes] = data[data.length - ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function popArray(nbr) {\n let breakCol = [1];\n let iterLim = nbr - 1;\n for (let i = 1; i <= iterLim; i++) {\n nextBrk = (nbr * i) + 1;\n breakCol.push(nextBrk);\n }\n console.log(breakCol);\n return breakCol;\n}",
"function jenks(data, n_classes) {\n\n\t if (n_classes > ... | [
"0.6215831",
"0.57763517",
"0.5675643",
"0.5675643",
"0.5648131",
"0.5633238",
"0.56324327",
"0.56324327",
"0.56324327",
"0.5253055",
"0.5193034",
"0.51928425",
"0.50921553",
"0.5073079",
"0.503741",
"0.50289875",
"0.5023095",
"0.50180966",
"0.5014809",
"0.49943528",
"0.49834... | 0.5813606 | 1 |
[Jenks natural breaks optimization]( Implementations: [1]( (python), [2]( (buggy), [3]( (works) Depends on `jenksBreaks()` and `jenksMatrices()` | function jenks(data, n_classes) {
if (n_classes > data.length) return null;
// sort data in numerical order, since this is expected
// by the matrices function
data = data.slice().sort(function (a, b) { return a - b; });
// get our basic matrices
var matrices = j... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function jenks(data, n_classes) {\n\n if (n_classes > data.length) return null;\n\n // sort data in numerical order, since this is expected\n // by the matrices function\n data = data.slice().sort(function (a, b) { return a - b; });\n\n // get our basic matrices\n var matr... | [
"0.64591944",
"0.64591944",
"0.64591944",
"0.58542687",
"0.57410544",
"0.5739505",
"0.5739505",
"0.570406",
"0.56419617",
"0.56213546",
"0.56023115",
"0.56023115",
"0.56023115",
"0.5566586",
"0.5498198",
"0.53176457",
"0.52340335",
"0.51962405",
"0.5144004",
"0.5134315",
"0.5... | 0.6633627 | 0 |
[Cumulative Standard Normal Probability]( Since probability tables cannot be printed for every normal distribution, as there are an infinite variety of normal distributions, it is common practice to convert a normal to a standard normal and then use the standard normal table to find probabilities. You can use .5 + .5 e... | function cumulative_std_normal_probability(z) {
// Calculate the position of this value.
var absZ = Math.abs(z),
// Each row begins with a different
// significant digit: 0.5, 0.6, 0.7, and so on. Each value in the table
// corresponds to a range of 0.01 in the ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function cumulative_std_normal_probability(z) {\n\n // Calculate the position of this value.\n var absZ = Math.abs(z),\n // Each row begins with a different\n // significant digit: 0.5, 0.6, 0.7, and so on. Each value in the table\n // corresponds to a range of 0.01 i... | [
"0.72102344",
"0.72102344",
"0.71947443",
"0.7055498",
"0.6655368",
"0.6655368",
"0.6529738",
"0.6440158",
"0.6389687",
"0.6297274",
"0.62554216",
"0.62276405",
"0.62050545",
"0.60431063",
"0.6042956",
"0.60174394",
"0.5960749",
"0.59537387",
"0.5842588",
"0.5839391",
"0.5835... | 0.7290599 | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.