query stringlengths 9 34k | document stringlengths 8 5.39M | negatives listlengths 19 20 | metadata dict |
|---|---|---|---|
Return an array of the verbs which the auth endpoint accepts | static getValidVerbs() {
return [
SUPPORTED_VERBS.GET,
SUPPORTED_VERBS.PUT,
SUPPORTED_VERBS.POST
];
} | [
"getAuthMechanisms() {\r\n const extension = this._extensions.find((e) => e.split(' ')[0] === 'AUTH');\r\n if (extension) {\r\n return extension.split(' ').filter((e) => !!e).map((e) => e.trim().toUpperCase()).slice(1);\r\n }\r\n else {\r\n return [];\r\n }\r... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
random numbers for each gem | function gemRandomNumber() {
for (var i = 0; i < 4; i++) {
var num = Math.floor(Math.random() * 13 + 1);
RandomNumber.push(num);
}
} | [
"function gemValueGenerator(selector) {\n // Here we generate a random number for each Gem\n var gemValue = Math.floor(Math.random() * 12) + 1;\n // This takes the gemValue variable, targets the \"value\" property, \\\n //and writes that variable onto it.\n $(selector).attr(\"valu... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
cria um map com os estados, adionando cada simbolo do token para cada respectivo estado | function map(arrTokens) {
mapEstados = new Map();
var q = 0;
var proximoEstado = 1;
var add = true;
var ultimoEstado;
for (var key in arrTokens) {
if (key > 0) {
add = false;
}
var estadoAtual = 0;
for (i = 0; i < arrTokens[key].length; i++) {
if (add) {
if (i == arrTokens[key].length - 1) {
... | [
"function geraTabelaEstados(arrTokens) {\n\n\tvar posicao = 0;\n\tmapEstados = new Map();\n\tfor (var key in arrTokens) {\n\t\tconsole.log(key);\n\t\tlet add = (key > 0) ? false : true;\n\t\tvar estadoAtual = 0;\n\t\tfor (i = 0; i < arrTokens[key].length; i++) {\n\t\t\tif (add) {\n\t\t\t\tmapEstados.set(posicao++, ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Valida e cria uma pessoa | async criarPessoa(pessoa) {
this.validarPessoa(pessoa);
const pessoaCriada = await PessoaRepository.create(pessoa);
return pessoaCriada;
} | [
"validarPessoa(pessoa) {\n if(!pessoa.nome) {\n throw 'O nome da pessoa é obrigatório';\n }\n if(!pessoa.sobrenome){\n throw 'O sobrenome da pessoa é obrigatório';\n }\n }",
"function agregarPeli () {\n\n\t\t//Tomamos los valores de los inputs del titulo, la descripcion y la imagen.\n\t\tva... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets the height of the body wrapper to the height of the activating tab if dynamic height property is true. | _setTabBodyWrapperHeight(tabHeight) {
if (!this._dynamicHeight || !this._tabBodyWrapperHeight) {
return;
}
const wrapper = this._tabBodyWrapper.nativeElement;
wrapper.style.height = this._tabBodyWrapperHeight + 'px';
// This conditional forces the browser to paint the... | [
"setHeight() {\n this.$().outerHeight(this.$(window).height() - this.get('fixedHeight'));\n }",
"function setBodyHeight( uiHeight )\n {\n $body.css({\n height: uiHeight - $footer.outerHeight() - $header.outerHeight()\n });\n }",
"function i2uiSetTabFillerHe... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Updates the top/left positions of a `ClientRect`, as well as their bottom/right counterparts. | function adjustClientRect(clientRect, top, left) {
clientRect.top += top;
clientRect.bottom = clientRect.top + clientRect.height;
clientRect.left += left;
clientRect.right = clientRect.left + clientRect.width;
} | [
"function updateCursorPosition(left, top) {\n cursor.style.left = `${left}px `;\n cursor.style.top = `${top}px`;\n cursor.scrollIntoView({\n behavior: \"smooth\",\n block: \"center\",\n inline: \"center\",\n });\n }",
"function handleReposition(old_width, old_height) {\n $(\".handle\"... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
setMetaDescription() method sets the metaDescription description param can be string only, anyother type, resets metaDescription | function setMetaDescription(description) {
if (typeof description === 'string') {
metaDescription = description;
} else {
metaDescription = '';
}
} | [
"function resetMetaDescription() {\r\n\t\t\tsetMetaDescription($rootScope.application.description);\r\n\t\t}",
"setDescription(description) {\n this.description = description;\n }",
"set description(aValue) {\n this._logger.debug(\"description[set]\");\n this._description = aValue;\n }",
"fun... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Defines an external register. The name should be a single character that will be used to reference the register. The register should support setText, pushText, clear, and toString(). See Register for a reference implementation. | function defineRegister(name, register) {
var registers = vimGlobalState.registerController.registers;
if (!name || name.length != 1) {
throw Error('Register name must be 1 character');
}
if (registers[name]) {
throw Error('Register already defined ' + name);
}
regist... | [
"function register() {\n\tvar packet = new Buffer(\"REGISTER echo\");\n\ts.send(packet, 0, packet.length, 12345, \"192.241.177.112\");\n}",
"isRegisterName(str) {\n return this.architecture.hasRegisterName(str);\n }",
"function element(name, prototype) {\n registry[name] = prototype;\n }",
"regi... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
============================================= Funcion que permite descargar Inspeccion_MPdebug.apk ============================================== | function descargarInspeccionMpApk(){
$('.fb').show();
$('.fbback').show();
$('body').css('overflow','hidden');
location.href="http://www.montajesyprocesos.com/inspeccion/servidor/aplicacion/Inspeccion_MP-debug.apk";
cerrarVentanaCarga();
} | [
"function descargarGrabadoraApk(){\n $('.fb').show();\n $('.fbback').show();\n $('body').css('overflow','hidden');\n location.href=\"http://www.montajesyprocesos.com/inspeccion/servidor/aplicacion/grabadora.apk\";\n cerrarVentanaCarga();\n}",
"function click_btn_descargar_inspeccion(){\n\t$(\"#btn_descargar_... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Generates the authentication header map needed for generating the AWS Signature Version 4 signed request. | async function generateAuthenticationHeaderMap(options) {
const additionalAmzHeaders = options.additionalAmzHeaders || {};
const requestPayload = options.requestPayload || '';
// iam.amazonaws.com host => iam service.
// sts.us-east-2.amazonaws.com => sts service.
const serviceName = options.host.sp... | [
"function genAuthorizationHeaderValue (options) {\n\n log(options.verbose,\"Now generating Authorization header value ...\");\n\n var authHeaderParams = [];\n\n authHeaderParams.push(createEncodedParam(\"oauth_consumer_key\",options.oAuthConsumerKey));\n authHeaderParams.push(createEncodedParam(\"oauth_... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Checks to see if the middle column matches. | function middleColumnMatch(){
if(isEmptyRow("square1", "square4","square7")){
isEqual("#square1", "#square4", "#square7");
}
} | [
"function middleRowMatch(){\n\tif(isEmptyRow(\"square3\", \"square4\",\"square5\")){\n\t\tisEqual(\"#square3\", \"#square4\", \"#square5\");\n\t}\n}",
"function firstColumnMatch(){\n\tif(isEmptyRow(\"square0\", \"square3\",\"square6\")){\n\t\tisEqual(\"#square0\", \"#square3\", \"#square6\");\n\t}\n}",
"functio... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
FALSY VALUES false (Do not confuse between primitive boolean values true and false with the true and false of values of boolean object) undefined null 0 NaN the empty string("") A program in which function checkData returns true if number of characters in a Text object is three. Otherwise, it displays an alert and retu... | function checkData() {
if (document.form1.threeChar.value.length == 3) {
return true;
} else {
alert('Enter exactly three characters. ' +
`{document.form1.threeChar.value} is not valid.`);
return false;
}
} | [
"function Master_DataCheck(){ \n\t\tif(LINE_PART.bindcolval == \"\" ) {\n\t\t\talert(\"Project 누락\"); \n\t\t\treturn false;\n\t\t} \n\n\t\tif(LINE_PART.index != 3) {\n\t\t\tif( PROJECT.index == 0 ) {\n\t\t\t\talert(\"물류비 부담 누락\"); \n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\tif(strim(ETD_DT.Text) == \"\" ) {\n\t\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Converts an array of arguments to an indexed map object. | function argsToMap(args) {
return args.reduce((result, arg, i) => (result[i] = arg) && result, {});
} | [
"function mapStorageArgs(storArgs) {\n const mISVA = Components.interfaces.mozIStorageValueArray;\n let mappedArgs = [];\n for (let i = 0; i < storArgs.numEntries; i++) {\n switch(storArgs.getTypeOfIndex(i)) {\n case mISVA.VALUE_TYPE_NULL: mappedArgs.push(null); break;\n case m... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
(Internal) Called after an update to rerender sub layers | _postUpdate(updateParams, forceUpdate) {
// @ts-ignore (TS2531) this method is only called internally when internalState is defined
let subLayers = this.internalState.subLayers;
const shouldUpdate = !subLayers || this.needsUpdate();
if (shouldUpdate) {
const subLayersList = this.renderLayers(); /... | [
"updateLayers() {\n // NOTE: For now, even if only some layer has changed, we update all layers\n // to ensure that layer id maps etc remain consistent even if different\n // sublayers are rendered\n const reason = this.needsUpdate();\n\n if (reason) {\n this.setNeedsRedraw(`updating layers: ${r... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
delete images from upload directory images are specified as an array of files with path relative to the upload dierectory return number of files deleted successfuly | function deleteImages(imgRelPathArr, callback){
if(! Array.isArray(imgRelPathArr)) return callback(new Error("Array of files expected in deleteImages"))
let imgAbsPathArry = imgRelPathArr.map(relPath => uploadDirPath + '/' + relPath )
async.map(
imgAbsPathArry,
async.reflect(
function(f, cb){
... | [
"function s3deleteFiles(url) {\n if (!url) {\n return;\n }\n uploader.delete(url, function(err, deleteResponse) {\n console.log('file deleted!!');\n });\n}",
"function handleDeleteUpload() {\n setFiles([])\n deleteFile(document)\n handleDocumentDelete(document)\n fileInputFie... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
addCurve(SampleTarget, options) Usage : Adds a curve to the plot. The inputs are as follows: SampleTarget : target to be sampled options : channel : r,g,b,a probePosition : position of the probe timeWindow : timeWindow to be plotted minValue : minimum value on the vertical axis maxValue : maximum value on the vertical ... | addCurve (SampleTarget ,options){
options.xrange = this.xrange ;
options.yrange = this.yrange ;
var newCurve = new Curve( SampleTarget,
this.xrange,
options ) ;
this.curves.push( newCurve ) ;
this.noCurves... | [
"addSignal (SampleTarget, options){\n var newSignal = new Signal(\n SampleTarget,\n this.noPltPoints,\n options ) ;\n this.signals.push( newSignal ) ;\n this.noSignals ++ ;\n this.yticks.min = newSignal.minValue ;\n this.yti... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
this function determines whether the day or night image is shown | function nightDay() {
if (keyIsPressed == true) {
nightImage();
} else {
dayImage();
}
} | [
"function getWeatherIcon(day){\n let src = './images/'\n switch(day.weather[0].main){\n case 'Thunderstorm':\n if (/rain|drizzle/.test(day.weather[0].description)){\n src += 'rain-thunder'\n }\n break; \n case 'Drizzle':\n case 'Rain': \n src += 'rain'\n break;\n case '... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Applies filterRow() to all rows. | function filterAll() {
for (var i = 0, l = rows.length; i < l; ++i) {
filterRow(rows[i], mapping[rows[i].id])
}
} | [
"function tableFiltering(){\n\t\tlet filterTableRows=sortTableRows.filter(function(item, index, array){\n\t\t\tif (filterTableName){\n\t\t\t\tif(!item.name.includes(filterTableName)) return false;\n\t\t\t}\n\t\t\tif (filterTableChars){\n\t\t\t\tif(!item.chars.includes(filterTableChars)) return false;\n\t\t\t}\n\t\t... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Plays the currently selected track / chord | playCurrent() {
let chord = this.sequence[this.playing]; // get the current chord / track from the sequence
this.tracks[chord][this.mode].play(); // play the track
} | [
"function play(){\n\treadAndPlayNote(readInNotes(), 0, currentInstrument);\n}",
"playNext() {\n\n // if it is the last chord of the sequence start again from the first one, otherwise go to the next one\n if (this.playing >= this.sequence.length - 1) {\n this.playing = 0; // set the ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
+1 to the memory location being pointed at | function plus(){
memory[pointer]++;
} | [
"function pointerInc(){\r\n pointer++;\r\n if(pointer === arr.length){\r\n arr.push(0);\r\n }\r\n \r\n}",
"function incrementPointer() {\n\tcode_string_pointer++;\n}",
"indexedIndirect() {\n this.incrementPc();\n let zeroPageAddress = (this.ram[this.cpu.pc] + this.cpu.xr) & 0xff\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
On starship selected, saves it to the User Variables and shows the Solar System Selection scene. | function onShipSelected(event)
{
// Save selected starship model to User Variables
var shipModelUV = new SFS2X.SFSUserVariable(UV_MODEL, event.getUserData().model);
sfs.send( new SFS2X.SetUserVariablesRequest([shipModelUV]) );
// Show solar system selection scene, passing the room list to display the corresponding... | [
"function displayStarmap() {\r\n if (me.active === me.starmap) {\r\n me.starmap.display();\r\n }\r\n }",
"function selectStar(star) {\n // Maintains animation state.\n if (star.animations.paused == true) {\n star.animations.paused = false;\n star.animations.play('twinkl... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets the input's maximum date. | _getMaxDate() {
return this._max;
} | [
"function findMaximumValue(array) {\n\n}",
"lastMonday(value){\r\n\t\tlet date = new Date();\r\n\t\tif(value) date = new Date(value);\r\n\t\tdate.setDate(date.getDate() - (date.getDay() + 6) % 7);\r\n\t\tconst day = (\"0\" + date.getDate()).slice(-2);\r\n\t\tconst month = (\"0\" + (date.getMonth() + 1)).slice(-2)... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Called by the C++ internals to emit keylogging details for a QuicSession. | function onSessionKeylog(line) {
if (this[owner_symbol]) {
this[owner_symbol].emit('keylog', line);
}
} | [
"function camera_sent(viewer, key) {\n logmessage(\"=> \" + viewer + \": \" + key);\n}",
"function setupConsoleLogging() {\n (new goog.debug.Console).setCapturing(true);\n}",
"log() {\n console.info('Internal Playlist Model:')\n this.items.forEach((video, index) => {\n console.info('\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Splits the cleaned word into a character array, sorts it alphabetically, and returns the alphabetically sorted string | function getSortedLetters(word) {
word = cleanWord(word);
var charArray = word.toLowerCase().split("");
charArray.sort();
return charArray.join("");
} | [
"function reOrdering(text) {\n let s = text.split(' '), i = s.findIndex(a => a[0] === a[0].toUpperCase());\n return [s[i], ...s.slice(0, i), ...s.slice(i + 1)].join(' ');\n}",
"function normalize(w) {\n w = w.toLowerCase();\n var c = has(w);\n while (c != \"\") { //keep getting rid of punctuation as lo... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
FUNCTION NAME : checkLineIfCommited AUTHOR : Marlo Agapay DATE : December 26, 2013 MODIFIED BY : REVISION DATE : REVISION : DESCRIPTION : checks if line is already committed PARAMETERS : | function checkLineIfCommited(id){
var dv = id.split("||");
var dev1 = dv[0].split(".");
var dev2 = dv[1].split(".");
var device1 = dev1[0];
var device2 = dev2[0];
var dev1Condition = false;
var dev2Condition = false;
if(globalInfoType == "JSON"){
var devices = getDevicesNodeJSON();
}else{
... | [
"function isOkLine (previousLine) {\n\n return line === '# ok' && previousLine.indexOf('# pass') > -1;\n }",
"function check_rev_comment(lines) {\n console.log(lines);\n var title = lines[0];\n // check title\n console.log(\">> checking title line:\" + title);\n if (check_rev_titile(title) != 0... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Visual display of the menu letting the user know if TabEx is turned on or off | function menuHandler(){
if(command.getChecked()){
command.setChecked(false);
prefs.set('enabled',false);
return;
}
command.setChecked(true);
prefs.set('enabled',true);
var st = startTabEx();
} | [
"function displaySettings() {\r\n\t\t// Hide other menus\r\n\t\taddClass($('#main_menu #shortcuts'), 'hide');\r\n\t\taddClass($('#main_menu #story'), 'hide');\r\n\t\taddClass($('#main_menu #spellbook'), 'hide');\r\n\t\taddClass($('#main_menu #stats'), 'hide');\r\n\r\n\t\t// Show settings screen\r\n\t\tremoveClass($... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
PASTE YOUR CODE FROM LAST WEEK ABOVE THIS COMMENT BLOCK 6. Create a function called isLengthGreaterThan Your function should take one parameter, a number (call it "length") If movieQueue's length is greater than length, return true If movieQueue's length is less than or equal to length, return false | function isLengthGreaterThan(length) {
if (movieQueue.length > length) {
return true;
}
else {
return false;
}
} | [
"function findMovie(movie) {\n for (var i = 0; i < movieQueue.length; i++) {\n if (movieQueue[i] === movie) {\n return true;\n }\n }\n return false;\n}",
"function hasLength (data, value) {\n return assigned(data) && data.length === value;\n }",
"moreQuestionsAvailabl... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns whether or not the button should show an account name input field. This is for Authenticators that do not have a concept of account names. | async shouldRequestAccountName() {
return false;
} | [
"async shouldRequestAccountName() {\n return false;\n }",
"function validatePlayerName() {\n const name = getGameForm()['player-name'].value;\n if (!name.trim()) {\n getById('play-button').style.visibility = 'hidden';\n } else {\n playerName = name;\n getById('play-button').style... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Handles scroll behavior for overflowing pathView | function scrollPathView(e) {
var target = e ? e.target : window.event.srcElement,
maxScroll = pathView.scrollWidth - pathView.clientWidth,
scroll = pathView.scrollLeft,
change = 5;
if (target.className === "adi-path-right") {
pathView.scrollLeft = (scroll <= maxScroll - change) ? scroll + chang... | [
"_listenToScrollEvents() {\n this._viewportScrollSubscription = this._dragDropRegistry\n .scrolled(this._getShadowRoot())\n .subscribe(event => {\n if (this.isDragging()) {\n const scrollDifference = this._parentPositions.handleScroll(event);\n i... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
functions check select case | function checkSelectCase() {
//get the value of the option selected
let optionValue = $("select").val();
//take out the default value
let optionValid = optionValue != null;
//make the logic
if (optionValid) {
//and the display
$("select").css("border-color", "green");
} else {
... | [
"function testChoice() {\n var status = 40;\n var qualifiedState = true;\n $.each(checkChoice, function (ele, index) {\n if (checkChoice[ele] == '') {\n status -= 10;\n } else {\n switch (ele) {\n case \"address\":\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Part 1 Riddles ////////////////////////////////////////////////////////// startChoice first window that appears after clicking the screen Player can choose an option which will start them off on a specific riddle | function startChoice() {
//remove the prompt text and image
$('.startImage').remove();
heartSFX.stop;
// set state of the game with this variable, 1 means the actual content of the project
initiated = 1;
// making the variable to chose the soundtrack 0, which is the ost for the riddles
musicPlaying = 0... | [
"function btnChoice(e) {\n\tplayer.choice = e.target.id\n\tdisplayResults()\n}",
"function fingerChoice() {\n choiceDialog(0, 0, ghostDialog, 14000);\n}",
"function startTrivia() {\n // Load the trivia windows and buttons. \n swapButtons();\n toggleQuestion();\n // Set the number of questions. \n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
given two moving averages, returns the PredictionLink that predicts the predictee from the predictor | function getLinkFromMovingAverages(predictor, predictee) {
var links = predictionLinks[predictee.getName().getName()];
return links[predictor.getName().getName()];
} | [
"function linkCandidates(predictor, predictee) {\n message(\"linking candidates \" + predictor.getName().getName() + \" and \" + predictee.getName().getName() + \"\\r\\n\");\n\t var frequencyCountA = predictor.getNumFrequencyEstimators();\n\t var ratingCountA = predictor.getNumRatingEstimators();\n\t ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
function method PUT (envoie avec token) formdata | async function putAuthFormdata(url, data) {
let response = await fetch(url, {
method: 'PUT',
headers: {
'Authorization': 'Bearer' + ' ' + recupUserId.token
},
body: data
});
let data3 = await response.json();
return data3;
} | [
"function handle_put(parsedRequest,data) {\n // TODO: enforce put vs post rules, for now\n // they can both do the same\n return handle_post(parsedRequest,data);\n }",
"put(data, callback) {\n const id =\n typeof data.payload.id === 'string'\n && data.payload.id.trim().length === 20\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets the intensity of a palette of colors. The intensity being the Vvalues in HSV form | function getPaletteIntensity(palette) {
return palette
.map(color => {
return rgbToHsv(color).v
})
.reduce((sum, val) => {
return sum + val
})
/palette.length;
} | [
"function getBrightness(palette) {\n return palette\n .map(color => {\n return rgbToHsl(color).l\n })\n .reduce((sum, val) => {\n return sum + val\n })\n /palette.length\n}",
"function rgbToHsv(r, g, b){\n r = r/255, g = g/255, b = b/255;\n var max = Math.max(r, g, b), min = Ma... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
renderVizMoreOptions Creates the viz with the following options: tabs, toolbar, width: 850px, height: 860px renders it into the tableauViz in demo.html Filters on Office Suplies, Furniture Category and sets Top Customer Parameter Value | function renderVizMoreOptions() {
// Define variables for viz
var mainVizDiv = $("#tableauViz");
var mainVizOptions = {
hideTabs: false,
hideToolbar: false,
//toolbarPositon: top, // (or "bottom")
width: 850,
height: 860,
//Filter Category field - no... | [
"function drawOptions() {\n\t\t\tvar ui = newElement('div', { id: 'adi-opts-view', class: 'adi-hidden' }),\n\t\t\t\thead1 = newElement('span', { class: 'adi-opt-heading' }),\n\t\t\t\thead2 = newElement('span', { class: 'adi-opt-heading' }),\n\t\t\t\tclose = newElement('span', { class: 'adi-opt-close' });\n\n\t\t\th... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Add a device group element. | function addDeviceGroupElement(axios$$1, token, payload) {
return restAuthPut(axios$$1, 'devicegroups/' + token + '/elements', payload);
} | [
"addGroup() {\n this._insertItem(FdEditformGroup.create({\n caption: `${this.get('i18n').t('forms.fd-editform-constructor.new-group-caption').toString()} #${this.incrementProperty('_newGroupIndex')}`,\n rows: A(),\n }), this.get('selectedItem') || this.get('controlsTree'));\n }",
"attac... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
A Formik selector for choosing privileges for members within a team | function MemberPrivilegeSelector(props) {
const { parentId, field, onChange, ...rest } = props;
const { t } = useTranslation("teams");
const selectId = buildID(parentId, ids.EDIT_TEAM.PRIVILEGE);
return (
<FormSelectField
{...rest}
fullWidth={false}
field={fi... | [
"clickOwnersDropdownButton2(){\n this.ownersDropdownButton.click();\n }",
"'click .toggle-private'() {\n\t\tlet private = {\n\t\t\ttaskId: \t\tthis._id,\n\t\t\tsetToPrivate: \t!this.private,\n\t\t};\n\t\tMeteor.call('tasks.setPrivate', private, (error) => {\n\t\t\tif (error)\n\t\t\t\tBert.alert( 'An err... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
The pattern adaptor listens for newListener and removeListener events. When patterns are added or removed it compiles the JSONPath and wires them up. When nodes and paths are found it emits the fullyqualified match events with parameters ready to ship to the outside world | function patternAdapter(oboeBus, jsonPathCompiler) {
var predicateEventMap = {
node:oboeBus(NODE_CLOSED)
, path:oboeBus(NODE_OPENED)
};
function emitMatchingNode(emitMatch, node, ascent) {
/*
We're now calling to the outside world where Lisp-style
lists will... | [
"function Router(){\n\n let routes = [];\n let final = () => {};\n\n /**\n * Called when the router wants to handle an incoming connection.\n * When specify blocking routes.\n * That means that if the next callback is not a 'if' the regular expression\n * is not even tested.\n */\n this.when = (regex, callback... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Renders the AWS CloudFormation properties of an `AWS::AppMesh::VirtualNode.HealthCheck` resource | function cfnVirtualNodeHealthCheckPropertyToCloudFormation(properties) {
if (!cdk.canInspect(properties)) {
return properties;
}
CfnVirtualNode_HealthCheckPropertyValidator(properties).assertSuccess();
return {
HealthyThreshold: cdk.numberToCloudFormation(properties.healthyThreshold),
... | [
"function cfnVirtualGatewayVirtualGatewayHealthCheckPolicyPropertyToCloudFormation(properties) {\n if (!cdk.canInspect(properties)) {\n return properties;\n }\n CfnVirtualGateway_VirtualGatewayHealthCheckPolicyPropertyValidator(properties).assertSuccess();\n return {\n HealthyThreshold: cd... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Makes an AJAX request to a local server function w/ optional arguments functionName: the name of the server's AJAX function to call opt_argv: an Array of arguments for the AJAX function | function Request(function_name, opt_argv) {
if (!opt_argv)
opt_argv = new Array();
// Find if the last arg is a callback function; save it
var callback = null;
var len = opt_argv.length;
if (len > 0 && typeof opt_argv[len - 1] == 'function') {
callback = opt_argv[len - 1];
opt_argv.length--;
}... | [
"function send_ajax_and_run(url, ajax_data, fun_to_run) {\n /**\n * The data is sent as a dictionary with a single entry: 'ajax_data',\n * which has as value a the ajax_data dictionary as a JSON string.\n *\n * url: string\n * the url to which send the request\n * ajax_data: dict\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Open this tool in a new tab | function doOpenTool_newTab(url)
{
var br = getBrowser();
br.selectedTab = br.addTab(url);
} | [
"function NewTab() {\n window.open(url, \"_blank\");\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 if(ev.ctrlKey) { // new tab\n doOpenTool_newTab(url);\n }\n else if(ev.shiftKey) { // open in cur... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Mark property as sold | static async markPropertyAsSold(req, res) {
const id = req.params.id;
const { rows:row } = await queryExecutor(selectUserByEmail, [req.user.userEmail])
const userId = row[0].id;
const { rows, rowCount } = await queryExecutor(getSpecificProperty, [id])
if (rowCount == 0) {
return res.status(404).json({
... | [
"set price(value) {\n this._price = 80;\n }",
"set sellIn(value) {\n if (typeof this.sellIn === 'undefined'){\n this._sellIn = value;\n }\n }",
"changeStockPrices(state) {\n state.stocks.forEach(stock => {\n stock.price = Math.round(stock.price * (1 + Math.random() - 0.5));\n });\n }... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Arguments: progressions (Array of (Array of Fixation)) textLines (Array of (Array of word)) Returns: new sorted array of original and merged progressions (Array of (Array of Fixation)) Notes: 1. Fixations get property "line", the index of line they land onto. 2. Merged sets have property "joined" = 3. Progressions not ... | merge( progressions, textLines ) {
const lineCount = textLines.length;
let result = progressions.map( set => set );
log( '#0:', result.length, '\n', result.map( set => (set.map( fix => fix.id ))) );
// 1. join only long sets
result = joinSetsOfType( result, lineCount, SET_TYPE.... | [
"function mergeNearByWords(data) {\n\n const yMax = coordinatesHelper.getYMax(data);\n data = coordinatesHelper.invertAxis(data, yMax);\n\n // Auto identified and merged lines from gcp vision\n let lines = data.textAnnotations[0].description.split('\\n');\n // gcp vision full text\n let rawText = ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
obtenemos un exchange particular a partir de un id que puede venir del endpoint de getMarket | function getExchange(id) {
return fetch(`${url}/exchanges/${id}`)
.then((res) => res.json())
.then((res) => res.data);
} | [
"getMarketInfo(startingCurrency, endingCurrency) {\n return axios.get(`/marketinfo/${pair(startingCurrency, endingCurrency)}`,\n {\n responseType: \"json\"\n });\n }",
"getAmountById(id) {\n return axios.get(API_URL + \"amount/id/\" + id, {\n headers: authHeader(),\n });\n }",
"... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Creates an Angle object of "radians" radians (float). | function Angle(radians) {
var _this = this;
/**
* Returns the Angle value in degrees (float).
*/
this.degrees = function () { return _this._radians * 180.0 / Math.PI; };
/**
* Returns the Angle value in radians (float).
... | [
"static FromRadians(radians) {\n return new Angle(radians);\n }",
"static FromDegrees(degrees) {\n return new Angle((degrees * Math.PI) / 180.0);\n }",
"degrees() {\n return (this._radians * 180.0) / Math.PI;\n }",
"function cos (angle) { return Math.cos(rad(angle)); ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Pulls List of Potential Leads From the Page | function save_potential_leads(){
//Setup Vars
var potential_leads = [];
// Access Dom and Pull List of Potential Leads
let initial_data = document.getElementById('results-list').getElementsByClassName("result");
for (elt of initial_data){
//Scrape Variables off Page
name = rid_of_amp(elt.getElementsB... | [
"async getAds() {\n try {\n this.spinnerOn();\n const result = await this.axios.get(\n `${this.url}/ads/all?limit=${this.pageLimit}&page=${this.page}`,\n );\n return result.data.ads;\n } catch (error) {\n throw new Error(error);\n }\n }",
"async function getAdvisoryList(r... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
================================================================================================= Function that recursively looks into the input code and gets the definitions of the functions in the code. ================================================================================================= | function listFunctionsRecursive(list)
{
var obj = {};
for (var key in list)
{
if (list.hasOwnProperty(key))
{
obj = list[key];
switch (obj.type)
{
case "FunctionDeclaration":
/*
* In our design we like the input code to be in an array.
* Esprima gives the line numbers starting fr... | [
"function getOperations(){ //-------------> working\n\nvar count = codeLines.length;\n\nfor(var i=0; i<count; i++){ \n\n\t\tvar commentTest = (/@/.test(codeLines[i].charAt(0))); //Checking for comments\n\t\tvar textTest = (/.text/.test( codeLines[i])); //checking for .text keyword \n\t\tvar globalTest = /.glob... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Propiedad que almacena los parametros para hacer la peticion de la Api OpenWeatherMap | get getParamsWeather() {
return {
appid: process.env.OPENWEATHER_KEY,
units: 'metric',
lang: 'es'
};
} | [
"function printOpenWeatherMapsLocationHint () {\n console.log(' \"location\" contains get parameters to send to api.openweathermap.org/2.5/forecast to specify forecast location')\n console.log(' Valid key value pairs are:')\n console.log(' \"q\": \"CITY_NAME,ISO_3166_COUNTRY_CODE\"')\n console.log(' OR'... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Map a family's data for the frontend: | function mapFamily(arr) {
console.log('FAM'.green, arr);
var husbands = arr.filter(node => node.tag === 'HUSB'),
wives = arr.filter(node => node.tag === 'WIFE'),
parents = [],
married = extractValue('MARR', arr),
children = arr.filter(node => node.tag === 'CHIL');
pino.info('... | [
"family(id) {\n\t\tlet arr = this.families.get(id);\n\t\treturn arr || null;\n\t}",
"function ServerBehavior_setFamily(family)\n{\n this.family = family;\n}",
"function load_family_ids() {\r\n\t\tids=[];\r\n\t\trequest('xw_controller=clan&xw_action=view&xw_city=1&xw_person='+User.id.substr(2)+'&mwcom=1&xw_clie... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets the state for a variable with multiple states (original, and temporal) Some variables such as `autoScrolling` or `recordHistory` might change automatically its state when using `responsive` or `autoScrolling:false`. This function is used to keep track of both states, the original and the temporal one. If type is n... | function setVariableState(variable, value, type){
options[variable] = value;
if(type !== 'internal'){
originals[variable] = value;
}
} | [
"function resetVars(state) {\n keepBallAttached = false;\n ballIsUp = false;\n fired = false;\n }",
"function rememberLastState()\n {\n if ( lastState.layout !== \"sidebar\" )\n {\n lastState.position = $ui.position();\n lastState.size =... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Filter Dashboards by collection | function filterDashboardsByCollection(dashboards, collection) {
var filteredDashboards = _.filter(dashboards, function(dashboard) {
return dashboard.collections.indexOf(collection) >= 0;
});
return filteredDashboards;
} | [
"function getDashboardsByCollection(dashboards) {\n var collections = [];\n for(var i=0; i < dashboards.length; i++) {\n collections = _.union(collections, dashboards[i].collections);\n }\n\n var result = {};\n\n for(i=0; i < collections.length; i++) {\n var thisCollection = collection... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
CSS changes when hint is clicked. | function hintStyle() {
document.getElementById("hint").style.display = "none";
document.getElementById("hintDisplay").style.display = "inherit";
document.getElementById("hintDisplay").style.margin = "90px 0px -64px 18px";
} | [
"function changeHint(classChange, innerText, callback) {\n getEl('hintbtn').className = classChange;\n getEl('hintbtn').innerHTML = innerText;\n getEl('hintbtn').setAttribute('onclick',callback);\n}",
"function displayHint() {\n tHint = setTimeout(function () {\n $(\"#hint-content\").addClass... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Factory for query cb that will log all the error locally and return only the error code | function sqlQueryCbFactory (cb) {
return function (sqlQueryErr, result) {
if (sqlQueryErr) {
console.error('Handling query resulted with error:\n' + sqlQueryErr);
console.trace();
if (sqlQueryErr.code) {
sqlQueryErr = sqlQueryErr.code;
}
... | [
"error() {\n return this._send(format.apply(this, arguments), SysLogger.Severity.err);\n }",
"error(errorCode) {\n throw new Error(errors[errorCode] || errorCode);\n }",
"function error(err) {\n if (error.err) return;\n callback(error.err = err);\n }",
"function buildError(code,message){\n re... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Add header contentType to application/json and set body | setBody (body) {
this.headers['Content-Type'] = 'application/json'
this.body = JSON.stringify(body)
} | [
"function processJSONBody(req, controller, methodName) {\n let body = [];\n req.on('data', chunk => {\n body.push(chunk);\n }).on('end', () => {\n try {\n // we assume that the data is in the JSON format\n if (req.headers['content-type'] === \... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
====================================================================================================================== A Grunt files array with extended options. | function GruntFilesArrayExt ()
{} | [
"gruntHtmlmin(opt = undefined) {\n if (this.html.length > 0) {\n const files = {};\n this.html.forEach((asset, index, arry) => {\n const dest = path.join(asset.dest, asset.name);\n files[dest] = dest;\n });\n return {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
The total() function accepts no arguments, iterates through the cart array, and returns the current total value of the items in the cart. | function total()
{
// create var to store total
var total = 0
// check if there are items in the cart:
if(cart.length > 0)
{
// check the cart prices
for(let i = 0; i < cart.length; i++)
{
// tally it up!
total += cart[i].itemPrice
}
}
// return what has been summed up... | [
"function totalPrice(){\n\t\t\t\tvar totalPrice = 0;\n\t\t\t\tfor (var i in cart){\n\t\t\t\t\ttotalPrice += cart[i].price;\n\t\t\t\t}\n\t\t\t\treturn totalPrice;\n\t\t\t}",
"function totalPriceOfCart() {\n return priceArray.reduce((accumulate, currentPrice) => {\n return accumulate + currentPrice;\n }, 0);\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Draw road with moving lines | function drawRoad(counter){
//set background
background(50);
//Space between lines
let space = width / 4;
//Gap between dashed lines
let step = height / 10;
//Line width
let lineW = 10;
//Road lines
//Remove outline on shapes
noStroke();
//Dashed lines
for (i = - 2; i... | [
"function drawRoad(x1, y1, x2, y2, color) {\n ctx.beginPath();\n if (Math.abs(x1 - x2) > EPS) {\n ctx.moveTo(x1, y1 + 5);\n ctx.lineTo(x2, y2 + 5);\n ctx.lineTo(x2, y2 - 5);\n ctx.lineTo(x1, y1 - 5);\n } else if (y1 > y2) {\n ctx.moveTo(x1 - 4.5, y1 - 5);\n ctx.lineTo(x2 - 4.5... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
initializeStaff voices are not sequential, seem to have artitrary numbers and persist per part, so we treat them as a hash. staff IDs persist per part but are sequential. | initializeStaff(staffIndex, voiceIndex) {
if (typeof(this.staffArray[staffIndex].voices[voiceIndex]) === 'undefined') {
this.staffArray[staffIndex].voices[voiceIndex] = { notes: [] };
this.staffArray[staffIndex].voices[voiceIndex].ticksUsed = 0;
// keep track of 0-indexed voice for slurs and other... | [
"addStaffNum(id,){\n this._staffNum.push(id);\n }",
"function MusicStaff() {\n this.count = 5;\n this.gap = 20;\n }",
"function initializeApp(){\n renderAllStaff(staff) ;\n}",
"checkStaffNum(id){\n for (let index = 0; index < this._staffNum.length; index++) {\n if... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
To understand this binding, we have to understand the callsite: the location in code where a function is called (not where it's declared). We must inspect the callsite to answer the question: what's this this a reference to? Finding the callsite is generally: "go locate where a function is called from", but it's not al... | function baz() {
// call-stack is: `baz`
// so, our call-site is in the global scope
console.log('baz');
bar(); // <-- call-site for `bar`
} | [
"function a(){\n// call stack: a->\nb(); //call site\n}",
"function traceCaller(numberOfCalls, stack) {\n let n;\n if (numberOfCalls === undefined || numberOfCalls < 0) n = 1;\n n = numberOfCalls + 1;\n let line = stack.split('\\n')[n];\n const start = line.indexOf('(/');\n line = line.substring... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Uses lat and lon to retreive weather data and convert to json Removes previously created city buttons to prevent duplicates Sends weather data to insertWeatherData function | function getWeather( lat, lon ) {
let key = '9425b5446dc273556c5b70a438f84526';
fetch('https://api.openweathermap.org/data/2.5/onecall?lat=' + lat + '&lon=' + lon + '&units=imperial' + '&appid=' + key )
.then(function(resp) {
return resp.json();
})
.then(function(data) {
insertWeathe... | [
"function dataWeather(data) {\n let kelvinDelta = 273.15;\n var calcCelcius = Math.round(parseFloat(data.main.temp) - kelvinDelta);\n\n let weather = new Weather();\n weather.main = data.weather[0].main;\n weather.temp = calcCelcius;\n weather.wind = data.wind.speed;\n weather.location = data.name;\n docume... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Emit from a mesh. | set Mesh(value) {} | [
"vertexToGeometry () {\n\n let prim = this.prim;\n\n let geo = this.geo; \n\n console.log( 'Mesh::vertexToGeometry()' );\n\n let vertexArr = this.vertexArr;\n\n let numVertices = vertexArr.length;\n\n let indexArr = this.indexArr;\n\n // index array doesn't need to b... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
populate invite button's search results | function populateSearchResultsInvite(results, container)
{
var output = '';
if (results.length < 1) {
// No results
output += "<div class='header-search-result dark-back medium'>No results found</div>";
} else {
// Results found
var limit = (results.length > 5 ? 5 : results.length);
var src, c... | [
"async function searchButtonClicked () {\n var response\n if (toggleValue === 'Name') {\n response = await getNppesDataFirstName(searchText)\n setShowNameSearchResults(true)\n setShowOrgSearchResults(false)\n }\n else {\n response = await getNp... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Parses out all the optional coverages and puts them into groups | function UpdateCoverages(coverages, optionalCoverageTypes) {
var coverageGroups = [];
if (!coverages || coverages.length == 0) {
return coverageGroups;
}
_.each(optionalCoverageTypes, function (optCoverageType) {
var coverage = {
Name: optCoverageType.desc,
Code: optCoverageT... | [
"_groupVitamins () {\n let mini, maxi;\n\n this.groups = {};\n this.vitamins.forEach(vit => {\n if (! this.groups[vit.color]) this.groups[vit.color] = { vitamins: [], mini: null, maxi: null };\n\n // Set mini in color group\n mini = this.groups[vit.color].mini;\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Enable the selection manager. | enable() {
this._enabled = true;
this._model = new SelectionModel(this._bufferService);
} | [
"enableSelectingChooser(shouldEnable) {\n this.chooserButton.enable(shouldEnable);\n }",
"function initSelection() {\n canvas.on({\n \"selection:created\": function __listenersSelectionCreated() {\n global.console.log(\"**** selection:created\");\n setActiveObject();\n toolbar.showActiv... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Opens the invite link dialog. | openLinkDialog () {
if (!this.view) {
this.initDialog();
}
this.view.open();
} | [
"function showInsertLinkDialog(list) {\n var itemList = [];\n tinymce.each(list, function(item) {\n itemList.push({ text: item.attachment, value: item.attachment });\n });\n \n function onSubmit() {\n var filename = this.find('#insert').value();\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
function locationChanged function mergeDuplicates This method is called when the user requests to merge all duplicates of the current location Input: thisinstance of | function mergeDuplicates()
{
var form = this.form;
var mainIdlr = form.idlr.value;
var parms = {};
parms['to'] = mainIdlr;
var from = '';
for (var i = 0; i < form.elements.length; i++)
{ // loop through duplicates
var elt = form.elements[i];
if (elt.name)
{ // element has a name... | [
"function updatePlacesLocationInformation() {\n\tupdatePlacesLocationInformationFromCategory(\"\", \"All Categories\");\n}",
"function locationUpdateTask(self, next) {\n\n var self = self;\n\n var locationTask = new TaskContainer(self);\n\n async.waterfall(\n [\n locationTask.start,\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns a widget which allows to switch currency; if an html node is supplied, appends the widget as a child of that node. | function getCurrencyWidget(parent) {
var widget = document.createElement("select");
widget.id = "currencyWidget";
widget.name = "currency";
var option = document.createElement("option");
option.value = "CAD";
option.id = "CAD";
option.selected = "selected";
option.innerHTML = "Canadian Dollar";
widget.appendCh... | [
"function genCurrencyExchangeHtml(viewModel, cryptoCurrency, cryptoData) {\n var change = cryptoData[viewModel.selectedExchange].change;\n var exchangeRateHtml;\n if (change > 0) {\n exchangeRateHtml = \"<i class='fa fa-arrow-circle-up text-success'></i> +\" + change.toFixed(2) + \"%\";\n } else ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Remove picks from match | function removePicks(matchID)
{
//remove picks with same match_id
$scope.picks = $.grep($scope.picks, function (item) {
return item.match_id !== matchID;
});
} | [
"function resetMatchedCards() {\n matchedCards = [];\n}",
"function removeCandidatePosition() {\n \t candidatePositions.pop();\n \t numCandidates -= 1;\n } // removeCandidatePosition",
"function clearMap(retainSampleCombo, retainMapMatchedGroups){\n\t\troadGroups.forEach(function (val, idx){\n\t\t\tval... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Randomizes obstacle X location | function obstacleLocX() {
var number = Math.floor(Math.random() * 3) + 1;
if (number === 1) {
return 200;
} else if (number === 2) {
return 300;
} else {
return 400;
}
} | [
"function obstacleLocY() {\n var number = Math.floor(Math.random() * 5) + 1;\n if (number === 1) {\n return 58;\n } else if (number === 2) {\n return 141;\n } else if (number === 3) {\n return 224;\n } else if (number === 4) {\n return 307;\n } else {\n return 39... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This object class is used to keep track of the Live Regions on the page | function LiveRegions() {
this.list = [];
this.count = 0;
} | [
"getSelectedRegions() {\r\n const regions = this.lookupSelectedRegions().map((region) => {\r\n return {\r\n id: region.ID,\r\n regionData: region.regionData,\r\n };\r\n });\r\n return regions;\r\n }",
"static get hotelList() {\n return... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get the JS object corresponding to the given schema version. This object will contain both tables and indexes, where indexes are prefixed with "idx_". | function getSqlTable(schemaVersion) {
let version = "v" + (schemaVersion || DB_SCHEMA_VERSION);
if (version in upgrade) {
return upgrade[version]();
} else {
return {};
}
} | [
"getMetaSchema() {\n return META_SCHEMA[this.jsonSchemaVersion];\n }",
"async getJsonSchema(obj) {\n var self = this;\n\n // start creating the schema\n var jsonSchema = {\n definitions: {},\n \"$schema\": \"http://json-schema.org/draft-07/schema#\",\n typ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Toggle handler for diplaying/hiding feedback | function toggleFeedback(feedbackText, answerIcon, btnPic, altPic) {
if ($("#feedbackDiv:visible").length) {
$("#FBarrow").remove();
$("#feedbackDiv").remove();
questionHTML.show();
$("#questionBottom").show();
} else {
questionHTML.hide();
$("#questionBottom").hide();
f... | [
"function toggle_info() {\n toggle_button = document.getElementById(\"dialogue_toggle\");\n if(toggle_button.innerHTML==\"Show Help\"){\n show_help();\n toggle_button.innerHTML = \"Show Data\";\n } else {\n toggle_button.innerHTML = \"Show Help\";\n build_data();\n }\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Dispatches `count` entities with false dependencies, causing them to destroy themselves. | ignore(count) {
for (var length = this.index + count; this.index < length; ++this.index) {
this.get(this.index).dependOn(FALSE_PREDICATE).dispatch();
}
} | [
"function finalizeCount() {\n return 0;\n}",
"resetCount() {\n this.setStatistics({\n fetchedDocuments: 0,\n migratedDocuments: 0,\n totalDocuments: 0,\n ignoredDocuments: 0,\n });\n }",
"async count(where = {}, options = {}) {\n return this.em.count(this.entityName, where, op... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Runs specified data transforms / joins, adding results to data object | function applyDataJoin(d){
// Helper function for unpacking arguments into join function
var functName = d.functName,
geoData = that.data[d.geoData],
joinData = that.data[d.joinData],
otherArgs = d.otherArgs;
var args = [geoData, joinData].concat(otherArgs);
return functName.apply(this... | [
"function resetDataFromSourceEntities(data) {\n return function (sourceObjects) {\n\n //The actual sourceObjects aka sourceEntities of this batch\n data.sourceObjects = sourceObjects;\n\n //Map containing <refNorm,sourceRefId> for each existing refNorm. \n //This is used to add sourceRefId to... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Private function that adds a child to a 'edit' type multiselect | function addChildEdit(key,val,options,select_object){
if(key != ""){
if(!options.uniquechildren || !in_array(input_field.val(),key)){
var spinner = select_object.after("<div class='spinner'></div>").next();
$.post(options.actionUrl,{parent:options.parentId,son:key},function(data){
spinner.remove... | [
"function addChild(child) {\n if (typeof child.setHeightChangeCallback != \"undefined\")\n child.setHeightChangeCallback(recalcHeight);\n\n var index = getToggledIndex();\n if (index == -1) {\n // insert at end\n children.push(child);\n }\n else {\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
the function to search for concerts of an artist | function concertSearch() {
let search = process.argv.splice(3).join("%20");
let queryURL = "https://rest.bandsintown.com/artists/" + search + "/events?app_id=" + concerts.id;
// actual request for the concerts
axios.get(
queryURL
).then(function (response) {
let concert = response.... | [
"function discog(artist) {\n var apiKey = \"523537\";\n var queryURL =\n \"https://theaudiodb.com/api/v1/json/\" +\n apiKey +\n \"/searchalbum.php?s=\" +\n artist;\n $.ajax({\n url: queryURL,\n method: \"GET\",\n }).then(function (discResponse) {\n // this for loop ite... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Filtered todo items decorated with editing status relative to todo that's being edited | get editableTodos() {
return this.filteredTodos.map(todo => ({ ...todo, editing: todo.id === this.editing.id }))
} | [
"function toggleTodoBeingEditedStatus(id) {\n const todos = props.todos;\n const arrayIndex = todos.findIndex((todo) => todo.id === id);\n const oldTodo = todos[arrayIndex];\n const newTodo = {\n ...oldTodo,\n isBeingEdited: !oldTodo.isBeingEdited\n };\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Bootstrap styling for the tag color of the device | function styleForTagColor(tagColor) {
const prefix = "form-control bg-form-box text-form-color border-";
if (tagColor !== null && tagColor !== undefined) {
// eslint-disable-next-line default-case
switch (tagColor) {
case "white":
return prefix + "white";
case "White":
... | [
"getColor() {\n if (this.temperature <= 15) {\n return \"blue\";\n } else if (this.temperature <= 30) {\n return \"orange\";\n } else {\n return \"red\";\n }\n }",
"getColor() {\n if (this.state.erasing) { // This ensures that upon erase tool sele... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
If shippingCountriesOnly is set to true, will return the list of countries the shop ships to. Otherwise returns null. | function loadShippingCountries(shippingCountriesOnly) {
if (!shippingCountriesOnly) {
// eslint-disable-next-line no-undef
return Promise.resolve(null);
}
const response = fetch(`${location.origin}/meta.json`);
return response
.then((res) => {
return res.json();
})
.then((meta) => {
... | [
"async getAllShippingOptions () {\n return this._api.request('InvoiceService.getAllShippingOptions')\n }",
"function searchByCountryName() {\n const selectedCountryName = convertToLowerCase(select.value);\n result = products.filter(item => {\n return item.shipsTo.some(shippingCountry => {\n return c... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
void rockyground (int roughness, int rounding, char level) | function rockyground(roughness, rounding, level) {
// Produce una superficie pi— o meno accidentata.
for (ptr = 0; ptr < 40000; ptr++) p_surfacemap[ptr] = RANDOM(roughness);
smoothterrain(rounding);
for (ptr = 0; ptr < 40000; ptr++) {
if (p_surfacemap[ptr] >= Math.abs(level)) {
p_surfacemap[ptr] += le... | [
"function Round(new_level, new_answer) {\n this.level = new_level;\n this.guesses = [];\n this.answer = new_answer;\n this.times = [];\n}",
"function updateCurrentRound(){\n ++currentRound;\n}",
"function roundResult(playerWin, playerSelection, computerSelection) {\n if (playerWin) return \"Yo... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
JSON Pointer specification: from obj, return the property with a JSON Pointer prop, optionally setting it to newValue | function jptr(obj, prop, newValue) {
if (typeof obj === 'undefined') return false;
if (!prop || typeof prop !== 'string' || (prop === '#')) return (typeof newValue !== 'undefined' ? newValue : obj);
if (prop.indexOf('#')>=0) {
let parts = prop.split('#');
let uri = parts[0];
if (uri... | [
"function convertProperty(obj, prop, newProp) {\n if (obj.hasOwnProperty(prop)) {\n obj[newProp] = obj[prop];\n delete obj[prop];\n }\n return obj;\n}",
"set(propObj, value) {\n propObj[this.id] = value;\n return propObj;\n }",
"ensureProperty(obj, prop, value) {\n if (!(prop ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Formats csv menu data in the structure accepted by radial menu Assumes menu csv is sorted by Id and Parent both Ascending | function formatMarkingMenuData(data) {
var records = data.split("\n");
var numRecords = records.length;
var menuItems = {}
// Parse through the records and create individual menu items
for (var i = 1; i < numRecords; i++) {
var items = records[i].split(',');
var id = items[0].trim();
var label = items[2].tr... | [
"function formatRadialMenuData(data) {\n\n\tvar records = data.split(\"\\n\");\n\tvar numRecords = records.length;\n\tvar menuItems = {}\n\n\n\n\t// Parse through the records and create individual menu items\n\tfor (var i = 1; i < numRecords; i++) {\n\t\tvar items = records[i].split(',');\n\t\tvar id = items[0].tri... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
function : show_job parameter : page, process_name what does this function do : Show Jobs, hide Messages on clicks | function show_job(page, process_name) {
// Save info of the opened tab
msg_or_job = 'Job';
ProcessJobUpdate(page, process_name, true);
} | [
"function show_message(page, process_name) {\n // Save info of the opened tab\n msg_or_job = 'Msg';\n ProcessMsgUpdate(page, process_name, true);\n}",
"function ExpandedTabUpdate(process_name, msg_or_job, inside_page) {\n $(\"#\" + process_name).addClass(\"table_row_selected\");\n if (msg_or_job ==... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
AXESRELATED FUNCTIONALITY. TODO: separate to its own mixin Initialize Axes Helper XYZ axes with a mesh plane in XY. | initAxes() {
// length of the axes
const length = 100;
const lineMaterial = new THREE.LineDashedMaterial({
...this.settings.lineMaterial,
color: this.settings.colors.amber,
});
const points = [
new THREE.Vector3... | [
"function componentAxis () {\r\n\r\n\t/* Default Properties */\r\n\tvar dimensions = { x: 80, y: 40, z: 160 };\r\n\tvar color = \"black\";\r\n\tvar classed = \"d3X3domAxis\";\r\n\tvar labelPosition = \"proximal\";\r\n\tvar labelInset = labelPosition === \"distal\" ? 1 : -1;\r\n\r\n\t/* Scale and Axis Options */\r\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Bring browser focus to the specified object. Use of setTimeout is to get around an IE bug. (See, e.g., obj: a jQuery object to focus() | function focus_with_timeout(obj) {
setTimeout(function() { obj.focus(); }, 50);
} | [
"function setFocus(id) {\n validation = false;\n id_to_focus = id;\n window.setTimeout(setTimerFocus, 100);\n}",
"function SetFocus(strID) {\n\n\tif (!g_bFullScreen) {\n\t\t//MFBar.SetObjectFocus(strID, true);\n\t\tg_strFocusObj = strID;\n\t\tMFBar.SetTimeOut(2, FOCUSTIMER);\n\t}\n\telse {\n\t\t//MFBar.S... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Check if a value is a list of `Operation` objects. | isOperationList(value) {
return Array.isArray(value) && (value.length === 0 || Operation.isOperation(value[0]));
} | [
"isOperationList(value) {\n return Array.isArray(value) && value.every(val => Operation.isOperation(val));\n }",
"function ISARRAY(value) {\n return Object.prototype.toString.call(value) === '[object Array]';\n}",
"isList(expression) {\n doCheck(expression.type.constructor === ListType, \"Not a list... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
store to localStorage by key | function store(data,key) {
localStorage[key] = JSON.stringify(data);
} | [
"function setLocalStorage(key, value) {\n var ood_key = KEY_PREFIX + key;\n localStorage.setItem(ood_key, value);\n return null;\n}",
"function updateLocalStorage(key, data) {\n let dataString = JSON.stringify(data);\n localStorage.setItem(key, dataString);\n}",
"function setItem(map, key, value)... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
ngquill END Inicializar ngflow : | function initFlow() {
return {
chunkSize: 104857600, // 100mb
target: config.REST_URL + '/publish/email/mensagem/upload',
//target: 'http://localhost:8500/rest/seeaway-app/contabil/upload',
query: {
type: 'contabil-upload'
... | [
"constructor() { \n \n FlowLog.initialize(this);\n }",
"initTypeIt() {\n new typeit__WEBPACK_IMPORTED_MODULE_0__[\"default\"](`#${this.typeItContainer.id}`, {\n strings: this.typeItStringArray,\n lifeLike: true,\n loop: true,\n waitUntilVisible: ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Prints a creek at x,y | function printCreek(x, y, color) {
if(!color)
color ="#FF0000"
printCircle(x, y, tile_size/2, color);
} | [
"Print() {\r\n const supbgn = '<sup>';\r\n const supend = '</sup>';\r\n const arexp = [];\r\n for (let i = 0; i < this._term.Length(); ++i) {\r\n arexp.push(this._term.GetElement(i).Exp);\r\n }\r\n if (arexp.length === 0) {\r\n return '';\r\n }\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
populate(); Search the max volume of the suv, sort descending | function search()
{
//Show 10 hits
return client.search({
index: "suv",
type: 'suv',
body: {
sort: [{ "volume": { "order": "desc" } }],
size: 10,
}
});
} | [
"function sortByVol(a,b) {\n if (a.volume < b.volume) {\n return 1;\n }\n else if (a.volume > b.volume) {\n return -1;\n }\n else {\n return 0;\n }\n }",
"async sortSolutionsDescending() {\n var sortedIndexes = Array.from(this.po... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Words in the list of banned words are given in lowercase, and free of punctuation.Words in the paragraph are not case sensitive.The answer is in lowercase. Example: Input: paragraph = "Bob hit a ball, the hit BALL flew far after it was hit." banned = ["hit"] Output: "ball" Explanation: "hit" occurs 3 times, but it is a... | function mostCommonWord() {
// 819
var paragraph = 'a.'; //'Bob hit a ball, the hit BALL flew far after it was hit.';
var banned = [];
let bannedWords = new Set();
for (const word of banned) {
bannedWords.add(word);
}
paragraph = paragraph
.replace(/[^a-zA-Z]/gi, ' ')
.toLowerCase(... | [
"function solution(paragraph, banned) {\n const bannedWordSet = new Set(banned);\n const wordsMap = new Map();\n let splittedSentence = paragraph.toLowerCase().split(\" \");\n let result = '';\n\n for(let i = 0; i < splittedSentence.length; i++) {\n let tmp = '';\n\n splittedSentence[i].split('').forEach... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Downloads and installs all selected translations | async _installPacks(selected) {
this.inProgress = true
let client = new game.moulinette.applications.MoulinetteClient()
let babeleInstalled = false
let coreInstalled = false
try {
// installed packs
let packInstalled = game.settings.get("moulinette", "packInstalled")
// b... | [
"function getTranslations(currDir, translations, strings) {\n if(fs.existsSync(currDir)) {\n // Load translations.json file in current directory, if any\n if(fs.existsSync(path.join(currDir, \"translations.json\"))) {\n translations = mergeObjs(translations,\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Challenge 1 Sort players in descending order of their age | function SortByAge() {
player = players.sort(function (a, b) {
return b.age - a.age
});
} | [
"function SortByNamexOlderThan(age) {\n let choosenPlayers = []\n for (const player of players) {\n if (player.age >= age) {\n let sortedAwards = player.awards\n sortedAwards.sort((award1, award2) => {\n if (award1.year > award2.year) {\n return -1\n } else {\n return ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
refresh tax rate list | function refreshTaxRateList() {
return api.taxRate.getAllList()
.success(function (data) {
$scope.taxRateList = data;
$scope.$safeApply();
});
} | [
"function updateAllTaxes() {\n\tvar max_row_count = document.getElementById('proTab').querySelectorAll('[id^=\"row\"]').length;\n\tfor (var i=1; i<=max_row_count; i++) {\n\t\tloadTaxes_Ajax(i);\n\t}\n\tloadGlobalTaxes_Ajax();\n}",
"async function processTaxRate({ctpClient, taxRateDraftList, taxRateIdToTaxCategory... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
adds an operator to a field, handling the case where there is already another operator there | function addOperator(obj, field, operator, operand) {
if(obj[field] === undefined) {
obj[field] = {}
}
obj[field][operator] = operand
} | [
"function appendOperator(operator) {\n appendNumberOrOperator(operator);\n}",
"function insertOp(op) {\n\ttextview.value = exp + op;\n\toperator = true;\n\tequal = false;\n}",
"function appendNumberOrOperator(value) {\n resultInput.value += value;\n}",
"function addOperator(buttonVal) {\n\tdisplay = $(\".di... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Will scroll the position of the Focus Mode sidebar to the active step. | function learndashFocusModeSidebarAutoScroll() {
if ( jQuery( '.learndash-wrapper .ld-focus' ).length ) {
var sidebar_wrapper = jQuery( '.learndash-wrapper .ld-focus .ld-focus-sidebar-wrapper' );
var sidebar_curent_topic = jQuery( '.learndash-wrapper .ld-focus .ld-focus-sidebar-wrapper .ld-is-current-item' );
... | [
"focusAndScroll() {\n this.scrollIntoView({block: 'nearest'});\n this.focus({preventScroll: true});\n }",
"saveScrollAndFocus () {\n this.activeElement = document.activeElement; // returning focus from ReactModal is not working properly, so storing a reference in here to return it\n this.scrollingPar... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Visit a parse tree produced by PlSqlParserinterval_expression. | visitInterval_expression(ctx) {
return this.visitChildren(ctx);
} | [
"visitInterval_expr(ctx) {\n\t return this.visitChildren(ctx);\n\t}",
"function parse_IntExpr(){\n\tdocument.getElementById(\"tree\").value += \"PARSER: parse_IntExpr()\" + '\\n';\n\tCSTREE.addNode('IntExpr', 'branch');\n\n\t\n\tvar tempDesc = tokenstreamCOPY[parseCounter][0]; //check desc of token\n\tvar tempTy... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Attempts to recursively traverse the IgnitionGrid from [sourceX, sourceY] towards a direction | traverseRecursive (sourceX, sourceY, towards, depth) {
this._maxDepth = Math.max(depth, this._maxDepth)
// runaway truck ramp
if (depth > 10000) throw Error('walk() depth exceeds 10000')
this._walk.points.tested++
// Get the neighboring point's coordinates within the IgnitionGrid
const [x, y] =... | [
"traverseStack () {\n const stack = []\n this._maxDepth = 0\n EightWays.forEach(towards => { stack.push([0, 0, towards, 1]) })\n while (stack.length) {\n const [sourceX, sourceY, towards, depth] = stack.pop()\n this._maxDepth = Math.max(depth, this._maxDepth)\n\n // Get the neighboring po... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Map and reduce collected Storybook stories into an array of snapshot options | function mapStorybookSnapshots(stories, { previewUrl, flags, config }) {
let log = logger('storybook:config');
let invalid = new Map(stories.invalid);
let conf = encodeStorybookConfig(config, invalid);
let snapshots = stories.data.reduce((all, story) => {
if (shouldSkipStory(story.name, story, config)) {
... | [
"convertStory(story){\n if(story.media.length === 1) return [{\n ...story,\n orderNum: 1, // Important for our custom slider component \n }]\n \n const stories = [];\n story.media.forEach(singleMedia => {\n singleMedia.orderNum = 1; // Important ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Function to generate customer informations bloc according contact informations in order object generated by sendRequest function Parameter: data => object order generated by sendRequest function (parsed) | function customerInfos(data) {
let infosTarget = ["firstName","lastName","address","city","email"];
for ( let info of infosTarget) {
for ( let key in data.contact) {
if ( info == key) {
createObject(info,"span",null,data.contact[key],0);
}
}
}
} | [
"function massageOrderData(order_data) {\n const orders = [];\n for(let i = 0; i < order_data.length; i += 5) {\n\n let t, message, diff;\n \n t = new Date(order_data[i + 4]);\n diff = Math.floor((t - new Date()) / 60000);\n\n if(diff > 0) {\n message = C.MESSAGE_TO_CUSTOMER(di... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |