query stringlengths 9 34k | document stringlengths 8 5.39M | negatives listlengths 19 20 | metadata dict |
|---|---|---|---|
function for filling the graphs concerning the current training process OBJECT data, data from the current situation api call returns: VOID | function fillCurrentSituationGraphs(data) {
// metric arrays
let acc = []
let val_acc = []
let loss = []
let val_loss = []
// fill the metric arrays
data.forEach(function (item) {
acc.push(item['acc'])
val_acc.push(item['val_acc'])
loss.push(item['loss'])
val... | [
"evaluateGrid(data) {\n this.graph = new DepGraph();\n for (const [key, value] of Object.entries(data)) {\n // eslint-disable-line no-restricted-syntax\n if (!value.readOnly) {\n this.getDependency(value);\n }\n }\n try {\n console.log(this.graph.overallOrder());\n this.g... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Assert that all resources of the given type contain the given properties CloudFormation template. By default, performs partial matching on the `Properties` key of the resource, via the `Match.objectLike()`. To configure different behavior, use other matchers in the `Match` class. | allResourcesProperties(type, props) {
const matchError = (0, resources_1.allResourcesProperties)(this.template, type, props);
if (matchError) {
throw new Error(matchError);
}
} | [
"hasResourceProperties(type, props) {\n const matchError = (0, resources_1.hasResourceProperties)(this.template, type, props);\n if (matchError) {\n throw new Error(matchError);\n }\n }",
"resourcePropertiesCountIs(type, props, count) {\n const counted = (0, resources_1.c... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
drawFlat() will take the fft spectrum and generate a series of rectangular bands determined by the quality slider. These bands vary in amplitudes based on the intensity of that specific frequency spectral component. | function drawFlat(spectrum){
colorMode(HSB, bands);
var w = width / (bands * 1.5);
var maxF = Math.max(spectrum);
for (var i = 0; i < spectrum.length; i++) {
var amp = spectrum[i];
var y = map(amp, 0, 255, height, 10);
fill(i,255,255);
rect(width/2 + i*w,y,w-2,height-y);
rect(w... | [
"draw() {\n for (const waveform of this.waveforms) {\n this.drawInCanvas(waveform.canvas, waveform.samples);\n }\n }",
"function drawSpectrumOnCanvas() {\r\n const d = ZXDisplay\r\n const c = console\r\n c.time(\"drawSpectrumOnCanvas()\")\r\n //\r\n // draw a random stri... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Update subtotal, tex and total price from localStorage | function updateCartPrice() {
var currentCartArray = JSON.parse(localStorage.getItem("cart"));
var subtotal = 0;
var tax = 0;
var total = 0;
for (var i = 0; i < currentCartArray.length; i++) {
if (currentCartArray[i] === null) {continue;}
subtotal += Number(currentCartArray[i].price);... | [
"function updateTotal() {\n let totalBalance = localStorage.getItem(\"totalBalance\");\n let couponCode = localStorage.getItem(\"couponCode\");\n let deliveryTot = localStorage.getItem(\"deliveryTot\");\n\n if (couponCode && deliveryTot > 1) {\n totalBalance = parseInt(totalBalance);\n cou... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
length insert: insert `state` into history, which means adding the current state into `past`, setting the new `state` as `present` and erasing the `future`. | function insert(history, state, limit) {
debug('insert', { state: state, history: history, free: limit - length(history) });
var past = history.past;
var present = history.present;
var historyOverflow = limit && length(history) >= limit;
if (present === undefined) {
// init history
return {
... | [
"function push() {\n var lastState = newState(),\n i;\n copyModelState(lastState);\n list[listState.index + 1] = lastState; // Drop the oldest state if we went over the max list size\n\n if (list.length > listState.maxSize) {\n list.splice(0, 1);\n listState.startCounter++;\n } else ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sends a property update to TTS. EVRYTHNG can handle individual properties, while TTS sends the whole structure so we map it here | function sendPropertyToTTS(thng, property) {
console.log('[TTS] Sending property update');
evrythng.thng(thng.id).read().then(function (thngRead) {
var propertyUpdates = {
status: thngRead.properties.status,
color: {
model: thngRead.properties.model,
... | [
"PutSubscriberProperty(string, Variant) {\n\n }",
"async update(properties) {\n return spPostMerge(this, request_builders_body(properties));\n }",
"onPropertySet(room, property, value, identifier) {\n room[prop] = value;\n }",
"updateMessage(props) {\n Common.assertPlainObject(props);\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Reverse arabic sentence layout TODO: check base dir before applying adjustments priority low | function reverseArabicSentences() {
var this$1 = this;
var ranges = this.tokenizer.getContextRanges('arabicSentence');
ranges.forEach(function (range) {
var rangeTokens = this$1.tokenizer.getRangeTokens(range);
this$1.tokenizer.replaceRange(
range.startIndex,
... | [
"function invertirFrase(n) {\n let frase = \"\";\n for (let i = n.length - 1; i >= 0; i--) {\n frase += n[i];\n }\n return frase;\n }",
"function menutoshowlang(){\n}",
"normalizeArabic(str=\"\") {\n return (\n str\n // Trim Whitespace\n .trim()\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
is the node itself or any of its ancestors locked? | isNodeLocked(node) {
return node.el.matches('[aria-disabled="true"], [aria-disabled="true"] *');
} | [
"function extUtils_isPartOfLockedContent(currNode)\n{\n return (currNode.parentNode && currNode.parentNode.childNodes.length == 3\n && currNode.parentNode.childNodes[0].tagName == \"MM:BEGINLOCK\");\n}",
"visitLock_mode(ctx) {\n\t return this.visitChildren(ctx);\n\t}",
"function isNodeOpen(node) \r\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Flip credit card to front view and check if all inputs are filled | function flipCreditCardFront() {
var allFilled = true; // check credit card if all fields are filled
$('#creditCard .front input').each(function() {
if ( $(this).val() === '' ) {
allFilled = false;
}
})
if ( allFilled == true ) {
checkCreditCard();
}
$('.credit-card').addClass('animated ... | [
"function CheckOverallValidity(card, cardnum){\n card.checkNumValidity(cardnum);\n card.checkLengthValidity();\n card.checkDateValidity();\n \n\n if(card.validNum == false){\n document.getElementById(\"CardNum\").innerHTML = \"Card Number Invalid\"\n document.getElementById(\"CardNum\")... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Add a node to the list Use the argument of push(value) to create a new instance of a Node, which is assigned to a variable named node. We also declare a variable named currentNode and initialize it to the head of our list. If there are no nodes in the list, then the value of head is null. After this point in our code, ... | push (value) {
var node = new Node(value)
var currentNode = this.head
// 1st use-case: an empty list
if (!currentNode) {
this.head = node
this.length++
return node
}
// 2nd use-case: a non-empty list
while (currentNode.next) {
currentNode = currentNode.next
}
... | [
"addToHead(val) {\n // console.log('something')\n\n const node = new Node(val)\n if(this.head === null){\n this.head = node;\n this.tail = node;\n\n } else {\n const temp = this.head;\n this.head = node;\n this.head.next = temp;\n\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Adiciona o componente ao DOM. | function attachOnDOM(){
document.getElementsByTagName('body')[0].appendChild(getComponent())
} | [
"dom(lastJstComponent, lastJstForm) {\n\n // TEMP protection...\n if (this.tag === \"-deleted-\") {\n console.error(\"Trying to DOM a deleted element\", this);\n return undefined;\n }\n let el = this.el;\n\n if (!el) {\n if (this.ns) {\n el = document.createElementNS(this.ns, th... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Update the known topics. | function updateTopics(topics) {
topics.forEach(function(d) {
d.r = r(d.count);
d.cr = Math.max(minRadius, d.r);
d.k = fraction(d.parties[0].count, d.parties[1].count);
if (isNaN(d.k)) d.k = .5;
if (isNaN(d.x)) d.x = (1 - d.k) * width + Math.random();
d.bias = .5 - Math.max(.1, Math.min(.9, d.k... | [
"function __refreshUserTopics() {\n VD_API\n .GetUsers(0, _filter.date.start, _filter.date.end)\n .done((users) => {\n users.forEach(__displayUserTopicsCounts);\n })\n .fail((response) => {\n console.error(`Failed to refresh user topic... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
run the animations, that means note time advance animation calculate remaining time from fps start time delay, request animation frame for next frame | function run() {
if (running) {
// all times in msec
// minimum time per frame for not exceeding the given fps speed
// fps=60 means maximum speed
const minimumFrameTime = 1000 / animation.fps - 1000 / 60;
// do the current frame
const startOfFrame = Date.now();
... | [
"function runn_animation(target_animation_engine,deltatime)\n{\n target_animation_engine.runn(deltatime);\n}",
"function tick() {\n current_animation_frame = requestAnimFrame(tick);\n draw();\n animate();\n}",
"function _nextFrame() {\n \n // Increment (or decrement) the frame counter based on animation ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
The expectation is that the activate route is created with the right set of parameters. So we push new values into the observables only when they are not the initial values. And we detect that by checking if the snapshot field is set. | function advanceActivatedRoute(route) {
if (route.snapshot) {
if (!collection_1.shallowEqual(route.snapshot.params, route._futureSnapshot.params)) {
route.params.next(route._futureSnapshot.params);
route.data.next(route._futureSnapshot.data);
}
if (!collection_1... | [
"stateValuesSubscribe (path) {\n // prevent duplicates\n if (contains(path, this.subscriptions)) return\n // subscribe\n this.subscriptions.push(path)\n this.stateValuesSendSubscriptions()\n }",
"stateValuesSendSubscriptions () {\n this.send('state.values.subscribe', { paths: this.subscriptions... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Utility method for getting the last email for the Ethereal email account | async getLastEmail() {
// makes debugging very simple
// console.log('Getting the last email')
try {
const connection = await imaps.connect(emailConfig)
// grab up to 50 emails from the inbox
await connection.openBox('INBOX')
... | [
"_getSocialAccountEmail() {\n const oThis = this;\n\n // Check if email is received from github.\n if (oThis.appleUserEntity.email && CommonValidators.isValidEmail(oThis.appleUserEntity.email)) {\n return oThis.appleUserEntity.email;\n }\n\n return null;\n }",
"function emailMobile (email_mob... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Loads upcoming elections from the API | getUpcoming({commit},data) {
commit('setElectionsLoadStatus', 1);
ElectionAPI.getUpcoming(
data.url
)
.then( function(response) {
commit('setElections', response.data.data);
commit('setElectionsLoadStatus', 2);
... | [
"getElections({commit}, data) {\n commit('setElectionsLoadStatus', 1);\n\n ElectionAPI.getElections(\n data.url\n )\n .then( function(response) {\n commit('setElections', response.data.data);\n commit('setElectionsL... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
PARSE FUNCTIONS AUTHOR: nakul DATE : 4/28/2019 BRIEF : Adds a given itinerary for the username | function jnParseAddItineraryForUsername(username, itObj)
{
var addResult = false;
var usernameFound = false;
for (usernameItObj in _jnAllParsedItineraryObjs) {
var usernameFromObj = usernameItObj._username;
if (usernameFromObj == username) {
usernameItObj._itineraries.push(itObj);
usernameFound = true;
... | [
"function jnParseItineraryObj(username, itJSONObj)\n{\n\t//var rand = new Person('Rand McNally', 33, 'M');\n\t//var id = 4;\n\t//var jnIt = new jnItineraryObj1(id);\n\tvar consoleLog = \"\";\n\t\n\t// --------- BEGIN CONSOLE MESSAGE { ------------------------\n\t\tconsoleLog = \"Parsing JSON for user name: \" + u... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Copy configuration from traversal state to builder instance to prepare for next traversal process. | function initFromTraversalState(self, t) {
self.aborted = false;
self.adapter = t.adapter;
self.body = t.body;
self.callbackHasBeenCalledAfterAbort = false;
self.autoHeaders = t.autoHeaders;
self.contentNegotiation = t.contentNegotiation;
self.convertResponseToObjectFlag = t.convertResponseToObject;
sel... | [
"function initFromTraversalState(self, t) {\n self.aborted = false;\n self.adapter = t.adapter;\n self.body = t.body;\n self.callbackHasBeenCalledAfterAbort = false;\n self.autoHeaders = t.autoHeaders;\n self.contentNegotiation = t.contentNegotiation;\n self.rawPayload = t.rawPayload;\n self.convertResponse... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Render everything in the graph(all points, all segments, grid, axes, origin) | render() {
this._ctx.clearRect(0, 0, this.width, this.height);
// Draw all points
this._points.forEach( p => this.drawPoint(p.x, p.y, p.color) );
// Draw all lines
this._lines.forEach( line => this.drawLine(line, this.DEFAULT_LINE_COLOR) );
// Render a grid
this.renderGrid(10);
// Render the axes
... | [
"drawGraph() {\r\n this.ctx.fillStyle = this.bgColor;\r\n this.ctx.fillRect(0, 0, this.width, this.height);\r\n\r\n if (this.drawGrid) this.drawLines();\r\n const graphInfo = {\r\n ctx: this.ctx,\r\n gtc: this.gtc,\r\n sgtc: th... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Compute a mapping from label name to objects representing the minimum and maximum possible values for that label. | _computeLabelExtremes(labelRecord) {
const extremes = {};
const labels = labelRecord.base;
if (!labels) { return extremes; }
for (const key of Object.keys(labels)) {
// TODO(TS): Let's use label-util!
if (!labels[key] || !labels[key].values) { continue; }
const values = Object.keys(lab... | [
"_computeLabelExtremes(labelRecord) {\n const extremes = {};\n const labels = labelRecord.base;\n if (!labels) { return extremes; }\n for (const key of Object.keys(labels)) {\n if (!labels[key] || !labels[key].values) { continue; }\n const values = Object.keys(labels[key].values)\n .m... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Wait for auth to clear before continuing | function waitForAuth(cb) {
if (!self.authenticating) return cb();
// Wait for a milisecond and try again
setTimeout(function () {
waitForAuth(cb);
}, 1);
} | [
"markAuthDone() {\n this.authDeferred_.resolve();\n }",
"function refreshAuth() {\n try {\n mySense.getAuth();\n } catch (error) {\n console.log(`Re-auth failed: ${error}. Exiting.`);\n process.exit();\n }\n}",
"function resetAuth() {\n getOAuthService().reset();\n}",
"fun... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Combined stream of all of the child chips' focus events. | get chipFocusChanges() {
return this._getChipStream(chip => chip._onFocus);
} | [
"trapFocus () {\n let $focusablePanelBodyElements = this.$detailPanelBody\n .find('a[href], area[href], input, select, textarea, button, iframe, object, embed, [tabindex], *[contenteditable]')\n .not('[tabindex=-1], [disabled], :hidden, [aria-hidden]'),\n $focusableEl... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
readLine() reads a single line from the TextProtoReader, eliding the final \n or \r\n from the returned string. | async readLine() {
const s = await this.readLineSlice();
if (s === Deno.EOF)
return Deno.EOF;
return str(s);
} | [
"async readLine() {\n let line;\n try {\n line = await this.readSlice(LF);\n }\n catch (err) {\n let { partial } = err;\n asserts_ts_1.assert(partial instanceof Uint8Array, \"bufio: caught error from `readSlice()` without `part... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
to replace root with new node "root" and heapify() new root | replaceMin(root)
{
this.harr[0] = root;
this.MinHeapify(0);
} | [
"insert(value) {\n let newNode = new TreeNode(value);\n let current;\n this.size++;\n\n if (this.root == null) {\n this.root = newNode;\n } else {\n current = this.root;\n\n while(current != newNode) {\n if (newNode.value >= current.value) {\n if (current.right != null)... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Refreshes the individual line item costs And also updates the total cost for the order | function RefreshCost()
{
var TotalQuantity = 0;
var Total = 0;
var ThisItemTotal = 0;
var LineCostItterator = document.getElementsByTagName("input");
for(var itt=0;itt<LineCostItterator.length;itt++)
{
// check if the ID starts with LINECOST
if(LineCostItterator[itt].id.indexOf('LINECOST') == 0)
... | [
"function increaseCostofSubsequentMultiplierPurchase(){\r\n widgetMaker.multiplierCost = widgetMaker.multiplierCost * 1.1;\r\n }",
"function refreshQuantity()\r\n{\r\n for (let i = 0; i < currentQuantity.length; i++) {\r\n currentQuantity[i] = document.getElementById(\"cant\" + i).value;\r\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Return either an empty space or the player's symbol | displaySymbol(symbol) {
return symbol === '' ? ' ' : symbol;
} | [
"function givePlayerSymbol(){\r\n\tif (player){\r\n\t\treturn \"X\";\r\n\t}else {\r\n\t\treturn \"O\";\r\n\t}\r\n\r\n}",
"function characterParity(symbol) {\n if (isNaN(symbol)) {\n return \"not a digit\";\n } else {\n return +symbol % 2 === 0 ? \"even\" : \"odd\";\n }\n}",
"function initPlayerWord() {... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Oscar and Eli both have unique name and score properties. If Eli's score goes to 100, Oscar's score stays at 0. However, it's not just the properties that get copied, the victory method gets copied into each instance as well. At this point, with two Player instances, we have two identical victory methods stored in memo... | function Player2(name){
this.name = name;
this.score = 0;
Player2.prototype.playerCount += 1;
} | [
"function HumanPlayer() {\n this.score = 0;\n}",
"function Player(name) {\n this.name = name;\n this.rollDie = 0;\n this.roundScore = 0;\n this.totalScore = 0;\n}",
"function player (name, age, team, pointsScored) {\n this.name = name;\n this.age = age;\n this.team = team;\n this.pointsScored = pointsS... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Visit a parse tree produced by PlSqlParseradd_logfile_clauses. | visitAdd_logfile_clauses(ctx) {
return this.visitChildren(ctx);
} | [
"visitDrop_logfile_clauses(ctx) {\n\t return this.visitChildren(ctx);\n\t}",
"visitRegister_logfile_clause(ctx) {\n\t return this.visitChildren(ctx);\n\t}",
"visitTablespace_logging_clauses(ctx) {\n\t return this.visitChildren(ctx);\n\t}",
"visitLogging_clause(ctx) {\n\t return this.visitChildren(ctx);\n\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
get city name from google because forecast.io does not provide city name | function getCityName() {
'use strict';
var keyGoogle = 'AIzaSyBmCk28nEs1OWXgwS0VQ1752o_cYwrkxHs',
url = 'https://maps.googleapis.com/maps/api/geocode/json?latlng=',
location = latitude + ',' + longitude;
$.ajax({
url: url + location,
type: 'GET',
dataType: 'json',
... | [
"async function cityFinder(city) {\n const date = await fetch(`https://geocode.xyz/${city}?json=1`)\n .then((response) => response.json())\n .then((data) =>\n console.log(`${city} : Longtitude: ${data.longt} Lattitude: ${data.latt}`)\n )\n .catch((onErr) => new Error(onErr));\n}",
"function getC... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Converting Maps into Json | function mapToJson(map) {
let arr = [];
var loopTrough = (value, key, map) => {
arr.push([key, value]);
}
listing.forEach(loopTrough);
return JSON.stringify(arr);
} | [
"function toJson(o) { return JSON.stringify(o); }",
"function convertMapsToObjects(arg) {\n if (arg instanceof Map) arg = Object.fromEntries(arg);\n\n if (typeof arg === 'object' && arg !== null) {\n for (const key of Object.keys(arg)) {\n const value = arg[key];\n\n if (typeof value === 'object' &... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
FUNCTION NAME : getHasDevNameOnArray AUTHOR : Marlo Agapay DATE : January 14, 2013 MODIFIED BY : REVISION DATE : REVISION : DESCRIPTION : get all device name to string PARAMETERS : | function getHasDevNameOnArray(){
var str =[];
if(globalInfoType == "JSON"){
var devices = getDevicesNodeJSON();
}else{
var devices =devicesArr;
}
for(var a=0; a<devices.length; a++){
if (devices[a].DeviceName!=""){
var name = devices[a].DeviceName;
str.push(name);
}
}
return str... | [
"function deviceQstr(device){\n\tvar devicesStr = \"[\";\n\tfor(var t=0; t<device.length; t++){\n\t\tif(t == device.length - 1){\n\t\t\tdevicesStr += \"{ 'DeviceId':'\"+device[t].DeviceId+\"','Type': '\"+device[t].Type+\"' }\";\n\t\t}else{\n\t\t\tdevicesStr += \"{ 'DeviceId':'\"+device[t].DeviceId+\"','Type': '\"+d... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Check if a given node is a negative index expression E.g. `s.slice( )`, `s.substring(s.length )` | function isNegativeIndexExpression(node, expectedIndexedNode) {
return ((node.type === utils_1.AST_NODE_TYPES.UnaryExpression &&
node.operator === '-') ||
(node.type === utils_1.AST_NODE_TYPES.BinaryExpression &&
node.operator === '-' &&
... | [
"function isNeg ( test ) {\n return test < 0;\n }",
"firstNumberNegative(expression){\n if(expression[0] === \"-\"){\n let i = 1;\n\n while(i < expression.length){\n if(expression[i] === \"-\"){\n return i;\n }\n i += 1;\n }\n }\n\n return fa... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Exit a parse tree produced by Java9ParserunannInterfaceType. | exitUnannInterfaceType(ctx) {
} | [
"exitUnannClassOrInterfaceType(ctx) {\n\t}",
"exitNormalInterfaceDeclaration(ctx) {\n\t}",
"exitUnannClassType_lf_unannClassOrInterfaceType(ctx) {\n\t}",
"exitUnannInterfaceType_lf_unannClassOrInterfaceType(ctx) {\n\t}",
"exitUnannPrimitiveType(ctx) {\n\t}",
"exitUnannReferenceType(ctx) {\n\t}",
"exitIn... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Determines if the element has an ancestor that handles the scroll delta prior to this | _hasScrolledAncestor(el, deltaX, deltaY) {
if (el === this.scrollTarget || el === this.scrollTarget.getRootNode().host) {
return false;
} else if (
this._canScroll(el, deltaX, deltaY) &&
['auto', 'scroll'].indexOf(getComputedStyle(el).overflow) !== -1
) {
return true;
} else if (... | [
"isInViewport() {\n const vm = this;\n\n if(vm.firstTime) {\n // first time set postion of element outside monitor\n vm.firstTime = false\n return true\n } else {\n return vm.offset + vm.height > vm.scroll &&\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Determine whether the given properties match those of a `VirtualGatewayTlsValidationContextAcmTrustProperty` | function CfnVirtualGateway_VirtualGatewayTlsValidationContextAcmTrustPropertyValidator(properties) {
if (!cdk.canInspect(properties)) {
return cdk.VALIDATION_SUCCESS;
}
const errors = new cdk.ValidationResults();
if (typeof properties !== 'object') {
errors.collect(new cdk.ValidationResu... | [
"function CfnVirtualNode_TlsValidationContextAcmTrustPropertyValidator(properties) {\n if (!cdk.canInspect(properties)) {\n return cdk.VALIDATION_SUCCESS;\n }\n const errors = new cdk.ValidationResults();\n if (typeof properties !== 'object') {\n errors.collect(new cdk.ValidationResult('Ex... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets file template with the specified name. | getTemplate(name) {
return this.templates.find(template => template.name === name);
} | [
"function getTemplateByName(req, res) {\n\tqueryName(req.swagger.params.name.value, function(array){\n\t\tif (array.length > 0) {\n\t\t\tres.json(array[0]);\n\t\t} else {\n\t\t\tres.statusCode = 404;\n\t\t\tres.json({message: \"Not Found\"});\n\t\t}\n\t});\n}",
"getTemplate(tname) {\n let template = th... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Add the result of unary and binary closure rules on each constraint in the set until no new constraints are produced (a fixed point reached). | closure() {
let cs = [];
let wl = Array.copy(this.constraints.constraints);
while (wl.length > 0) {
let w = wl.pop();
if (!cs.some(c => c.equals(w))) {
w.unary().forEach(c => wl.push(c));
for (let c of cs) {
w.binary(... | [
"visitAdd_constraint_clause(ctx) {\n\t return this.visitChildren(ctx);\n\t}",
"visitAdd_constraint(ctx) {\n\t return this.visitChildren(ctx);\n\t}",
"docosts1(u,cost) {\n\t\tlet l = this.left(u); let r = this.right(u);\n\t\tlet mc = cost[u];\n\t\tif (l) {\n\t\t\tthis.docosts1(l,cost);\n\t\t\tmc = Math.min(mc,... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Load Additional Resource Specific Properties | loadResource() {
// Load Selects
// Assign Values
this.description.property('value', this.resource.description)
} | [
"loadResource() {\n // Load Selects\n // Assign Values\n this.is_auto_reclaimable.property('checked', this.resource.is_auto_reclaimable)\n this.ddl_statement.property('value', this.resource.ddl_statement)\n this.capacity_mode.property('value', this.resource.table_limits.capacity_m... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
retrieves the logs from the simulation | function retrieveLogs(simulation){
//calls function from localSimulationManager
var device_list=getAllDeviceObjects(simulation);
for (var i =0;i<device_list.length;i++){
simulationLogs+=device_list[i].activity+'\n';
}
var simulationLogs= simulation.activity_logs;
return simulationLogs;
} | [
"function getLogsFromServer() {\n if (!$scope.logs) return;\n\n var logs = $scope.logs;\n var len = logs.length;\n for (var i = 0; i < len; i++) {\n getLog(logs[i]);\n }\n }",
"getLogs() {\n if (this.auth()) {\n if (this.currentUser.type =... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Stomp.abort(transaction_id) Abort transaction Takes a string representing the transaction id generated by stomp.Stomp.begin() | abort(transaction_id) {
this.sendCommand('ABORT', {'transaction': transaction_id});
this.log.debug(`abort transaction: ${transaction_id}`);
} | [
"abortTransaction() {\n\t\tthis.isTransacting = false;\n\t\tthis.restoreToPreviousState();\n\t}",
"abort(transaction) {\n return this._transmit(\"ABORT\", {\n transaction: transaction\n });\n }",
"abortSession() {\n if (this.isRunning) {\n this.abort = true;\n }\n }",
"... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Determines if OK to change pages. This is a common function for entity folder "tab" pages. | function cisEntityFolderIsOkToChangePages(id, url) {
// contact tab page.
if (id == cisEntityFolderContactTabMenuItemID) {
return true;
}
// relationship tab page.
else if (id == cisEntityFolderRelationshipTabMenuItemID) {
return true;
}
// audit trail tab page.
... | [
"function isModified() {\n\tif (is_modified)\n\t\tif (!confirm('Data on this page has been modified.\\nIf you proceed, changes wont\\'t be saved.\\nProceed anyway?'))\n\t\t\treturn false;\n\treturn true;\n}",
"async isCorrectPageOpened() {\n let currentURL = await PageUtils.getURL()\n return currentURL.... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Check if port range is invalid Return : 1 ==> port range is invalid 0 ==> port range is valid | function port_range_is_invalid(){
var cf = document.forms[0];
var start = parseInt(cf.port_start.value, 10);
var stop = parseInt(cf.port_end.value, 10);
if (start<= 0
|| start >= 65535
|| stop <= 0
|| stop >= 65535
|| start > stop) {
return 1;
... | [
"function checkNewPortValidation(val){\n\tvar msg = \"Maximum port must not over is 65535.\"\n\tif (val>=65535) {\n\t\terror(msg,\"Notification\");\n\t}\n}",
"function CheckBadNumberRange(str, min, max, defMsg, msg, isQuite)\n{\n var result = false;\n var num = parseInt(str);\n if (!((num >= min && num <= max)... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets or sets the error border color to use. | get errorBorder() {
return brushToString(this.i.d9);
} | [
"get borderColor() {\n return brushToString(this.i.g5);\n }",
"get actualBorderWidth() {\n return this.i.bu;\n }",
"setBorderColour(state, keyString) {\n // Set new hex to the default, then change depending on the string supplied\n let newColour = '#afdffd'\n if(keyString === ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns the 'hasText' status of all PageElements managed by PageElementMap as a result map after performing the initial waiting condition of each managed PageElement. A PageElement's 'hasText' status is set to true if its actual text equals the expected text. | getHasText(texts) {
return this.eachCompare(this.$, (element, expected) => element.currently.hasText(expected), texts);
} | [
"getHasText(texts) {\n return this._node.eachCompare(this._node.$, (element, expected) => element.currently.hasText(expected), texts);\n }",
"getContainsText(texts) {\n return this.eachCompare(this.$, (element, expected) => element.currently.containsText(expected), texts);\n }",
"getContains... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get all the moves player being made | getPlayerMoves() {
return this.moves;
} | [
"findAllMoves(board = this.board) {\n if (board.isFinished)\n return [];\n\n let allMoves = [];\n\n let start = (board.turn === 0) ? 0 : 10;\n let end = start + 10;\n let wasNotPlacedMoved = false;\n\n for (let pieceId = start; pieceId < end; pieceId++) {\n const loc = board.findPieceLoc... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This function is used to strike through text by changing the id to strike or no strike depending on its current state. | function strike(ele)
{
if (ele.id == "strike")
{
ele.id = "nostrike"
}
else
{
ele.id = "strike";
}
} | [
"function strikeThrough() {\n document.execCommand('strikeThrough', false, '');\n browser.storage.local.set({\n key: txtArea.innerHTML\n });\n}",
"function strikeClass(className)\n{\n rows = document.getElementsByTagName(\"tr\"); \n for( var i=0; eachRow = rows[i]; i++ )\n { \n if (className... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Whether the given month is enabled. | _shouldEnableMonth(month) {
const activeYear = this._dateAdapter.getYear(this.activeDate);
if (month === undefined || month === null ||
this._isYearAndMonthAfterMaxDate(activeYear, month) ||
this._isYearAndMonthBeforeMinDate(activeYear, month)) {
return false;
... | [
"shouldEnableMonth(month) {\n const activeYear = this.dateAdapter.getYear(this.activeDate);\n if (month === undefined || month === null ||\n this.isYearAndMonthAfterMaxDate(activeYear, month) ||\n this.isYearAndMonthBeforeMinDate(activeYear, month)) {\n return false;\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
! checkTabIcon ! Actions for menu or back button ! ! QML: All | function checkTabIcon(){
if (tabGroup.currentTab == tab1)
{
if (pageStackTab1 == 1)
menu()
else
{
//! Go Back
tab1.pop()
}
}
else
{
if (pageStackTab2 == 1)
menu()
else
{
if(refP... | [
"function initializePageAction(tab) {\n if (urlIsApplicable(tab.url)) {\n browser.pageAction.setIcon({tabId: tab.id, path: \"icons/off.svg\"});\n browser.pageAction.setTitle({tabId: tab.id, title: TITLE_APPLY});\n browser.pageAction.show(tab.id);\n }\n}",
"function i2uiToggleTabNoop()\r\n{\r\n}",
"fu... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Remove a Session from DB | static async destroy(id) {
db.del(`session:${id}`)
} | [
"logoutUser() {\n this.get('session').invalidate();\n }",
"function removeFromSession(key) {\n if (sessionStorage) {\n if (sessionStorage[key]) {\n delete sessionStorage[key];\n }\n }\n else {\n throw Error(\"Session storage not supported\");\n }\n}",
"functio... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Detect resource stack association | async function getResourceStackAssociation() {
templates = {};
await sdkcall("CloudFormation", "listStacks", {
StackStatusFilter: ["CREATE_COMPLETE", "ROLLBACK_IN_PROGRESS", "ROLLBACK_FAILED", "ROLLBACK_COMPLETE", "DELETE_FAILED", "UPDATE_IN_PROGRESS", "UPDATE_COMPLETE_CLEANUP_IN_PROGRESS", "UPDATE_COM... | [
"get resourceStack() {\n const actionResource = this.actionProperties.resource;\n if (!actionResource) {\n return undefined;\n }\n const actionResourceStack = core_1.Stack.of(actionResource);\n const actionResourceStackEnv = {\n region: actionResourceStack.re... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns the total gas amount of the result, separated by the types of operations (service / app) (esp. multioperation result). | static getTotalBandwidthGasAmount(op, result) {
const gasAmount = { service: 0 };
if (!op || !result) return gasAmount;
if (result.result_list) {
for (const [index, res] of Object.entries(result.result_list)) {
CommonUtil.mergeNumericJsObjects(
gasAmount,
CommonUtil.getTota... | [
"total() {\n return Menu.getSodaPrice();\n }",
"function getTotal(){\t\t\n\t\t\tswitch (lastOperator[lastOperator.length - 1]){\n\t\t\t\t//Addition\n\t\t\t\tcase operators[0]:\n\t\t\t\t\ttotal += currentVal;\n\t\t\t\t\tprimaryOutput.innerHTML = Number(total.toFixed(6));\n\t\t\t\t\tbreak;\n\t\t\t\t//Subt... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get the columns heights | function getColumnHeights(columns) {
var columnHeights = [];
var i;
for (i in columns) {
var h = 0;
if (columns[i].length) {
var lastItem = columns[i][columns[i].length - 1];
h = lastItem.pos.y + lastItem.dimensions.height;
}
columnHeights.push(h);
... | [
"getCols() {\r\n let cols = Math.floor(Math.ceil(this.getWidth() / 100) / 2) * 2;\r\n\r\n return cols > 0 ? cols : 1;\r\n }",
"function getHeight() {\n return 2;\n }",
"function getNumCols () {\n if (typeof settings.cols === 'function') {\n return settings.cols($win.width(... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
add tag to output | function addTag(input) {
if (!input) {
return;
}
var tag = createTag(input);
tagOutput.appendChild(tag);
} | [
"_generateTagLine(newVersion, currentVersion) {\n if (this.repoUrl && Str.weaklyHas(this.repoUrl, 'github.com')) {\n return (`## [${newVersion}](${this.repoUrl}/compare/v${currentVersion}...v${newVersion}) - ` +\n `(${Moment().format('YYYY-MM-DD')})`)\n } else {\n return (`## ${newVersion} - ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Initialization of events for import button, and checklist name edition button. | function eventHandler() {
var btnImport = document.getElementById('import');
btnImport.onclick = function () {
var files = document.getElementById('selectFiles').files;
var fr = new FileReader();
fr.onload = function (e) {
dataVallydette = JSON.parse(e.target.result);
if (dataVallydette.checklist.refe... | [
"static initStaticEvents() {\n\n // Save button for saving GeneralInfo\n\n $('.stepWrapper:nth-of-type(1) .saveBtn').click(()=>{\n \n this.update();\n\n })\n\n }",
"function init() {\n id(\"add\").addEventListener(\"click\", newList);\n }",
"function fnBindEvent... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
CONCATENATED MODULE: ./src/lab/common/models/tickhistory.js Class which handles tick history. It supports saving and restoring state of core state objects defined by the modeler and engine. However, while adding a new object which should also be saved in tick history, consider utilization of "external objects" this is ... | function TickHistory(modelState, model, size) {
var tickHistory = {},
initialState,
list,
listState,
defaultSize = 1000,
// List of objects defining TickHistoryCompatible Interface.
externalObjects = [],
// Provide the "old" interface for models that don't use PropertySupport yet... | [
"function push() {\n var lastState = newState(),\n i;\n copyModelState(lastState);\n list[listState.index + 1] = lastState; // Drop the oldest state if we went over the max list size\n\n if (list.length > listState.maxSize) {\n list.splice(0, 1);\n listState.startCounter++;\n } else ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This is a function for postV3ProjectsIdSnippets | postV3ProjectsIdSnippets(incomingOptions, cb) {
const Gitlab = require('./dist');
let defaultClient = Gitlab.ApiClient.instance;
// Configure API key authorization: private_token_header
let private_token_header = defaultClient.authentications['private_token_header'];
private_token_header.apiKey = 'YOUR API ... | [
"postV3ProjectsIdTriggers(incomingOptions, cb) {\n const Gitlab = require('./dist');\nlet defaultClient = Gitlab.ApiClient.instance;\n// Configure API key authorization: private_token_header\nlet private_token_header = defaultClient.authentications['private_token_header'];\nprivate_token_header.apiKey = ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Funcion que calcula el promedio de edad de 5 personas que van a recibir la vacuna del Covid19 creo la funcion que hace el calculo | function promedioDeEdad(a,b,c,d,e){
let suma = a+b+c+d+e;
let promedio = suma/5
return promedio
} | [
"calcNbJoursActivite(facture, dureeForfait) {\n\n // si tout le mois est payé au forfait\n if (dureeForfait == null) {\n facture.nombreJoursActivite = facture.nbJoursPresenceTheo * (52 - facture.nbSemainesCongesAssMat - facture.nbSemainesCongesEmployeur)/12 - facture.nbJoursAbsence + facture.nbJoursPrese... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Changing the user's default timeout Ask user for the newDefaultTime | function changeDefaultTimeOut() {
let user = db.ref('users/' + userId);
const newDefaultTime = app.getArgument('newDefaultTime');
if (newDefaultTime && (newDefaultTime * 60) > 0) {
let minutes = parseInt(newDefaultTime) * 60;
let promise = user.set({userId: userId, defa... | [
"function setLogOutTime(){\r\n\thour = prompt(output(11), \"23\");\r\n\ttime = new Date();\r\n\ttime.setHours(hour,\"0\", \"0\", \"0\");\r\n\ttimeToLogOut = parseInt(time.getTime());\r\n\tif (timeToLogOut < parseInt(new Date().getTime())){\r\n\t\ttimeToLogOut += 86400000;\r\n\t}\r\n\tGM_setValue(\"logOutTime\", tim... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Evaluates whether the new reading >= previous reading | static evalReadingGreaterThanOrEqualPreviousReading(context, dict) {
return (libLocal.toNumber(context, dict.ReadingSim) >= libLocal.toNumber(context, dict.PrevReadingValue));
} | [
"static evalPreviousReadingGreaterThanOrEqualReading(context, dict) {\n return (libLocal.toNumber(context, dict.PrevReadingValue) >= libLocal.toNumber(context, dict.ReadingSim));\n }",
"static evalPreviousReadingEqualsReading(context, dict) {\n return (libLocal.toNumber(context, dict.PrevReadingV... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Return a new ``bytes30`` type for %%v%%. | static bytes30(v) { return b(v, 30); } | [
"static bytes29(v) { return b(v, 29); }",
"static bytes18(v) { return b(v, 18); }",
"static bytes23(v) { return b(v, 23); }",
"static bytes25(v) { return b(v, 25); }",
"static bytes28(v) { return b(v, 28); }",
"static bytes19(v) { return b(v, 19); }",
"static bytes15(v) { return b(v, 15); }",
"static ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Send an InputResponse for NextProblemIntervention to server. arg will be something like "&answer=YES" | function sendNextProblemInputResponse (arg) {
// send an InputResponse to the server with NO. callback fn should be processNextProblemResult
servletGet("InputResponseNextProblemIntervention","&probElapsedTime="+globals.probElapsedTime + "&destination="+globals.destinationInterventionSelector + arg,
pr... | [
"function sendInterventionDialogYesNoConfirmInputResponse (event, fn, userInput) {\n\n incrementTimers(globals);\n servletFormPost(event, \"&probElapsedTime=\"+globals.probElapsedTime + \"&destination=\"+globals.destinationInterventionSelector + \"&userInput=\"+userInput,\n fn) ;\n}",
"function want... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Put the given peer in the banned IP list. | banPeer(peer) {
if (this.options.banTimeout) {
this.logger.info('Banning IP %s.', peer.address);
this.closeClient(this.peerKey(peer));
this.bans[peer.address] = {
timestamp: Date.now()
};
}
} | [
"function addPeer(gun, ip, port) {\n //const oldPeers = gun.opt()['_'].opt.peers;\n return gun.opt({peers: [`http: *${ip}:${port}/gun`]}); // Should these be linked both ways?\n }",
"addPeer() {\n\t}",
"addPeer(peer) {\n\t\t// Create or update the node\n\t\tthis.peers.set(peer.id, peer);\n\n\t\tif(! pe... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
The BestFitMatcher abstract operation compares requestedLocales, which must be a List as returned by CanonicalizeLocaleList, against the locales in availableLocales and determines the best available language to meet the request. The algorithm is implementation dependent, but should produce results that a typical user o... | function /* 9.2.4 */BestFitMatcher(availableLocales, requestedLocales) {
return LookupMatcher(availableLocales, requestedLocales);
} | [
"async buildLikelyLocaleTable() {\n let localeList = [];\n\n if (process.platform === 'linux') {\n let locales = await spawn('locale', ['-a'])\n .reduce((acc,x) => { acc.push(...x.split('\\n')); return acc; }, [])\n .toPromise()\n .catch(() => []);\n\n d(`Raw Locale list: ${JSON... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Switches from advanced search to search results | function searchtoresults()
{
showstuff('results');
hidestuff('interests');
} | [
"function perform_search() {\n if (lastSearchType == \"D\") {\n searchHistory();\n } else if (lastSearchType == \"E\") {\n searchEpg();\n }\n }",
"function doSearch(){\n document.SearchCustomer.search.value = true;\n document.SearchCustomer.curpos.value=0;\n submit('... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Parses a lexicon in JSON or text format | function Lexicon(filename, defaultCategory, defaultCategoryCapitalised) {
this.lexicon = {}; //Object.create(null);
if (filename) {
this.defaultCategory = defaultCategory;
// Read lexicon
try {
var data = fs.readFileSync(filename, 'utf8');
if (data[0] === "{") {
// Lexicon is in JSO... | [
"consoleParseTypes(input) { return Parser.parse(input, { startRule: 'TYPES' }); }",
"function pushlex(type, info) {\n var result = function(){\n lexical = new CSharpLexical(indented, column, type, null, lexical, info)\n };\n result.lex = true;\n return result;\n }",
"function WordP... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Outra forma de se fazer a mesma coisa em adicionaNegociacao(event) | adiciona(event) {
event.preventDefault();
alert('Entrou no método adiciona do controller');
try{
this._listaNegociacoes.adiciona(this._criaNegociacao());
this._mensagem.texto = 'Negociacao adicionada com sucesso';
// this._mensagemView.update(this._mensagem);
c... | [
"function isNotProductAction(event) {\n return (\n event.EventCategory ===\n mParticle.CommerceEventType.ProductImpression ||\n event.EventCategory === mParticle.CommerceEventType.PromotionView ||\n event.EventCategory === mParticle.CommerceEventType.PromotionC... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Opens the tooltip. This is considered to be a "manual" triggering. The `context` is an optional value to be injected into the tooltip template when it is created. | open(context) {
if (!this._windowRef && this._ngbTooltip && !this.disableTooltip) {
const { windowRef, transition$ } = this._popupService.open(this._ngbTooltip, context, this.animation);
this._windowRef = windowRef;
this._windowRef.instance.animation = this.animation;
... | [
"function showTooltip(content, event) {\n tt.style('opacity', 1.0)\n .style('pointer-events', 'all')\n .html(content);\n\n updatePosition(event);\n }",
"function doOpenTool(ev, title, url, width, height)\n{\n // ev.button appears to be undefined in trunk builds...\n // it comes out as 65535\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Convert relative percent length to absolute pixel. | function _toAbsLength(base, value) {
if (typeof value == 'string' && value.charAt(value.length - 1) == '%') {
var s = value.substring(0, value.length - 1);
return base * Number(s) / 100;
}
return Number(value);
} | [
"function percentToPixel(size, max)\n{\n let percentRegexp = /^[0-9]{1,3}%$/;\n let pixelRegexp = /^[0-9]*px$/;\n\n if (pixelRegexp.exec(size))\n {\n return parseInt(size);\n }\n else if (percentRegexp.exec(size))\n {\n return (parseInt(size) / 100.0) * max;\n }\n else\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Data parsing / Get all the image files names in the defined folder from the server, and returns them as Image Objects. (folder: path to the requested folder to get images) | function GetImagesFromFolder(folder) {
var files = []; //array to save images
//use ajax command to request file names from the server, and save as IMage objects
$.ajax({
url: folder,
async: false, //to ensure all data points have been added before we continue
success: function ... | [
"function importAll(r) {\n var images = [];\n r.keys().map((item) => \n { \n var src = item.replace('./',''); // DRY stuff\n images.push(\n {\n src: src, // E.g. Glasses/glasses1.png\n img: r(item), // The image\n type: src.substr(0,src.indexOf('/')), // e.g. Glasses\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
============================================= function that fetches profile data and runs the promise chain ============================================= | function fetchProfileData(){
fetch('https://api.fitbit.com/1/user/-/profile.json',
{
headers: {
"Authorization": `Bearer ${localStorage.getItem("ourtoken")}`
}
}
)
.then(j => {
if (!j.ok) {
throw new Error('network response not ok');
... | [
"function initCrawlProfile() {\n browser.init();\n return loadProfile();\n}",
"function initCrawlProfile() {\n browser.init();\n return loadProfile();\n}",
"function fetch_order_profiles_list()\n{\n\t/*\n\torder_profiles_list[profile_id]\n\t.name\n\t.default\n\t.profile_id \n\t.type\n\t.products_list[pr... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Fetch alls tags that a post belongs to | async tags(post) {
return await post.getTags();
} | [
"function getTags(post) {\n var tags = [];\n post.find('.tags').children('span.label').each(function() {\n tags.push($(this).text());\n });\n return tags;\n }",
"async getPosts () {\n\t\tconst postIds = this.models\n\t\t\t.filter(codemark => !codemark.get('providerType'))\n\t\t\t.map(codemark =>... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
getFillerWords returns array of only filler words | function getFillerWords(data) {
return data.filter(function (d) {return d.filler; });
} | [
"function grabDummyWords() {\n\t var dummyWords = [];\n\t for (i in Questions.question) {\n\t\t\tdummyWords += Questions.question[i].answer.split(\" \");\n\t }\n\t return dummyWords;\n }",
"words(content) {\n //@TODO\n let content_array = content.split(/\\s+/);\n const normalized_content =... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Custom type guard for RelativeUriString. Returns true if node is instance of RelativeUriString. Returns false otherwise. Also returns false for super interfaces of RelativeUriString. | function isRelativeUriString(node) {
return node.kind() == "RelativeUriString" && node.RAMLVersion() == "RAML10";
} | [
"function extPart_getIsNodeRel(partName)\n{\n return (String(extPart.getLocation(partName)).search(/node/i) != -1);\n}",
"isValidUrl(string) {\r\n\t\ttry {\r\n\t\t\tnew URL(string);\r\n\t\t\treturn true;\r\n\t\t} catch (_) {\r\n\t\t\treturn false; \r\n\t\t}\r\n\t}",
"function hasResourceLink(req) {\n\t\tvar l... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
end of roleBalancer helping functions returns Container Object > minEnergyLimit | function getClosestContainer(creep, minEnergyLimit) {
var conn = [];
for(var i = 0; i < containerIDs.length; ++i) {
var con = Game.getObjectById(containerIDs[i]);
if(_.sum(con.store) > minEnergyLimit) {
conn[conn.length] = Game.getObjectById(containerIDs[i]);
}
}
var... | [
"function checkUEC(targetBlock) {\n if (targetBlock.id.equals('mekanism:ultimate_energy_cube')) {\n if (!!targetBlock.entityData.EnergyContainers[0]) {\n if (!!targetBlock.entityData.EnergyContainers[0].stored) {\n if (targetBlock.entityData.EnergyContainers[0].stored == 4096000000) {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get the frequency response curve. This curve represents how the filter responses to frequencies between 20hz20khz. | getFrequencyResponse(len = 128) {
// start with all 1s
const freqValues = new Float32Array(len);
for (let i = 0; i < len; i++) {
const norm = Math.pow(i / len, 2);
const freq = norm * (20000 - 20) + 20;
freqValues[i] = freq;
}
const magValues = new Float32Array(len);
const ph... | [
"function getFrequency(value) {\n\tif (!ctx) {\n\t\treturn 0;\n\t}\n\t// get frequency by passing number from 0 to 1\n\t// Clamp the frequency between the minimum value (40 Hz) and half of the\n\t// sampling rate.\n\tvar minValue = 40;\n\tvar maxValue = ctx.sampleRate / 2;\n\t// Logarithm (base 2) to compute how ma... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Adds an artist to the database if no one has liked them before | function crawlArtist(user, artist) {
model.Artist.find({ where: { facebookId: artist.id } })
.then(function(result) {
if (_.isEmpty(result)) {
model.Artist.create({ name: artist.name, facebookId: artist.id })
.then(function(result) {
crawlLike(user, result.values);
})
.catch(func... | [
"function crawlLike(user, artist) {\n model.Like.find({ where: { user: user.id, artist: artist.id } })\n .then(function(like) {\n if (_.isEmpty(like)) {\n model.Like.create({ user: user.id, artist: artist.id });\n }\n })\n .catch(function(err) {\n console.log(err);\n });\n}",
"addArtist(artistD... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Handles header values, replaces or adds (if needed) a charset property | _handleCharset() {
var parts = (this._table.headers['content-type'] || 'text/plain').split(';');
var contentType = parts.shift();
var charset = formatCharset(this._table.charset);
var params = [];
params = parts.map(function(part) {
var parts = part.split('=');
... | [
"function setHeaderProp(name, value) {\n _HEADER[name] = value;\n}",
"function HeaderDecoder(direction) {\n this.encodingContext_ = new EncodingContext(direction);\n}",
"setHeader(key, value) {\n this._headers[key] = value\n }",
"handleUTF8() {\n var decodeParamType = support.uint8array ? \... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
function take multiple inputs, and assign all of this into a variable marks in the class | assignMarks(maths, english, science) {
this.marks.push({
mathMarks: maths,
englishMarks: english,
scienceMarks: science
});
} | [
"set_marks(mark) {\n this.V.forEach(v => {\n v.mark = mark;\n });\n }",
"function coursework(mark3){\n var mark3, finalAssesment \n var testmark = marks(68,75)\n //console.log(mark3)\n finalAssesment = (mark3 + testmark)*0.4 // adds test marks to best test mark and multiplies res... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
The main functions that moves nodes around Move connected nodes if they're too far away or too close together. Move nodes away from each other if they're too close together. | function moveNodes(nodes, connections) {
//Acceptable error should grow over time so that we always get something eventually.
let didWiggle = false;
let a, b;
let changeArr;
connections.forEach(connection => {
//iterate through connections forward and backwards in less code.
a = conn... | [
"function moveNodeBasedOnDistanceToAnother(nodeA, nodeB, targetDistance, acceptableError, comparison) {\n let nextX;\n let nextY;\n let magnitude;\n let radianPointA;\n let direction;\n let needCorrectionA;\n let didWiggle = false\n let distance = findDistance(nodes[nodeA], nodes[nodeB]);\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
asign blob address of uploaded image to img | onFileChange(event) {
const file = event.target.files[0];
this.img = URL.createObjectURL(file);
} | [
"function loadImg(img, target_name) {\n if (img.files && img.files[0]) {\n var FR = new FileReader();\n FR.onload = function (e) {\n //e.target.result = base64 format picture\n $('#' + target_name + '_preview').attr(\"src\", e.target.result);\n $('#' + target_name +... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
this is the base class for a subprovider mostly helpers | function SubProvider() {} | [
"function ParentThirdPartyInterface() {}",
"function ParentThirdPartyClass() {}",
"setProvider(provider) {\n this.provider = provider;\n }",
"initializeProvider() {\n if (this.graphProxyUrl !== undefined) {\n this.provider = new ProxyProvider(this.graphProxyUrl);\n Provi... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets up a DishWorker to be used for performing Dish operations | setupDishWorker() {
if (this.dishWorker.worker !== null) {
this.dishWorker.worker.terminate();
this.dishWorker.currentAction = "";
}
log.debug("Adding new DishWorker");
this.dishWorker.worker = new DishWorker();
this.dishWorker.worker.addEventListener("me... | [
"setupChefWorker() {\n for (let i = this.chefWorkers.length - 1; i >= 0; i--) {\n this.removeChefWorker(this.chefWorkers[i]);\n }\n\n this.addChefWorker();\n this.setupDishWorker();\n }",
"initWorker(worker) {\r\n worker.setRetryTime(FATUS_EQ_RETRY_TIME);\r\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
trimNull() ========== Removes null elements from an array | function trimNull(array){
for(var i = 0; i<array.length; i++) {
if(array[i] == null) {
array.splice(i--, 1);
}
}
} | [
"function trimArray(arr) {\n for(i=0;i<arr.length;i++)\n {\n arr[i] = arr[i].replace(/^\\s\\s*/, '').replace(/\\s\\s*$/, '');\n }\n return arr;\n}",
"function trimTrailingNulls(parameters) {\r\n while (isNull(parameters[parameters.length - 1])) {\r\n parameters.pop();\r\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
deletes data with the passed index | deleteDataByIndex(index) {
this.content.splice(index, 1);
} | [
"function deleteData(index) {\r\r\n try {\r\r\n var tbData = JSON.parse(localStorage.getItem(\"tbData\"));\r\r\n\r\r\n tbData.splice(index, 1);\r\r\n\r\r\n if(tbData.length == 0) {\r\r\n localStorage.removeItem(\"tbData\");\r\r\n } else {\r\r\n localStorage.setItem(\"tbData\", JSON.stringify(... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
When setting css, check for element and apply new values / eslintdisablenextline accessorpairs | set css(val) {
if (this.vueMeta) {
if (this.isVueMeta23) {
this.applyVueMeta23();
}
return;
}
this.checkOrCreateStyleElement() && (this.styleEl.innerHTML = val);
} | [
"_setCss(propertyName) {\n if (isPresent(get(this, propertyName))) {\n this.element.style[propertyName] = get(this, propertyName);\n }\n }",
"_updateContentStyle() {\r\n\t\tconst style = game.settings.get('narrator-tools', 'TextCSS');\r\n\t\tif (style) {\r\n\t\t\tconst opacity = this.elements.content[... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Indicates if view should be restored from EventStore on start. Override for custom behavior. | get shouldRestoreView() {
return this.view instanceof Map
} | [
"get reconfigured() {\n return this.startState.config != this.state.config\n }",
"function isSnapped() {\n return Windows.UI.ViewManagement.ApplicationView.value === Windows.UI.ViewManagement.ApplicationViewState.snapped;\n }",
"function restoreMapView() {\n var map_pos_params = /[#... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
convert distance meters on earths surface to radians subtended at the centre | static m2rad(distance) {
return distance / this.EARTH_RADIUS;
} | [
"static get_distance_m(p1, p2) {\n var dLat = this.deg2rad(p2.lat - p1.lat);\n var dLong = this.deg2rad(p2.lng - p1.lng);\n var a = Math.sin(dLat / 2) * Math.sin(dLat / 2) +\n Math.cos(this.deg2rad(p1.lat)) * Math.cos(this.deg2rad(p2.lat)) *\n M... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
only the characters from that string whose binary representation of its ASCII value consists of more zeros than ones. You should remove any duplicate characters, keeping the first occurence of any such duplicates, so they are in the same order in the final array as they first appeared in the input string. Examples 'abc... | function moreZeros(s) {
s = [... new Set(s)].join('')
const result = []
s.split('').forEach((el, index) => {
const e = s.charCodeAt(index).toString(2)
let zeros = 0
let ones = 0
if (e.match(/0/g) !== null) zeros = e.match(/0/g).length
if (e.match(/1/g) !== null) on... | [
"function compression(str){\n \n let output = '';\n let count = 0;\n for(let i = 0; i < str.length; i++) {\n count++;\n if(str[i] != str[i + 1]) {\n output += str[i] + count;\n count = 0;\n }\n }\n return output; \n }",
"function ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
get campaign performance report via campaign id | function getCampaignPerformance() {
var entityIdFieldName = 'CampaignId';
var reportName = 'CAMPAIGN_PERFORMANCE_REPORT';
var performance = {};
var query =
"SELECT CampaignId, AbsoluteTopImpressionPercentage " +
"FROM CAMPAIGN_PERFORMANCE_REPORT " +
"... | [
"static serveReport(id){\n\t\tlet kparams = {};\n\t\tkparams.id = id;\n\t\treturn new kaltura.RequestBuilder('livereports', 'serveReport', kparams);\n\t}",
"getCampaignData(partnerId, campaignId, period_length = null) {\n if (!partnerId || !campaignId) throw 'Both partnerId and campaignId must be specified... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Clear out eligable list and hide the schedule info section | function clearEligables() {
$eligableList.empty();
} | [
"function displayEligables(data) {\r\n clearEligables();\r\n $removeScheduleBtn.removeClass(\"inactive-btn\");\r\n $editScheduleBtn.removeClass(\"inactive-btn\");\r\n $scheduleInfo.css(\"display\", \"block\");\r\n\r\n var info = JSON.parse(data);\r\n var eligableList = info[\"eligable_list\"];\r\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Creates an expression with the given type and attributes | function expression(expr, attr) {
const expression = { expression: expr };
if (attr)
for (let a in attr)
expression[a] = attr[a];
return expression;
} | [
"function createNode(type, attributes, props) {\r\n var node = document.createElement(type);\r\n if (attributes) {\r\n for (var attr in attributes) {\r\n if (! attributes.hasOwnProperty(attr)) continue;\r\n node.setAttribute(attr, attributes[attr]);\r\n }\r\n }\r\n if (props) {\r... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Cadastra uma unidade no sistema do helpdesk | function cadastrarUmaUnidade(){
var unidadeSelecionadaBDTRE = DWRUtil.getValue("comboUnidadeTRE");
if(unidadeSelecionadaBDTRE==null || unidadeSelecionadaBDTRE==''){
alert("Selecione uma unidade a ser cadastrada.");
}else{
FacadeAjax.cadastrarUnidadeDefault(unidadeSelecionadaBDTRE);
//carregarListaUnidadesCada... | [
"function Entitlement() {}",
"getUltimoTicket() {\n return `Ticket ${ this.ultimo }`;\n }",
"function carregarFormatoDaUnidade(){\n\tvar unidadeSelecionada = DWRUtil.getValue(\"comboUnidade\");\n\tif (unidadeSelecionada!=null || unidadeSelecionada!=''){\n\t\ttratarSuporte(unidadeSelecionada);\n\t}else... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Checks whether it's time for a break or not, if it is, it sets the current time to 5 minutes | checkIfBreak() {
if(this.isBreak) {
this.isBreak = false;
this.setState({ currentTime: this.defaultTime });
} else {
this.isBreak = true;
this.setState({ currentTime: 5000 * 60 });
}
} | [
"setBakingTime() {}",
"function setTime() {\n var timerInterval = setInterval(function() {\n var currentTime= moment().format();\n setColor();\n\n if(currentTime === \"11:59:59 pm\") {\n clearInterval(timerInterval);\n localStorage.clear();\n location.reload(); \n }\n\n }, 1800000);\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
primo passo per inserire una nuova annotazione; ricava il testo selezionato, se esiste, e procede a registrare l'annotazione | function newAnnotation(type) {
updateAutori();
//ricavo il testo selezionato
selezione = selection();
//differenza tra selezione e fragmentselection: per operare sui nodi serve il primo, poichè è sostanzialmente
//un riferimento all'interno del documento; il secondo invece estrapola dallo ... | [
"function setAnnotation()\n{\n var tipo;\n var tipo2;\n var attr;\n numAnnTot++;\n \n //in base al tipo di annotazione si inseriscono i dati relativi\n if ($('#inserimentocommento').css('display') === 'block') {\n tipo = 'hasComment';\n tipo2 = 'commento';\n attr = $('#inse... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This is the function for the flashCard object. Input: num_operations will typically be 2 or 4. 2 generates a flashCard with addition or subtraction. 4 generates a flashCard with addition, subtraction, multiplication, or division. 0 or 1: +, 2: +, 3: +, 4: + | function flashCard(num_operations){
this.answer = 11;
this.a = 0;
this.b = 0;
this.op = Math.floor((Math.random() * num_operations)); // 0==+, 1==-, 2==*, 3==/
while ((this.answer > 10) || (this.answer < 0)) {
this.a = Math.floor((Math.random() * 10) + 1);
... | [
"function flashCardHard(num_operations){\n this.answer = 100;\n this.a = 0;\n this.b = 0;\n\n this.op = Math.floor((Math.random() * num_operations)); // 0==+, 1==-, 2==*, 3==/\n \n while ((this.answer > 99) || (this.answer < 0)) {\n switch (this.op){\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
perform person lookup using id Craig | function lookupPersonByID(id, people) {
let person = people.find(function (person) {
if (person.id === id) {
return person;
} else {
return undefined;
}
});
console.log('selected: ', person);
return person; // person
} | [
"function findPerson(id) {\n var foundPerson = null;\n for (var i = 0; i < persons.length; i++) {\n var person = persons[i];\n if (person.id == id) {\n foundPerson = person;\n break;\n }\n }\n\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Finds the next appropriate chip to move focus to, if the currentlyfocused chip is destroyed. | _redirectDestroyedChipFocus() {
if (this._lastDestroyedFocusedChipIndex == null) {
return;
}
if (this._chips.length) {
const newIndex = Math.min(this._lastDestroyedFocusedChipIndex, this._chips.length - 1);
const chipToFocus = this._chips.toArray()[newIndex];
... | [
"function shiftFocus(previousCard,nextCard){\n $(\"#gameboard\").children().eq(previousCard).removeClass(\"focus\");\n $(\"#gameboard\").children().eq(nextCard).addClass(\"focus\");\n cardInFocus = nextCard;\n}",
"function searchNextFocus(right) {\n if (!PRIVATE.player.focus) {\n return null;\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
hides the scroll bar after darg end automatically | function hideScrollBar(info) {
window["__checkBudget__"]();
setState({
contentH: state.contentH,
scrollBarHeight: scrollBarHeight(Math.round(info.point.y), state.contentH),
scrollBarYPos: scrollBarAmount(Math.round(info.point.y), state.contentH),
scrollBar... | [
"cancelScroll() {\n this._isScrollLocked = false;\n }",
"function _hideEndScreen() {\r\n hideEndScreen();\r\n }",
"function scrollDownPage() {\n window.scrollBy(0, 10000000);\n postToBox(\"Clear Requests \\n Scrolling…\");\n}",
"function __scrollHandler__() {\n\t\tvar topMostDlg = __findTopMos... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Download the model in STL format | downloadModelSTL() {
this.emitWarningMessage("Preparing STL file...", 60000);
this.props.loadingToggle(true);
window.LITHO3D.downloadSTL(1, 1, 1, true, false).then(() => {
this.props.loadingToggle(false);
this.emitWarningMessage("File is ready for download.", 500);
})
.catch(err => {
this.props.loa... | [
"downloadModelOBJ() {\n\t\tthis.emitWarningMessage(\"Preparing OBJ file...\", 60000);\n\t\tthis.props.loadingToggle(true);\n\t\twindow.LITHO3D.downloadOBJ(1, 1, 1, true).then(() => {\n\t\t\tthis.props.loadingToggle(false);\n\t\t\tthis.emitWarningMessage(\"File is ready for download.\", 500);\n\t\t})\n\t\t\t.catch(e... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
called from Socket.send typically adds instruction to ds_instance.instruction_queue | static send(robot_name, arr_buff){
let instruction_array = this.array_buffer_to_oplet_array(arr_buff) //instruction_array is in dexter_units
//out("Sim.send passed instruction_array: " + instruction_array + " robot_name: " + robot_name)
let ds_instance = DexterSim.robot_name_to_dextersim_instanc... | [
"sendNextCommand() {\n\t\tif (this.commandQueue.length > 0) {\n\t\t\tthis.socket.send(this.commandQueue[0]);\n\t\t\tthis.cts = false;\n\t\t}\n\t\telse {\n\t\t\tthis.cts = true;\n\t\t}\n\t}",
"async _sendMsg (cmd, arg1, arg2, payload) {\n let adbPacket = generateMessage(cmd, arg1, arg2, payload);\n await thi... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |