query stringlengths 9 34k | document stringlengths 8 5.39M | negatives listlengths 19 20 | metadata dict |
|---|---|---|---|
Provides: caml_dynlink_add_primitive Requires: caml_global_data | function caml_dynlink_add_primitive () {
return caml_global_data.prim_count++;
} | [
"function PushPrimitiveReference(value) {\n return [PushPrimitive(value), Object(_encoder__WEBPACK_IMPORTED_MODULE_2__[\"op\"])(31\n /* PrimitiveReference */\n )];\n}",
"function PushPrimitive(primitive) {\n var p = typeof primitive === 'number' && (0, _util.isSmallInt)(primitive) ? immediate(primitive) : p... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
enUS validation function Verify that the TIN starts with a valid IRS campus prefix | function enUsCheck(tin) {
return enUsGetPrefixes().indexOf(tin.substr(0, 2)) !== -1;
} | [
"function enUsCheck(tin) {\n return enUsGetPrefixes().indexOf(tin.substr(0, 2)) !== -1;\n}",
"function enIeCheck(tin) {\n var checksum = reverseMultiplyAndSum(tin.split('').slice(0, 7).map(function (a) {\n return parseInt(a, 10);\n }), 8);\n\n if (tin.length === 9 && tin[8] !== 'W') {\n checksum += (t... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This sample demonstrates how to Creates or updates an private endpoint in the specified resource group. | async function createPrivateEndpoint() {
const credential = new DefaultAzureCredential();
const client = createNetworkManagementClient(credential);
const subscriptionId = "";
const resourceGroupName = "rg1";
const privateEndpointName = "testPe";
const options = {
body: {
location: "eastus2euap",
... | [
"async function createPrivateEndpointWithApplicationSecurityGroups() {\n const credential = new DefaultAzureCredential();\n const client = createNetworkManagementClient(credential);\n const subscriptionId = \"\";\n const resourceGroupName = \"rg1\";\n const privateEndpointName = \"testPe\";\n const options = ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
6. Write a function which takes an object as a parameter and prints all the property names and their values. Also give the total number of properties in the object. | function propertiesAndValues(object) {
var numOfProps = 0;
for (var property in object) {
console.log(property + ": " + object[property]);
numOfProps++;
}
return numOfProps;
} | [
"function logProperties (object){\n let numberOfProperties = 0;\n for (let key in object){\n numberOfProperties += 1;\n }\n console.log(numberOfProperties);\n}",
"function ObjectEater(object) {\r\n\tvar properties=0\r\n\tfor (var key in object) {\r\n\t\tconsole.log(key+ \" : \" +object[key]);\r... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Creates the weather card | createWeatherCard() {
this.card = document.createElement("DIV");
// Card Header
this.header = document.createElement("DIV");
this.header.classList.add("weather-card-header");
// Card Body
this.weatherContainer = document.createElement("DIV");
this.weatherContainer.classList.add("weather-ca... | [
"function createWeatherCard(place, main, description, temp, icon, from) {\n //find the html container element for the dynamic contents to be added to.\n const weatherElement = document.querySelector('.cardList');\n const cardElement = document.createElement('div');\n cardElement.className = \"card list-... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Return variable names of declaration or assignment contained in node. | static getVariableNames(node) {
if (node.type === 'VariableDeclaration') {
let decl = node;
return decl.declarations.map(d => {
let varName = EsprimaHelper.patternToString(d.id);
return varName;
});
}
else if (node.type === 'Ass... | [
"function getVariables(node) {\n\n var vars = []\n function visit(node) {\n if(Array.isArray(node)) {\n for(var i=0; i<node.length; ++i) {\n visit(node[i])\n }\n } else {\n switch(node.type) {\n case \"EmptyStatement\":\n case \"ExpressionStatement\":\n case \"Brea... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
English: Open a popup with parameters to generate an array. The number of rows/columns can be modified. Some additional parameters are related to templates available on :fr | function popupTable()
{
var popup = window.open('','name','height=180,width=300,scrollbars=yes');
javaCode = '<script type="text\/javascript">function insertCode(){';
javaCode += 'var row = parseInt(document.paramForm.inputRow.value); '
javaCode += 'var col = parseInt(document.paramForm.inputCol.value); '
... | [
"function popupTableau()\n{\n var popup = window.open('','name','height=400,width=500');\n \n javaCode = '<script type=\"text\\/javascript\">function insertCode(){';\n javaCode += 'var row = parseInt(document.paramForm.inputRow.value); '\n javaCode += 'var col = parseInt(document.paramForm.inputCol.value); '\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
once tracing has finished capture trace logs into memory | async completeTracing () {
const traceDuration = Date.now() - this.traceStart
log.info(`Tracing completed after ${traceDuration}ms, capturing performance data for frame ${this.frameId}`)
/**
* download all tracing data
* in case it fails, continue without capturing any data
... | [
"fireTraces () { return this._traces }",
"finishTracing () {\n log.info(`Tracing for ${this.frameId} completed`)\n this.pageLoadDetected = false\n\n /**\n * clean up the listeners\n */\n NETWORK_RECORDER_EVENTS.forEach(\n (method) => this.session.removeListen... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Add a suggestion for a shacl constraint. | function sugShConstraint(){
const value = [document.getElementById("txtShProp").value];
const suggestion = getSugByType(value);
document.getElementById("txtShProp").value = suggestion;
} | [
"function addConstraint(){\n\t\t\tvm.constraints.push({\n\t\t\t\tlhs:'',\n\t\t\t\tinequality:'',\n\t\t\t\trhs: ''\n\t\t\t});\n\t\t}",
"addPlacementConstraint(constraint) {\n if (isFargateCompatible(this.compatibility)) {\n throw new Error('Cannot set placement constraints on tasks that run on Fa... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
engine_version computed: true, optional: false, required: false | get engineVersion() {
return this.getStringAttribute('engine_version');
} | [
"get actualEngineVersion() {\n return this.getStringAttribute('actual_engine_version');\n }",
"requireVersion(_version){\n requiredVersion = _version;\n }",
"get engineVersionActual() {\n return this.getStringAttribute('engine_version_actual');\n }",
"function ScriptEngineBuildVe... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Generation of the numbers that represent each of the blocks that will touch the bomb | function numGen(bombs) {
bombs.map(a => {
let area;
// defining how to look at each cell and determine whether to add a number
// specific for right side of the grid to not add numbers to cells on next line
if ((a + 1) % size === 0) {
area = [a - 1, a + size, a... | [
"function generateBombs(block , level){\n var num = (block / 100) * level;\n for(var i = 0 ; i < num.toFixed(0) ; i++){\n var bomb = Math.floor(Math.random() * block) ;\n bombArray.includes(bomb) ? i-- : bombArray.push(bomb);\n }\n}",
"function generateInsertionBlocks() {\n\n incrs[0] = Math.floor(M... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
shift all images one figure to the left, and change values in photoOrder array to match | function rightAdvance() {
for (var i = 0; i < 5; i++) {
if ((photoOrder[i] + 1) === 6) {
photoOrder[i] = 1;
} else {
photoOrder[i] += 1;
}
populateFigures();
}
} | [
"function rightAdvance() {\r\n for (var i = 0; i < 4; i++) {\r\n if ((photoOrder[i] + 1) === 5) {\r\n photoOrder[i] = 1;\r\n } else {\r\n photoOrder[i] += 1;\r\n }\r\n populateFigures();\r\n }\r\n }",
"changeOrderReverse() {\n const img = this.wrapper.removeChild... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
gets the users input of the berder name | function getHamberderName(){
const hamberderName = berderBoxEl.value;
return hamberderName;
} | [
"function getname(input) {\r\n \r\n }",
"function getName(){\n\treturn prompt(\"Enter your name\");\n}",
"function inputName(){\n\t\t\tuserdata.nameInput =getName.value;\n\t\t}",
"getName() {\n return inquirer.prompt([\n {\n type: 'input',\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Import an existing user given user attributes. If the ARN comes from a Token, the User cannot have a path; if so, any attempt to reference its username will fail. | static fromUserAttributes(scope, id, attrs) {
try {
jsiiDeprecationWarnings.aws_cdk_lib_aws_iam_UserAttributes(attrs);
}
catch (error) {
if (process.env.JSII_DEBUG !== "1" && error.name === "DeprecationError") {
Error.captureStackTrace(error, this.fromUser... | [
"static fromUserAttributes(scope, id, attrs) {\n class Import extends core_1.Resource {\n constructor() {\n super(...arguments);\n this.grantPrincipal = this;\n this.principalAccount = core_1.Aws.ACCOUNT_ID;\n this.userName = core_1.Arn.e... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Save all textgroups in collection inventory (will save all hierarchical related data in the collection>>textgroup>>work>>textNode tree) | async save() {
const title = this.title;
if (!title) {
winston.error(`Error ingesting Collection ${this.repoLocal}`);
return null;
}
console.log(this.urn);
const collection = await Collection.create({
title: title.slice(0, 250),
urn: this.urn,
repository: this.repoRemote,
});
for (let i... | [
"async save() {\n\t\tconst title = this.title;\n\t\tif (!this.title) {\n\t\t\twinston.error(`Error ingesting Collection ${this.repoLocal}`);\n\t\t\treturn false;\n\t\t}\n\n\t\tconst collection = await Collection.create({\n\t\t\ttitle: title.slice(0, 250),\n\t\t\trepository: this.repoRemote,\n\t\t\turn: this.urn,\n\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Reseller.list_task [PRODUCTION] [See on api.ovh.com]( | GetListOfTasks(serviceName) {
let url = `/hosting/reseller/${serviceName}/task`;
return this.client.request('GET', url);
} | [
"function getTaskLists() {\n\n}",
"function listTaskDetails() {\n client.request\n .get(\n \"https://<%=iparam.freshsales_subdomain%>.freshsales.io/api/tasks?filter=due_today\",\n options\n )\n .then(function (data) {\n console.log(data.response);\n let dd = JSON.parse(data.response)... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
initializeAutocomplete: Initializes google maps search places function with a restriction to only us locations. | function initializeAutocomplete() {
var input = document.getElementById('search_field');
searchBox = new google.maps.places.Autocomplete(input, {
types: ['(cities)'],
componentRestrictions: {country: 'us'}
});
// searchBox.setComponentRestrictions({'country': ['us']});
searchBox.addL... | [
"function initializeAutocomplete() {\n var input = document.getElementById('community_search_field');\n searchBox = new google.maps.places.Autocomplete(input);\n searchBox.setComponentRestrictions({'country': ['us']});\n searchBox.addListener('place_changed', setLocationValue);\n}",
"function initAuto... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
show notification and vibrate if available and allowed | function usageNotification() {
navigator.vibrate = navigator.vibrate || navigator.webkitVibrate || navigator.mozVibrate || navigator.msVibrate;
if (!("Notification" in window)) {
alert("Benachrichtigungen werden vom Browser nicht unterstützt");
}
else if (Notification.permission === "granted") ... | [
"function vibrate() {\n\t\t\tnavigator.notification.vibrate(2000);\n\t\t}",
"function vibrate() {\n navigator.notification.vibrate(2000);\n }",
"function vibrate() {\n navigator.notification.vibrate(2000);\n }",
"function vibrate() {\n\tnavigator.notification.vibrate(2000);\n}",
"function... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
If another page rendering in progress, waits until the rendering is finised. Otherwise, executes rendering immediately. | function queueRenderPage(num) {
if (pageRendering) {
pageNumPending = num;
} else {
renderPage(num);
}
} | [
"function queueRenderPage(num) {\nif (pageRendering) {\n pageNumPending = num;\n} else {\n renderPage(num);\n}\n}",
"function queueRenderPage(num) {\n if (pageRendering) {\n pageNumPending = num;\n } else {\n renderPage(num);\n }\n }",
"function queueRenderPage(num) {\n if (!l... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Chapter 12 After Class As a Domme, Jennifer can force the player into some random bondage | function C012_AfterClass_Jennifer_ForceRandomBondage(BondageType) {
if ((BondageType == "Full") || (BondageType == "Gag")) {
PlayerRandomGag();
if (!Common_PlayerGagged && (BondageType == "Gag")) OverridenIntroText = GetText("CantFindRestrain");
}
if ((BondageType == "Full") || (BondageType == "Restrain")) {
P... | [
"function C012_AfterClass_Amanda_ForceRandomBondage(BondageType) {\n\tif ((BondageType == \"Full\") || (BondageType == \"Hug\") || (BondageType == \"Gag\")) {\n\t\tPlayerRandomGag();\n\t\tif (!Common_PlayerGagged && (BondageType == \"Gag\")) OverridenIntroText = GetText(\"CantFindRestrain\" + (BondageType == \"Hug\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Number of padding octets to always add after this field. Structs only. | padding() {
const offset = this.bb.__offset(this.bb_pos, 28);
return offset ? this.bb.readUint16(this.bb_pos + offset) : 0;
} | [
"get byteCount () {\n return this._length + 6 + 1\n }",
"function getPadding() {\r\n\t\tvar pad = 0;\r\n\t\t$this.parents().each(function(){\r\n\t\t\tpad += parseInt($(this).css(\"padding-bottom\"));\r\n\t\t\tpad += parseInt($(this).css(\"margin-bottom\"));\r\n\t\t\tpad += parseInt($(this).css(\"borderBottomW... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
copies a file (fi) from fileurl to filedir | function copyFile(item,cb) {
request(item.url+item.file, function (err, response, body) {
if (err) return cb(item,err);
fs.ensureDirSync(item.path);
fs.writeFile(item.path+item.file,body);
return cb(item);
});
} | [
"function copyFile(fileURL){ \r\n window.resolveLocalFileSystemURL(fileURL,\r\n function(fileEntry) {\r\n \r\n window.resolveLocalFileSystemURL('cdvfile://localhost/persistent',\r\n function(dirEntry) {\r\n fileEntry.copyTo(dirEntry, fileEntry.name, successCallback, errorCallback);\r\n\r\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Deletes a tracked peer account | deleteAccount(peerAddr) {
let accts = this.getAccounts();
delete accts[peerAddr];
globalState.set('000-reputation-accounts', peerAddr);
} | [
"async deleteAccount() {\n browser.storage.local.remove(this._accountId);\n }",
"function deleteAccount() {\n const token = sessionStorage.getItem('token')\n\n fetch(`${BASE_URL}/deleteUser`, {\n method: 'DELETE',\n headers: {\n 'x-access-token': token\n }\n })\n .then(resp... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
import CurrentLocation from "./Geolocation/CurrentLocation"; import CLT from "./Geolocation/CurrentLocationTest"; import LibararyLocation from "./ManyMarker/LibraryLocation"; | function App() {
return (
<div className="App">
<BLT />
{/* <CurrentLocation /> */}
{/* <LibararyLocation /> */}
</div>
);
} | [
"function WildcardImport() {\n}",
"function UserLocationDTCTests() {\r\n BaseTest.call(this, 'UserLocationDTC');\r\n }",
"function Import() {\n}",
"function provideLocationMocks() {\n return [\n { provide: Location, useClass: SpyLocation },\n { provide: LocationStrategy, useClass: M... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
AutoComplete set autocomplete materials by tags | function setAutocomplete(tags){
var dataArr = new Array();
for ( var i = 0; i < tags.children.length; i++ ){
for ( var j = 0; j < tags.children[i].children.length; j++ ){
// use title, tag for label, category by tags
var data = new Object();
data['category'] = tags.children[i].title // tag nam... | [
"function dataProduct() {\n var nameProduct = new Array();\n for (i = 0; i < items.data.length; i++) {\n nameProduct[i] = items.data[i].name;\n console.log(nameProduct[i]);\n TagObjectArr[counterClickTags] = new TagObject(items.data[i].name, items.data[i].companyName, items.data[i].price)... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
save the player's score in local storage to compare high scores every time the player wins | function saveScore() {
if (localStorage.getItem('highScore') != null) {
const prevScore = localStorage.getItem('highScore');
if (stars > prevScore) {
localStorage.setItem("highScore", stars);
}
} else {
localStorage.setItem("highScore", sta... | [
"function saveScore() {\n localStorage.setItem('highscore', currentScore);\n}",
"function storeBestPlayerScore() {\r\n localStorage.setItem(\"time\", gGame.time);\r\n localStorage.setItem(\"lives\", gGame.lives);\r\n localStorage.setItem(\"hints\", gGame.hints);\r\n}",
"function saveHighScore(){\n lo... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
4. Write a function that takes an array and returns a similar array, but with the last item moved up to the beginning. | function moveLast(arr) {
let moveLastArray = [];
let lastIndex = arr[arr.length - 1];
for (i = 0; i < arr.length - 1; i++) {
moveLastArray[i] = arr[i];
}
moveLastArray.splice(0, 0, arr[arr.length - 1]);
return moveLastArray;
} | [
"function moveFirstToLast(arr){\n let moved = arr[0];\n arr.shift();\n arr.push(moved);\n return arr;\n}",
"function onlyKeepTheLastFew(arr,x){\n for(var i = 0; i < x; i++){\n arr[i] = arr[arr.length-x+i];\n }\n arr.length = x;\n return arr;\n}",
"function shift(array) {\n return... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
check if guest is set to true for company then display bringing guest radio input accordingly | function checkGuest(){
if ($("select[name=main_company] option[value='" + $("select[name=main_company]").val() +"']").attr("guest") === "1") {
$("div.guestRadio").show();
} else {
$("div.guestRadio input[value=yes]").prop("checked",false);
$("div.guestRadio input[value=no]").prop("checked",true);
$("div.guest... | [
"function checkGuestName(){\n\tif ($(\"div.guestRadio input[value=yes]:checked\").length > 0) {\n\t\t$(\"input[name=main_guestName]\").parent().show();\n\t} else {\n\t\t$(\"input[name=main_guestName]\").parent().hide();\n\t\t$(\"input[name=main_guestName]\").val(\"\");\n\t};\t\n}",
"function verifyRadioStep2_1(el... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Prepare optional isolated scope and prepare $animate with default enter and leave transitions for the new element instance. | function configureScopeAndTransitions(options) {
options = options || { };
if ( options.template ) {
options.template = $mdUtil.processTemplate(options.template);
}
return ang... | [
"function configureScopeAndTransitions(options){options=options||{};if(options.template){options.template=$mdUtil.processTemplate(options.template);}return angular.extend({preserveScope:false,cancelAutoHide:angular.noop,scope:options.scope||$rootScope.$new(options.isolateScope),/**\n\t * Default usage t... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
return the square of a vector | static sq(v) {
return new vector(v.x*v.x, v.y*v.y)
} | [
"function sumSquaresOfVector() {\r\n let sum = 0,\r\n i = arr.length;\r\n while (i--) {\r\n sum += Math.pow(arr[i], 2);\r\n }return sum;\r\n}",
"function sumSquaresOfVector(array) {\n var sum = 0,\n i = array.length;\n while (i--)\n sum += Math.pow(array[i], 2);\n return sum;\n}",
"squareDis... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
start quiz timer and update time left info every second. Load first question | function startQuiz() {
duringQuiz = true;
timeLeft = timeTotal;
quizInterval = setInterval(function() {
timeLeft--;
timeLeftEl.textContent = "Time left: " + timeLeft + "s";
}, 1000 * 1);
setTimer(timeLeft);
currentQuestionIndex = 0;
createQuestionContainer();
loadQuestion... | [
"function quizTimer() {\n // Subtract 1 from seconds remaining\n secondsLeft--;\n\n // Update display with new time remaining\n timerElement.text(secondsLeft);\n \n // Check if the timer has run out\n if (secondsLeft < 1) {\n outOfTime();\n };\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Creates a ReduxSaga channel to listen for changes to the connected wallet network (i.e Ropsten) | function createNetworkChangedChannel() {
return eventChannel((emitter) => {
const emitNetwork = (chainId) => {
// console.log('chainChanged:', chainId);
const network = WalletService.getNetworkFromHex(chainId);
emitter(network);
};
window.ethereum.on('chainChanged', emitNetwork);
r... | [
"@track((undefined, state) => {\n return {action: `enter-attempt-to-channel: ${state.channel.name}`};\n })\n enterChannel(channel){\n\n let addNewMessage = this.props.addNewMessage;\n let updateMessage = this.props.updateMessage;\n\n sb.OpenChannel.getChannel(channel.url, (channel, error) => {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
reverse traversal the list and fn(list) | function reTraversal(list, fn) {
var iterator = peek(list);
if (!iterator) {
return;
}
var end = false;
var done = function() {
end = true;
}
while (iterator !== list) {
var tmp = peek(iterator);
fn(iterator, done);
if (end) {
return;
}
itera... | [
"function reTraversal(list, fn) {\n var iterator = peek(list);\n if (!iterator) {\n return;\n }\n var end = false;\n var done = function() {\n end = true;\n }\n while (iterator !== list) {\n var tmp = peek(iterator);\n fn(i... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Serialize the cell spacing. | serializeCellSpacing(writer, format) {
if (!isNullOrUndefined(format.cellSpacing) && format.cellSpacing > 0) {
writer.writeStartElement(undefined, 'tblCellSpacing', this.wNamespace);
// tslint:disable-next-line:max-line-length
writer.writeAttributeString(undefined, 'w', this.... | [
"get cellSpacing() {\n return this.cellSpacingIn;\n }",
"serializeCellMargins(writer, format) {\n this.serializeMargins(writer, format, 'tcMar');\n }",
"serializeParagraphSpacing(writer, paragraphFormat) {\n writer.writeStartElement(undefined, 'spacing', this.wNamespace);\n // ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Write (store) MDR value at address MAR MAR: Memory Address Register, holds the memory address we're reading or writing MDR: Memory Data Register, holds the value to write or the value just read | write(MAR, MDR) {
this.mem[MAR] = MDR;
} | [
"write(MAR, MDR) {\n // !!! IMPLEMENT ME\n // write the value in the MDR to the address MARr\n //MAR location to save it (address)\n //MAR is index in our array\n //MDR something to save at location\n this.mem[MAR] = MDR;\n }",
"MEMSTORE() {\n // Set memory address\n this.membus.ADDR = th... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
2.5 Register Device Token, with User Credentials, and MFA Code | registerTokenWith2FA(device, username, password, mfa_code) {
return new Promise((resolve, reject) => {
if(!username || !password){
reject(new Error("Username or Password is undefined, did you export ROBINHOOD_USERNAME and ROBINHOOD_PASSWORD?"))
}else{
this.post(
{
u... | [
"function registerDevice() {\n WLAuthorizationManager.obtainAccessToken(\"push.mobileclient\").then(\n function(accessToken){\n MFPPush.registerDevice(\n null,\n function(successResponse) {\n navigator.notification.alert(\"Successfully registered\"... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets the target value with a random number. | function setTargetValue() {
targetNumber = randomNum(19, 120);
$("#target-text").html(targetNumber);
} | [
"function setTarget() {\n\ttargetNumber = Math.floor(Math.random() * 101) + 19;\n\t$(\"#target-number\").text(targetNumber);\n}",
"function setTargetNumber() {\n targetNumber = Math.floor(Math.random() * 102) + 19;\n $(\"#target-number\").text(targetNumber);\n}",
"function setTargetValue() {\n targetValu... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Set the default section format for document editor container | setDefaultSectionFormat(sectionFormat) {
this.sectionFormat = sectionFormat;
} | [
"setDefaultParagraphFormat(paragraphFormat) {\n this.paragraphFormat = paragraphFormat;\n }",
"retrieveSectionFormat(start, end) {\n let startParaSection = this.getContainerWidget(start.paragraph);\n let endParaSection = this.getContainerWidget(end.paragraph);\n if (!isNullOrUndefin... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Create a function which configures a loader identified by a unique id, with the option to override defaults with buildspecific and user config. | function createLoaderConfigFactory(buildConfig = {}, userConfig = {}) {
return function (id, defaultConfig) {
if (id) {
let loader = mergeLoaderConfig(defaultConfig, buildConfig[id], userConfig[id]);
return loader;
}
return defaultConfig;
};
} | [
"function createLoaderConfigFactory() {\n var buildConfig = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n var userConfig = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n\n return function (id, defaultConfig) {\n if (id) {\n var _loader = mergeLoaderC... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Creates a server instance for each demo, and sets up "demo things". It sizes each server according to the containing element, adds the stipple pattern, and (optionally) adds the inspector as well. | function bootstrapDemo(name, elem) {
var serverSlot = document.createElement("div");
serverSlot.classList.add('demo-' + name);
elem.appendChild(serverSlot);
var width = serverSlot.clientWidth;
var height = serverSlot.clientHeight;
var server = new Server();
serv... | [
"function createDemos(thisClient) {\n // delete all demos (if they exist) first.\n thisClient.del(KEY_PREFIX + '0001', function() {\n //console.log( 'Deleted old demo key' );\n thisClient.rpush( KEY_PREFIX + '0001', JSON.stringify(demoTeam0), JSON.stringify(demoTeam1), function() {\n //console.log( 'Cr... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
elementSelectedActivity() Creates a bound variable RuleML statement determined from what was chosen from its corresponding html form value. As of right now creates bounded variables only. However, free variable implementation would be the same as Gender below | function elementSelectedActivity(){
var choice = document.form.activity.value;
activity = "<Var type=\"" + choice + "\">Activity</Var>" + "\n ";
englishActivity = choice;
createRuleML();
} | [
"function elementSelectedAmbience(){\r\n\tvar choice = document.form.ambience.value;\r\n\tif(choice == \"Any\"){\r\n\t\tambience = \"<Var>InOut</Var>\" + \"\\n \";\r\n\t\tenglishAmbience= \"Indoors or Outdoors\";\r\n\t}\r\n\telse {\r\n\t\tambience = \"<Ind>\" + choice + \"</Ind>\" + \"\\n \";\r\n\t\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
the sum of that array's elements. Modify the function, using splice(), so that it returns a value of 10. | function sumOfTen(arr) {
let sumOfTen = arr.splice(1, 2);
return arr.reduce(a, b) => a + b);
} | [
"function sumOfTen(arr) {\n // change code below this line\n arr.splice(1, 2);\n // change code above this line\n return arr.reduce((a, b) => a + b);\n }",
"function sum(array) {}",
"function arraySum(array) {\n\n}",
"function sumArr(array){\n\n}",
"function sum(arr, fn) {\n return _.reduce(... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
assign id to the new notes | function assignId() {
let i;
for (i = 0; i < notes.length; i++) {
notes[i].id = i;
}
console.log(notes.length);
} | [
"function creatID (){\n for(i = 0; i < notes.length; i++){\n notes[i].id = i;\n }\n}",
"function newID() {\n for (var i = 0; i < notesArray.length; i++) {\n notesArray[i].id = i;\n }\n}",
"function addID(notes) {\n for(var i = 0; i < notes.length; i++) {\n notes[i].id = i + 1;\n }... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
A plugin for a clause embedded in a contract | function ClausePlugin() {
const name = 'clause';
/**
* Augment the base schema with the variable type
* @param {*} schema
*/
const augmentSchema = ((schema) => {
const additions = {
blocks: {
clause: {
nodes: [
{
match: [
{ type: 'par... | [
"function ClausePlugin() {\n const plugin = 'Clause';\n const tags = ['clause'];\n const markdownTags = ['clause'];\n const schema = {\n blocks: {\n Clause: {\n nodes: [\n {\n match: [{ type: 'paragraph' }],\n },\n ],\n },\n },\n };\n\n /**\n * @p... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
;; camNeverGroupDroid(what, [filter]) ;; ;; A means to not auto group some droids. ;; | function camNeverGroupDroid(what, filter)
{
if (!camDef(filter))
{
filter = ENEMIES;
}
var array;
var obj;
if (camIsString(what)) // label
{
obj = getObject(what);
}
else if (camDef(what.length)) // array
{
array = what;
}
else if (camDef(what.type)) // object
{
obj = what;
}
if (camDef(obj))
{
... | [
"function camInNeverGroup(droid)\n{\n\tif (droid.type !== DROID)\n\t{\n\t\tcamDebug(\"Non-droid in camInNeverGroup.\");\n\t\treturn false;\n\t}\n\tfor (var i = 0, l = __camNeverGroupDroids.length; i < l; ++i)\n\t{\n\t\tif (droid.id === __camNeverGroupDroids[i])\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t}\n\n\treturn fal... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets or Sets the line spacing type for selected paragraphs. | get lineSpacingType() {
return this.lineSpacingTypeIn;
} | [
"set lineSpacingType(value) {\n if (value === this.lineSpacingTypeIn) {\n return;\n }\n this.lineSpacingTypeIn = value;\n this.notifyPropertyChanged('lineSpacingType');\n }",
"get lineSpacing() {}",
"get lineSpacing(){ return this.__rt.lineSpacing; }",
"set lineSpacin... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
The search dialog has no message preview pane, and so wants a message display widget that is never visible. No one other than the search dialog should use this because the search dialog is bad UI. | function NeverVisibleMessageDisplayWidget() {
MessageDisplayWidget.call(this);
} | [
"function displayMessage(message) {\n\n if (message != null) {\n // Set up the message to display\n var messageLabel = $('<span class=\"error\">' + message + '</span>')\n\n $('div.contentMessages div.messages').html(\"\");\n $('div.contentMessages div.messages').append(messageLabel);\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
=============== Update Existing Vehicle Function Begin ================== | function editVehicle(vehicle) {
VehicleService.createVehicle(vehicle)
.then(
function () {
fetchAllVehicles();
self.message = vehicle.vehicle_regno + " vehicle reg no updated..!";
successAnimate('.success');
window.setTimeout(function(){
newOrClose();
r... | [
"function updateVehicle(vehicle) {\r\n\t\t\t\tself.vehicle = vehicle;\t\r\n\t\t\t\t$scope.nameWrong = false;\r\n\t\t\t\tself.UpdateNotCheckVehicleRegNo = self.vehicle.vehicle_regno;\r\n\t\t\t\tself.heading = self.vehicle.vehicle_regno;\r\n\t\t\t\t$('#branch_id').val(JSON.stringify(self.vehicle.branchModel));\r\n\t\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
assets assets: list GET | function getAssetList() {
let url = API_URL + 'assets/' + '?key=' + API_KEY;
return fetchAssets(url);
} | [
"function getAllAssets(){\n //get all assets\n ModulesService.getAllModuleDocs('assets').then(function(assets){ \n //store to array\n $scope.assets = assets;\n })\n .catch(function(error){\n FlashService.Error(erro... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Store `TIcu` at a give `index`. The `TIcu` can be stored either directly (if it is nested ICU) OR it is stored inside tho `TIcuContainer` if it is top level ICU. The reason for this is that the top level ICU need a `TNode` so that they are part of the render tree, but nested ICU's have no TNode, because we don't know a... | function setTIcu(tView, index, tIcu) {
var tNode = tView.data[index];
ngDevMode && assertEqual(tNode === null || tNode.hasOwnProperty('tViews'), true, 'We expect to get \'null\'|\'TIcuContainer\'');
if (tNode === null) {
tView.data[index] = tIcu;
} else {
ngDevMode &... | [
"function setTIcu(tView, index, tIcu) {\n var tNode = tView.data[index];\n ngDevMode && assertEqual(tNode === null || tNode.hasOwnProperty('tViews'), true, 'We expect to get \\'null\\'|\\'TIcuContainer\\'');\n\n if (tNode === null) {\n tView.data[index] = tIcu;\n } else {\n ngDevMo... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
parseWithLib :: String > Function Convenient function to parse and use `withStdLib`. | function parseWithStdLib(src){
return withStdLib(parse(src));
} | [
"function parseWithLib(lib,src){\n return withLib(lib,parse(src));\n }",
"function parsePromiseLib(lib) {\r\n if (lib) {\r\n var promise;\r\n if (lib instanceof main.PromiseAdapter) {\r\n promise = function (func) {\r\n return lib.create(func);\r\n }... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Handles the event of when the newest sort link has been clicked | function onNewestSortChange() {
$("#newest").css({'font-weight': 'bold', 'color': 'black'});
$("#priority").css({'font-weight': 'normal', 'color': '#A00000'});
window.sort = "Newest";
$sid = $.cookie('sid');
getFeed($sid, window.filter, window.sort, printToScreen);
} | [
"function onSortClick(e) {\n\n // Filter\n var searchregex = DOM.get(\"search-regex\");\n\n // Sort\n var sort_column = DOM.get(\"search-sort-column\");\n var sort_reverse = DOM.get(\"search-sort-reverse\");\n\n var th = e.currentTarget;\n\n // Gather the new state\n var column_name = th.get... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Animate the notice in. | animateIn (callback) {
// Declare that the notice is animating in.
this.set({'_animating': 'in'});
const finished = () => {
this.refs.elem.removeEventListener('transitionend', finished);
const {_animTimer, _animating, _moduleIsNoticeOpen} = this.get();
if (_animTimer) {
clearTimeou... | [
"function animate() { }",
"announceSomething (text, duration = '3s'){\n announceBar.innerHTML = text\n announceBar.style.animation = `announce ${duration}`\n }",
"animate() {\n\n\t\tif (this.frequency) this.updateBpm();\n\t\tthis.injectBpm();\n\n\t}",
"function infoAnimateInComplete()\n \t... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns true if fullTimeUnit contains the timeUnit, false otherwise. | function containsTimeUnit(fullTimeUnit, timeUnit) {
var index = fullTimeUnit.indexOf(timeUnit);
return index > -1 &&
(timeUnit !== TimeUnit.SECONDS ||
index === 0 ||
fullTimeUnit.charAt(index - 1) !== 'i' // exclude milliseconds
);
} | [
"function containsTimeUnit(fullTimeUnit, timeUnit) {\n const index = fullTimeUnit.indexOf(timeUnit);\n if (index < 0) {\n return false;\n }\n // exclude milliseconds\n if (index > 0 && timeUnit === 'seconds' && fullTimeUnit.charAt(index - 1) === 'i') {\n return false;\n }\n // exclude... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
function to get weather icon to add to card | function getWeatherIcon(city) {
} | [
"function getWeatherIcon(desc, isDaylight) {\n var image = \"\";\n switch(desc) {\n case \"Clear\": \n if (isDaylight) {\n image = \"<i class='fas fa-circle'></i>\";\n } else {\n image = \"<i class='fas fa-circle night'></i>\"\n }\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Simple minheap. key is a function that takes an element as an argument and returns a value that is used to compare elements. If it is not specified, an identity function is used by default. | function Heap(key) {
this._array = [];
this._key = key || function (x) { return x; };
} | [
"insert(key) {\n if (this.isFull()) return;\n this.heap[this.size + 1] = key;\n let k = this.size + 1;\n while (k > 1) {\n if (this.heap[k] < this.heap[Math.floor(k / 2)]) {\n const temp = this.heap[k];\n this.heap[k] = this.heap[Math.floor(k / 2)];\n this.heap[Math.floor(k / 2... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
UPDATE LIST Clear all items user needs to be either owner or collaborator | "groceryLists.updateClear"(_id) {
if (!this.userId) {
throw new Meteor.Error("Not authorized");
}
GroceryLists.update(
{
$or: [
{ _id: _id, userId: this.userId },
{ _id: _id, collaborator: { $in: [this.userId] } } ]
},
{
$set: {
lastUp... | [
"function uiClearLists () {\n\tuiClearList(\"users\");\n\tuiClearList(\"objects\");\n\tuiClearList(\"inventory\");\n\tuiClearList(\"exits\");\n}",
"\"groceryLists.removeItem\"(_id, item) {\n if (!this.userId) {\n throw new Meteor.Error(\"Not authorized\");\n }\n \n GroceryLists.update(\n {\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Insert the provided nodes after the current one. When inserting nodes after an expression, ensure that the completion record is correct by pushing the current node. | function insertAfter(nodes) {
this._assertUnremoved();
nodes = this._verifyNodeList(nodes);
if (this.parentPath.isExpressionStatement() || this.parentPath.isLabeledStatement()) {
return this.parentPath.insertAfter(nodes);
} else if (this.isNodeType("Expression") || this.parentPath.isForStatement() &&... | [
"function insertAfter(nodes) {\n\t\t this._assertUnremoved();\n\t\n\t\t nodes = this._verifyNodeList(nodes);\n\t\n\t\t if (this.parentPath.isExpressionStatement() || this.parentPath.isLabeledStatement()) {\n\t\t return this.parentPath.insertAfter(nodes);\n\t\t } else if (this.isNodeType(\"Expression\") || th... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Takes in the timeline object and updates the position of its markers to display a linear representation of the times in which the events occured | function linearTransform(timeline) {
var events = timeline.events;
// for each event in the timeline.events array, this block linearly interpolates
// from the time the event occured relative to the start of the narrative to its
// according pixel position on the timeline object and updates that objec... | [
"function update_timeline(){\n\n // Array of months to be used to display the correct name\n var months = [\"January\", \"February\", \"March\", \"April\", \"May\", \"June\", \"July\", \"August\", \"September\", \"October\", \"November\", \"December\"];\n\n // set up a date object we can use, at todays date and ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
this is the original score: return ( ( (21 + 3 actualLevel) rowsFreeFell) ) Math.pow(linesCleared); | static getPointsAward(actualLevel, linesCleared, rowsDropped) {
const lineBonus = [0, 40, 100, 300, 1200];
return lineBonus[linesCleared] * (actualLevel + 1) + rowsDropped; // is there a level zero??
} | [
"levelExpNeeded(level) {\n return (level - 1) * 100;\n }",
"function calculateLevelScore() {\n\treturn Math.round(100 * Math.min(1,(collectedResources[\"ore\"] / 30) * .5 + (collectedResources[\"crystal\"] / 5) * .5));\n}",
"_assignScoreLinesLevel(numLinesCleared) {\n\t\t/* Update the score and the number o... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Toggle the mobile menu button icon. | function toggleButtonIcon() {
mobileMenuBtn.firstElementChild.classList.toggle("fa-bars");
mobileMenuBtn.firstElementChild.classList.toggle("fa-times");
} | [
"function mobileMenuIconToggle() {\r\n mobileMenuOpened = !mobileMenuOpened;\r\n if (mobileMenuOpened) {\r\n $('.mobile-menu-toggle').find('span').removeClass('fa-bars').addClass('fa-times');\r\n } else {\r\n $('.mobile-menu-toggle').find('span').addClass('fa-bars').remove... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Adds to the canvas an exit button in three places which will take the user back to the home page: Instructions, WarmUps and Assignment | function addExitButton()
{
//Add the button
exitBtn = game.add.button(930, 20, 'exit');
//Add hover affect which changes the button if the mouse is hovering over the button or not
exitBtn.events.onInputOver.add(function(){ exitBtn.frame = 1;});
exitBtn.events.onInputOut.add(function(){ exitBtn.frame... | [
"function endGame() {\r\n background(\"#D0D3F0\"); // light purple\r\n // set mode\r\n mode = 5;\r\n\r\n // home button\r\n nextBtn.html(\"HOME\");\r\n\r\n // top score header\r\n title.html(\"TOP SCORES\");\r\n title.style('color', \"#7F85BA\");\r\n title.position(width/2 - 150, 30);\r\n\r\n // display h... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
cast array x into numbers | function numarray(x) {
for (var j = 0, o = []; j < x.length; j++) o[j] = parseFloat(x[j]);
return o;
} | [
"function numarray(x) {\n for (var j = 0, o = []; j < x.length; j++) { o[j] = parseFloat(x[j]); }\n return o;\n }",
"function arrayAsNumeric(x) {\n\tvar out = x.map(function(item, index) { return window.parseInt(item) });\n\n\treturn out;\n}",
"function numarray(x) {\n for (var j = 0... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
disablechangeButton() enableChangeButtonEnables a button "Change" | function enableChangeButton() {
var xbutton = document.getElementById("enableChange");
if( xbutton != undefined ){
document.getElementById("enableChange").removeAttribute('hidden');
}
return true;
} | [
"function disableChangeButton() {\t\t\n\tvar xbutton = document.getElementById(\"enableChange\");\n\tif( xbutton != undefined ){\n\t\tdocument.getElementById(\"enableChange\").setAttribute('hidden', 'true');\n\t}\n\treturn true;\n}",
"function setCommitChangesBtnEditMode() {\n if (!editModeCommandErrors && edi... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
set current direction and update assets | setDirection(direction) {
this.direction = direction;
this.updateAsset();
} | [
"updateAsset() {\n this.assetName = Constants.RHINO_DIRECTION_ASSET[this.direction];\n }",
"updateDir() {\r\n this.dir = this.next_dir;\r\n this.facing_angle = this.next_facing_angle;\r\n }",
"changeDirection() {\n\n this.blocks.forEach(function (b) {\n b.dx = -b.dx;... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
create new span element with error message for the passed in element that user not enter value ex: input & select element | function createErrorMessageForInputAndSelectFields(element) {
var $this = element;
var $dataAttribute = $($this).attr('data-error-text');
var $idAttribute = $($this).attr('id');
var $errorMessage = $dataAttribute ? $dataAttribute : $idAttribute + ' is required.';
var $currentPare... | [
"function displayValError(element, message) {\n \n //add the error class to the element's parent\n element.parent().addClass('has-error');\n \n //add the error message after the element itself\n element.after('<span>' + message + '</span>');\n}",
"function addErrorMessage(id, msg) {\n \t'use s... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets the selected options based on the specified values. | _setOptionsFromValues(values) {
this.options.forEach(option => option._setSelected(false));
values.forEach(value => {
const correspondingOption = this.options.find(option => {
// Skip options that are already in the model. This allows us to handle cases
// whe... | [
"setOptionsFromValues(values) {\n this.options.forEach((option) => option.setSelected(false));\n values\n .map((value) => this.getOptionByValue(value))\n .filter(Boolean)\n .forEach((option) => option.setSelected(true));\n }",
"select(...values) {\n this._verif... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
code TODO: save_naatsCtrl | controller_by_user controller by user | function controller_by_user(){
try {
$ionicConfig.backButton.text("");
} catch(e){
console.log("%cerror: %cPage: `save_naats` and field: `Custom Controller`","color:blue;font-size:18px","color:red;font-size:18px");
console.dir(e);
}
} | [
"function controller_by_user(){\n\t\ttry {\n\t\t\t\n//debug: all data\n//console.log(data_arrendamientoss);\n$ionicConfig.backButton.text(\"\");\n\t\t\t\n\t\t} catch(e){\n\t\t\tconsole.log(\"%cerror: %cPage: `arrendamientos` and field: `Custom Controller`\",\"color:blue;font-size:18px\",\"color:red;font-size:18px\"... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
parses the user input for the POI search and calls the SearchPoi module to build a search request | function handleSearchPoiRequest(atts) {
var poi = atts.query;
var searchNearRoute = atts.nearRoute;
var maxDist = atts.maxDist;
var distanceUnit = atts.distUnit;
var lastSearchResults = atts.lastSearchResults;
lastSearchResults = lastSearchResults ? lastSearchResults.split(' ') : null;
ui.searchPo... | [
"function poiSearch(poiOptions) {\n if (poiOptions.length > 0) {\n removeMarkers(poiMarkers);\n searchType = 1;\n for (var i = 0; i < poiOptions.length; i++) {\n placeSearch(poiOptions[i]);\n }\n } else {\n removeMarkers(poiMarkers);\n poiMarkers = [];\n }\n}",
"function searchPOI() {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Select/Deselect the dataset option from the main list | function selectDataset(datasetIndex){
var datasetForm = document.getElementById("datasets");
datasetForm.options[datasetIndex].selected = !(datasetForm.options[datasetIndex].selected);
//Focus the main select form, update the metadata for the options selected in the main select form
datasetForm.focus();
displ... | [
"function select() {\n selection.select(swimlane);\n }",
"chooseData() {\n // ******* TODO: PART I *******\n //Changed the selected data when a user selects a different\n // menu item from the drop down.\n this.updateBarChart(d3.select(\"#dataset\").property(\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
General Utilities return new object just like paramsObj except that all values are trim()'d. | function trimValues(paramsObj) {
const trimmedPairs = Object.entries(paramsObj).
map(([k, v]) => [k, v.toString().trim()]);
return Object.fromEntries(trimmedPairs);
} | [
"trimRequestParameterValues(requestData) {\n if (typeof requestData === \"string\") {\n return requestData.trim();\n }\n return requestData;\n }",
"trim_values(obj, filter = null) {\n return this.walk_values(obj, filter, function(val) {\n return typeof(val) === \"string\" ? val.re... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get all parameters out of the URL. | function getUrlParameters() {
var vars = [], hash;
var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&');
for (var i = 0; i < hashes.length; i++) {
hash = hashes[i].split('=');
vars.push(hash[0]);
vars[hash[0]] = hash[1];
}
return vars;
} | [
"static getAllUrlParameter() {\r\n // get parameter part from url\r\n let urlParamPart = window.location.href.split('?');\r\n\r\n if (urlParamPart.length > 1) {\r\n // get all url parameter with values\r\n let urlParams = urlParamPart[1].split('&');\r\n\r\n // r... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
hide slide or slides behind the scenes | function hideSlides($slide) {
$slide.css({"top": 0, "left": "-9999px", "z-index": ""});
} | [
"async function hide() {\n await transitionSlide(0);\n getCurrentSlideNode().style.display = \"none\";\n}",
"function hideSlides(){\n a = plusOneOrReset(a);\n b = plusOneOrReset(b);\n $('#port'+ String(a) ).toggleClass('hidden');\n $('#port'+ String(b)).toggleClass('hidden');\n }",
"function ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
move the frog when its on the logs moving left | function moveWithLogLeft() {
if (currentIndex > 18 && currentIndex <= 26) {
squares[currentIndex].classList.remove('frog');
currentIndex -= 1;
squares[currentIndex].classList.add('frog');
}
} | [
"function MoveWithLogLEft(){\n //if frog is at left moving log , then\n if(currentindex >= 27 && currentindex < 35){\n squares[currentindex].classList.remove('frog'); //remove frog\n currentindex +=1; // +=1 current Index . so , it does't fall on the water\n squares[cu... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Updates budget by id | function editBudget(budgetId, newBudget) {
var data = $resource("budget/:id", { id: "@id" }, {
update: {
method: "PUT"
}
});
return data.update({ id: budgetId }, newBudget).$promise;
} | [
"function updateBudget () {\n calculateBudget();\n\n var budget = getBudget();\n\n displayBudget(budget);\n}",
"async _saveAndUpdateBudget (budget) {\n await storageMethods.saveMonthlyBudget(this.state.month, this.state.year, budget);\n\n this._updateBudget();\n }",
"updateBudget() {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Go to next slide | goToNext () {
if (this.canGoToNext) {
this.goTo(this.currentSlide + 1)
}
} | [
"function nextSlide() {\r\n var index = (currentIndex == numSlides - 1) ? 0 : (currentIndex + 1);\r\n gotoSlide(index);\r\n }",
"function goNext() {\n slideTo(currentIndex + 1);\n }",
"nextSlide() {\n\n if (this.currSlide < this.slides.length - 1) {\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Function to invoke when publishing restart timeout is fired | function onPublishRestart() {
let logger = Flashphoner.getLogger();
let sessions = Flashphoner.getSessions();
if (!sessions.length || sessions[0].status() == SESSION_STATUS.FAILED) {
logger.info("Restart session to publish");
click("connectBtn");
} else {
let streams = ses... | [
"_restartPublishTimer() {\n if(this.publishEnabled) {\n this.timeoutId = setTimeout(() => this._publish(), this.publishRateMs);\n }\n }",
"function reload_timeout_trigger(){\n \n}",
"restart() {\n this.timer = AquiferTimer.startTimer(this.timeoutMillis);\n this.hasSucceeded = false;\n }",
... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
convert RGB image to grayscale imge | function grayscale(__src)
{
var h = __src.h,
w = __src.w;
var dst = new RGBAImage(w, h);
var data = dst.data,
data2 = __src.data;
var pix1, pix2, pix = w * h * 4;
while (pix){
data[pix -= 4] = data[pix1 = pix + 1] = data[pix2 = pix + 2] = (data2[pix] * 299 + data2[pix1] * 587... | [
"function greyScale() {\n\t\n\tcopyImageData();\n\t\n\tfor(var i = 0; i < imageInfo.data.data.length; i += 4)\n\t{\n var red = imageInfo.data.data[i];\n var green = imageInfo.data.data[i + 1];\n var blue = imageInfo.data.data[i + 2];\n var alpha = imageInfo.data.data[i + 3];\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Display 1 This displays the coordinate id of the character placement in the console; This displays the split coordinate id of the character placement; document.getElementById('split_output_box').innerHTML = split_character_placement; /////////////////////////////////////////////////////// Three things are needed to cre... | function character_movement(e){
keyCode_right:
if(e.keyCode === 68){ //keyCode_D Move_right
//
//keyCode_right original location
//
//keyCode_D find current container with red_background ... | [
"function insertChar () {\n console.log('inserting char...');\n const $emptySquares = $squares.filter(':empty');\n // generate a random square index\n const randomSqIdx = Math.floor(Math.random() * $emptySquares.length);\n // select the index of a $squares\n const $randomSq = $emptySquares.eq(rand... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Loads all the images from a category | function fillCategories(path, category, list) {
const folder = `${CATEGORIES_FOLDER}/${path}`
fs.readdir(folder, (err, files) => {
insertIntoList(files.filter(e => e !== 'original').map(e => {
const image = new Image()
const size = imageSize(e)
image.path = `${path}/$... | [
"function getCategoryImages() {\n apiService\n .get(\n `/images/search?category_ids=${\n Object.keys(activeCategory).length === 0 ? \"\" : activeCategory.id\n }&limit=${categoryReducer.limit}`\n )\n .then((response) => {\n dispatch(setCatgoryImages(response.data));\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Fill the select lists based on filter array. Any event that is filtered in will be removed from the full list of events and the remaining events will be listed as filtered out. If an event exists in the filter that does not exist in the full list it will not be displayed. | function fillFilters(filter) {
if (filter !== null) {
var allEventsList = document.getElementById("allEvents").value.slice(1, -1).split(", ");
filterInSelect.innerHTML = "";
if (filter.length > 0 && filter[0] !== "") {
var search;
for (i = 0; i... | [
"function populateFilters() {\n fillSelect('#subject', GlobalUtils.getSubjects());\n fillSelect('#term', GlobalUtils.getSemesters());\n fillSelectWithGroup('#instructor', GlobalUtils.getInstructors());\n\n bindSemesterChange();\n bindSubjectChange();\n bindChange();\n }"... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
resets this.leftToMeasure and this.nextMeasurements | resetInternalState(nextViewsToMeasure) {
this.leftToMeasure = new Set();
const nextNextMeasurements = new Map();
const newViewsToMeasure =
_differenceWith(_isEqual)(nextViewsToMeasure)(this.props.viewsToMeasure);
for (let viewToMeasure of newViewsToMeasure) {
this.leftToMeasure.add(viewToMe... | [
"_resetMeasuring() {\n const { hasPaths } = MeasureTool;\n\n MeasureTool.reset();\n\n // Mark for shallow render so the feedback is immediate\n if (hasPaths) {\n this._eventBus.trigger(EVENT.MARK_SHALLOW_RENDER);\n }\n }",
"reset() {\n this.timeLeft = this.t... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
POST /statuses Create a status and returns extended information for it. [Learn more on Dev Center]( `params` An object containing the status params. [See accepted params]( `callback` The callback function returning the results. An error object is passed as first argument and the result as last. | function create(params, callback) {
core.api('POST', '/statuses', params, callback);
} | [
"tweet(status) {\n return this.post({\n path: '/statuses/update',\n params: {\n status,\n }\n });\n }",
"function send_tweet(params,callback) {\n\t\tapi('http://api.twitter.com/1/statuses/update.json','POST','status='+params,function(resp){\n\t\t\t\n\t\t\tif (resp!=false) {\n\t\t\t\tT... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Add device to found device list | function addDeviceToList(device) {
onScreenLog('Device found: ' + device.name);
const deviceList = document.getElementById('device-list');
const deviceItem = document.getElementById('device-list-item').cloneNode(true);
deviceItem.setAttribute('id', device.id);
deviceItem.querySelector(".device-id").innerText... | [
"static addDevice(device){\n devices.add(device);\n }",
"add(device: Device): void {\n if (!this.getById(device.id)) {\n this.devices.push(device);\n }\n }",
"addDevice(deviceInfo) {\n let key = deviceInfo.physicalDeviceId;\n if (key.length === 0)\n key = deviceInfo.guid;\n l... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
returns products for given ids | function getProductsByIds(productIds) {
var productIdArr = [].concat(productIds);
var products = [];
var productIdsNotInCache = [];
for (var productIndex = 0; productIndex < productIdArr.length; productIndex++) {
var productDO = CatalogCache.getProductById(productIdArr[productIndex]);
if (UtilServi... | [
"function getProducts(ids) {\n var products = [];\n\n for(id in ids){\n \n products.push(getProduct(id));\n }\n\n return products;\n\n}",
"async getProducts(productsId) {\n\t\tif (!productsId || !Array.isArray(productsId) || productsId.length < 1) throw Error('products must be an array o... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Write a function which accepts a limit as an argument and prints all the prime numbers up to the limit. | function showPrimes(limit) {
for (let i = 0; i <= limit; i++) {
if (isPrime(i)) {
console.log(i);
}
}
} | [
"function showPrimes(limit){\n\tfor(let num = 2; num <= limit; num++)\n\t\tif(isPrime(num)) console.log(num);\n}",
"function show_prime(limit){\n for (let number = 2; number< limit; number++){\n if (isPrime(number)) console.log(number)\n \n }\n}",
"function showPrimes(limit) {\n for (let ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This function is supossed to delete all contents from the given jaxSubstitutionDiv with id rootId, it will also clean the input area associated to it | function cleanJaxSubstitution(rootId){
rootId = rootId + '.';
var textareaId = window[rootId + '_InputForm'];
//The variables of the id will now be empty
window[rootId + '_variables']=[];
//Empty the variables div
var varsDiv = document.getElementById(rootId+'VariablesDiv');
varsDiv.innerHTML = "";
/... | [
"function clearConstraintDiv() {\r\n var div = dojo.byId('editConstraintDiv');\r\n if (div.hasChildNodes()) {\r\n while (div.childNodes.length >= 1) {\r\n div.removeChild( div.firstChild ); \r\n }\r\n }\r\n}",
"removeChilds( ) {\n if ( !this.dom ) {\n retu... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Process a file line by line | function lineProcessor(fileItem, stringsRaw) {
var counter = 0;
const data = fs.readFileSync(fileItem.path, 'UTF-8');
// Split the contents by new line
const lines = data.split(/\r?\n/);
for (var i=0; i < lines.length; i++) {
var strings;
counter ++;
// Invoke proper parser
if (fileItem.type == '... | [
"function forEachLine(filename, fn) {\r\n const bufSize = 64 * 1024\r\n const buf = Buffer.alloc(bufSize)\r\n var leftOver = ''\r\n var lineNum = 0\r\n var lines, n\r\n\r\n const fd = fs.openSync(filename, 'r')\r\n while ((n = fs.readSync(fd, buf, 0, bufSize, null)) !== 0) {\r\n lines = buf.toString('utf8... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Process a complete SiGML DOM | _parseSiGML(sigDoc) {
var errCount, errText, gloss, j, len, nd, nom, parseRes, ref, ref1, ref2, signIx, typ;
errCount = 0;
errText = "";
signIx = 0;
if (sigDoc.documentElement != null) {
if (typeof lggr.info === "function") {
lggr.info("HtoG: SiGML document starts");
}
if (typeof lggr.trace === "function") {
lggr.trace... | [
"function __parseLoop__(impl, doc, p, isWindowDocument) {\n var iEvt, iNode, iAttr, strName;\n var iNodeParent = doc;\n\n var el_close_count = 0;\n\n var entitiesList = new Array();\n var textNodesList = new Array();\n\n // if namespaceAware, add default namespace\n if (impl.namespaceAware) {\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
passes the member's name and role to the savedMem and savedRole variables | function passName(e){
var role;
for(i in currentProject.members){
if(currentProject.members[i].name == e){
for (j in currentProject.members[i].role) {
role = currentProject.members[i].role[j];
savedMem = e;
savedRole = role;
break;
}
break;
}
}
document.getElementById("EditName").v... | [
"saveStorageMember(state){\n\t\t\tuni.getStorage({\n\t\t\t\tkey:'member',\n\t\t\t\tsuccess:(e)=> {\n\t\t\t\t\tstate.memberInfo = e.data;\n\t\t\t\t\tthis.dispatch('getMemberInfo')\n\t\t\t\t}\n\t\t\t})\n\t\t}",
"function saveMasterRole() {\n\n }",
"registerRole(role) { this.roles[role.key] = role; }",
"funct... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
given restrictions provided, make a reduced list of products prices should be included in this list, as well as a sort based on price | function restrictListProducts(prods, restriction) {
let product_names = [];
for (let i=0; i<prods.length; i+=1) {
if ((restriction == "lactose") &&(prods[i].LactoseFree == true)){
product_names.push(prods[i]);
}
else if ((restriction == "noix") && (prods[i].noixfree == true)){
product_names.push(prods[i])... | [
"function restrictListProducts(prods, restriction) {\n\tlet product_names = [];\n\tlet product_price = [];\n\tfor (let i=0; i<prods.length; i+=1) {\n\t\tif ((restriction == \"NutFree\") && (prods[i].nutFree == true)){\n\t\t\tproduct_names.push(prods[i].name+\"---$\"+prods[i].price);\n\t\t\tproduct_price.push(prods[... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
query for the professors projects | function findProjects(id) {
return db('users')
.join('projects', 'users.id', 'projects.professor_id' )
.select('projects.professor_id','projects.student_id','projects.project_name', 'projects.description', 'projects.due_date', 'projects.description', 'projects.completed')
.where({ professor_... | [
"function getEligibleProjects() {\n \tEligibleProject.query(function(result) {\n vm.eligibleProjects = result;\n getAllPhotoForAllProject(result);\n });\n }",
"function getProjectList() {\n return db(\"projects as p\")\n .select(\n \"p.name as projec... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
When x is clicked remove task from list | function removeTask(){
$(".remove").unbind("click").click(function(){
var single = $(this).closest("li");
toDoList.splice(single.index(), 1);
single.remove();
toDoCount();
notToDoCount();
addClear();
});
} | [
"function deleteTask(e) {\n if (e.target && e.target.nodeName === \"BUTTON\") {\n taskList.deleteFromList(e.target.id.slice(-1))\n }\n clearList()\n taskList.displayList()\n }",
"function removeTask(){\n\n\t// this är span-elementet, parentElement är li\n\tvar clickedBin = this.parentElement;\n\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Add "zeros" zeros to "v". | function addZeros(v, zeros) {
return new Array(zeros)
.concat([v])
.join("0")
.slice(-zeros);
} | [
"static Zero(n) {\r\n return Vector.Fill(n, 0);\r\n }",
"function addzero (n, length) {\n var str = (n > 0 ? n : -n) + \"\";\n var zeros = \"\";\n for (var i = length - str.length; i > 0; i--)\n zeros += \"0\";\n zeros += str;\n return n >= 0 ? zeros : zeros;\n // return n >= 0 ? zer... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
xAppendChild, Copyright 20012007 Michael Foster (CrossBrowser.com) Part of X, a CrossBrowser Javascript Library, Distributed under the terms of the GNU LGPL | function xAppendChild(oParent, oChild)
{
if (oParent.appendChild) return oParent.appendChild(oChild);
else return null;
} | [
"function xAppendChild(oParent, oChild)\n{\n if (oParent.appendChild) return oParent.appendChild(oChild);\n else return null;\n}",
"function appendChild(elem,child){child.parent=elem;if(elem.children.push(child)!==1){var sibling=elem.children[elem.children.length-2];sibling.next=child;child.prev=sibling;child.n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
ele manager cycles through array of elements | function ElementManager(){ //will keep an array of elements and cycle through to draw
this.eleArray = [];
this.hitTestables = [];
} | [
"function updateElements()\n {\n let idBeginning = \"element\";\n for (let j = 0; j < array.length; j++) {\n let id = idBeginning.concat(j);\n document.getElementById(id).innerHTML = array[j];\n }\n }",
"appendToElement(ele) {\n for (let el of this.elArr... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
captures all the links on a page | function getAllLinks (page){
var links = [];
while (true){
url, end_pos = getNextTarget (page);
if(url != ''){
links.push(url);
page = page[end_pos];
};
else{
break;
}
}
return links;
} | [
"function collectInternalLinks($) {\r\n \r\n\r\n var relativeLinks = $(\"a[href^='/']\"); //selecting elements whose href attribute begins with \"/\" ie relative links\r\n console.log(\"Found \" + allRelativeLinks.length + \" relative links\");\r\n relativeLinks.each(function () {\r\n pagesToVisit.... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gzip the request body (if it's large enough) | function compress(req, done) {
req.headers['content-encoding'] = 'gzip'
zlib.gzip(req.body, function (err, buf) {
if (err) done(err)
else {
req.body = buf
req.headers['content-length'] = buf.length
done()
}
})
} | [
"function gzippedBody() {\n var gz;\n\n gz = zlib.createGunzip();\n gz.on(\"data\", bodyAppend);\n gz.once(\"end\", done);\n req.on(\"data\", (chunk) => {\n gz.write(chunk);\n });\n req.once(\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns a csrfToken if this request requires it | csrfToken() {
if (!this.isSafe() && !this.isCrossOrigin()) {
return up.protocol.csrfToken()
}
} | [
"csrfToken() {\n if (!this.isSafe() && !this.isCrossOrigin()) {\n return up.protocol.csrfToken();\n }\n }",
"_getCSRFToken() {\n let that = this;\n return that._request('GET', that._getUrl('simplecsrf/token.json'), {}, that.localHeaders)\n .then(function (res) {\n con... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
return styles associated with an org | async function getStyle(orgId) {
var query = new Parse.Query("ChannelStyle");
query.equalTo("organizationID", orgId);
try {
// store styles query result in styles array
return await query.find();
} catch (err) {
// TypeError: failed to fetch
alert(err);
}
} | [
"static get styles(){return[]}",
"cramp() {\n return styles[cramp[this.id]];\n }",
"function lookup_style(styles, stylename) {\n\t\tvar stylebase = stylename.split(/[ _-]/)[0];\n\t\treturn (styles.itemByName(stylebase));\n\t}",
"static get styles() {\n return styles;\n }",
"get fontStyle()... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |