query stringlengths 9 34k | document stringlengths 8 5.39M | negatives listlengths 19 20 | metadata dict |
|---|---|---|---|
Creates and appends a button that will be used to open the dialog | createOpenDialogBtn(text, appendTo)
{
let btn = $('<button class="element_toggler btn btn-primary" style="float: left; margin-right: 5px;" aria-controls="'+this.id+'" aria-label="Toggle '+this.id+' modal">' + text + '</button>');
btn.appendTo(appendTo);
} | [
"function AddButton(elt, text, action)\r\n{\r\n\tvar buttonSpan = document.createElement('span');\r\n\tbuttonSpan.className = 'geDialogButtonSpan';\r\n\tmxEvent.addListener(buttonSpan, 'mouseover', mxUtils.bind(this, function()\r\n\t{\r\n\t\tbuttonSpan.className = 'geDialogButtonSpanHover';\r\n\t}));\r\n\tmxEvent.a... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
A signal emitted when a widget is added. Notes This signal will only fire when a widget is added to the tracker. It will not fire if a widget is injected into the tracker. | get widgetAdded() {
return this._widgetAdded;
} | [
"add(widget) {\n if (this._tracker.has(widget)) {\n let warning = `${widget.id} already exists in the tracker.`;\n console.warn(warning);\n return Promise.reject(warning);\n }\n this._tracker.add(widget);\n this._widgets.push(widget);\n let injecte... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
save the global choice map | function saveChoices(map) {
var pn = getPlayerNameFromCharpane();
if (pn) {
var s = '';
for (var cnum in map) {
s += cnum+':'+map[cnum]+';';
}
//GM_log('setting map to: '+s);
GM_setValue(pn+'_ncactionbar_choices',s);
}
} | [
"function saveOptions() {\n var dictionaries = JSON.parse(window.localStorage.getItem('dictionaries'));\n\n // Saves custom dictionries to local storage(if any).\n if (tempCusDictionaries.length > 0) {\n if (dictionaries) {\n dictionaries = dictionaries.concat(tempCusDictionaries);\n window.localSto... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
if we didn't set the nodeAccount and nodeAddress when we initialised the client, we can use this method | withNode(nodeAccount, nodeAddress = undefined) {
this.setNodeAccount(nodeAccount)
// if nodeAddress is undefined, this.setClients is smart enough to retrieve
// the appropriate node address from our address book
this.setClients(nodeAddress)
... | [
"constructor(nodeAccount = undefined, nodeAddress = undefined) {\n if (nodeAddress !== undefined) {\n this.setClients(nodeAddress)\n }\n if (nodeAccount !== undefined) {\n this.setNodeAccount(nodeAccount)\n }\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
utility function returns back array of cue point meta data used to render dynamic CTAs | function parseCuePointMetaData(cuePointData) {
return cuePointData.metadata.split(';');
} | [
"function getFrameMetaData() {\n let ret = [];\n for(let i=1; i<total_frame+1; i++) {\n let tab_indexes = preparation_editor.getTrackletsIndexes(i, false, true);\n let keypoints = frames_data[i];\n let o = {};\n o.ActsOnStage = [];\n for( let obj of tab_indexes) {\n if(obj.act ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Bind all DOM nodes with stext attributes to properties matching the value of the attribute | bindToDom() {
document
.querySelectorAll("[s-text]")
.forEach(x => this.syncNode(x, x.attributes["s-text"].value));
} | [
"function bind(attr) {\n if (typeof arguments[1] === 'function') {\n var node = document\n var fn = arguments[1]\n } else {\n var node = arguments[1]\n var fn = arguments[2]\n }\n var nodes = node.querySelectorAll('[' + attr + ']')\n for(var i = 0; i < nodes.length; ++i) {\n fn(nodes[i], nodes[i... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
When depth changed, check if it's under mega menu and add/remove class accordingly | depthChangeListener() {
const $menu = document.querySelector('.menu');
$menu.addEventListener('mouseup', (e) => {
const $target = e.target.classList.contains('menu-item') ? e.target : e.target.closest('.menu-item');
if (!$target) { return; }
// wait until the class is changed
setTimeout... | [
"function menuAddClaass() {\n _menu.find(\"li\").has(\"ul\").addClass(\"hasChild\");\n _megamenu.find(\"li\").has(\"ul\").addClass(\"hasChild\");\n }",
"isChildItem($item) {\n return $item.classList.contains('menu-item-depth-1') || $item.classList.contains('menu-item-depth-2');\n }",
"function addMen... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Registers an icon set using an HTML string in the default namespace. | addSvgIconSetLiteral(literal, options) {
return this.addSvgIconSetLiteralInNamespace('', literal, options);
} | [
"static registerIconset(setName,icons){this[setName]=icons}",
"addSvgIconSetLiteralInNamespace(namespace, literal, options) {\n const sanitizedLiteral = this._sanitizer.sanitize(_angular_core__WEBPACK_IMPORTED_MODULE_0__[\"SecurityContext\"].HTML, literal);\n if (!sanitizedLiteral) {\n th... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Random number from the "numbers" string Function that returns a random symbol | function getRandomSymbol(){
const symbols = `!@#$%^&*(){}[]=<>/,.`;
// Returning a random symbol using a random index in the "symbols" string
return symbols[randomIndex(symbols)];
} | [
"function symbolGen() {\n var symbols = \"!@#$^&*(){}=<>/,.\";\n ran_num = Number.parseInt(Math.random() * 15);\n return symbols[ran_num];\n}",
"function getRandomSymbol(){\n const symbols='!@#$%^&*()_+<>/,.{}[]'\n return symbols[Math.floor(Math.random()*symbols.length)];\n}",
"function getRandomSymbol... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
fonction pour cacher les sections. On utilise le setTimeout pour que l'api google map a le temps de se charger | function hidenSections() {
setTimeout(function () {
sectionFormulaire.hide();
divMap.hide();
}, 1000);
} | [
"function loadCity(cities, windowWidth) {\n var currentCity = cities[0]\n if (cities.length){\n currentLength = cities.length\n addDivs(currentCity, windowWidth)\n mapOptions = setMapOptions(currentCity[1],currentCity[2])\n\n //make the bike map\n bikeMap = new google.ma... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Creates index file for proto functions | function createIndexFile() {
let indexTS = '';
for(let filepath of protoImportList) {
const dir = path.parse(filepath).dir;
const filename = path.parse(filepath).name + '_pb';
const indexpath = path.join(dir, filename);
indexTS += "export * from './functions/" + indexpath + "';\n";
}... | [
"function createServiceIndexFile() {\n let template = require('./generators/index_gen')(serviceObj);\n fs.writeFile(`${dir}index.js`, template, (err) => {\n if (err) console.log(`... an error occured while creating service ...`);\n else console.log(`... service created ...`);\n });\n}",
"cr... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This funnction returns an array of intervals that are multiplied n times. So if we want a stack of 4 major thirds, we say stack("3M", 4); | function stack(interval, n) {
let array = Array(n);
array.fill(interval);
return array.map((n, i) => Tonal.Interval.fromSemitones(Tonal.Interval.semitones(n) * (i + 1)));
} | [
"function stackBoxes(n) {\n return n * n;\n }",
"static star(n) {\n if (typeof n !== 'number' || n < 1) {\n return [];\n }\n let sequence = [];\n for (let i = 1; i <= n; i++) {\n sequence.push(6 * i * i - 6 * i + 1);\n }\n return sequence;\n }",
"function star(n) {\n var ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
move from source and return target, while carving walls | dig(source, target) {
if (source && target) {
let dx = target.x - source.x;
let dy = target.y - source.y;
if (dx > 0) {
source.walls[RIGHT] = false;
target.walls[LEFT] = false;
} else if (dx < 0) {
source.walls[LEFT] = false;
target.walls[RIGHT] = false;
... | [
"function movetarget() {\n\n // Change the target's velocity at random intervals using Perlin noise\n targetVX = map(noise(targetTX), 0, 1, -targetMaxSpeed, targetMaxSpeed);\n targetVY = map(noise(targetTY), 0, 1, -targetMaxSpeed, targetMaxSpeed);\n\n // Update target position based on velocity\n targetX = tar... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
getTrashBounds() Returns the bounding rectangle for the trash icon. Requires jQuery | function getTrashBounds(){
// By far, the easiest way to do this is with jQuery. They handle a
// lot of cross-browser and calculation junk for you.
var trash = $('#trash');
var x = trash.offset().left;
var y = trash.position().top;
var width = tra... | [
"getTrashStyle(isDraggingOver) {\n return (\n {\n background: isDraggingOver ? '#5bc0dea8' : '',\n display: 'flex',\n padding: this.state.gridElements,\n minHeight: '100px',\n alignItems: 'center',\n justifyC... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Call the function after the given timeout, resetting the timer if delay is called again with the same function. | function delay(timeout, func) {
if (func.timer) {
clearTimeout(func.timer);
}
func.timer = setTimeout(func, timeout);
} | [
"callFuncAfterTimer(func, param, delay) {\n this.delayTimeout = setTimeout(() => {\n func(this, param);\n }, delay);\n }",
"function onTimeout(fn, delay){\n if(delay){\n setTimeout(fn, delay);\n } else {\n fn();\n }\n }",
"function setCustomTimeout(fn, delay){\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This sample demonstrates how to Synchronously creates a new service topology or updates an existing service topology. | async function createATopologyWithoutArtifactSource() {
const subscriptionId = "caac1590-e859-444f-a9e0-62091c0f5929";
const resourceGroupName = "myResourceGroup";
const serviceTopologyName = "myTopology";
const serviceTopologyInfo = {
location: "centralus",
tags: {},
};
const credential = new Defau... | [
"async function createATopologyWithArtifactSource() {\n const subscriptionId = \"caac1590-e859-444f-a9e0-62091c0f5929\";\n const resourceGroupName = \"myResourceGroup\";\n const serviceTopologyName = \"myTopology\";\n const serviceTopologyInfo = {\n artifactSourceId: \"Microsoft.DeploymentManager/artifactSou... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
If mod is like 'remoteXXX:/com/user/index.js', replace remoteXXX with path defined in init() | function reBase(mod) {
var offset = mod.indexOf(REMOTE_SEPERATOR);
if (offset > 0) {
return REMOTE_BASE[mod.substr(0, offset)] + mod.substr(offset + 1);
} else {
return '';
}
} | [
"function GetModURL() {\n\tvar name = 'RollerCoasterTycoon';\n\tvar url = document.getElementById('modscript_' + name).getAttribute('src');\n\turl = url.replace(name + '.js', '');\n\treturn url;\n}",
"replacePublicPath(compiler) {\n const { mainTemplate } = compiler\n this.getHook(mainTemplate, 'require-ext... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Function: MV_Kill Stops output of the voice associated with the specified handle. | function MV_Kill(handle) {
var voice;
var flags;
var callbackval;
if (!MV_Installed) {
MV_SetErrorCode(MV_NotInstalled);
return (MV_Error);
}
//flags = DisableInterrupts();
voice = MV_GetVoice(handle);
if (!voice) {
//RestoreInterrupts( flags );
MV_SetE... | [
"function kill() {\n\tclip = 0; \n\tctlout_stop();\n}",
"kill() {\n if (!this.process) return;\n if (this.inputMedia && this.inputMedia.unpipe) {\n this.inputMedia.unpipe(this.process.stdin);\n }\n this.process.kill('SIGKILL');\n this.process = null;\n }",
"function killAudio() {\n quest... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Outputs proper Achievement div in the Achievments row | function Achievement (element,elementClass,color){
if (element.hasClass('player') && !$('#achievements').hasClass(elementClass)) {
var $achievement = $('<div>')
var $title = $('<p></p>')
$title.addClass('title')
$title.text(elementClass + " Master")
$a... | [
"displayAchievements(achievements) {\n this.elementList.achievementDisplay.innerHTML = '<hr><h5 class=\"center-align\">Achievements</h5>';\n achievements.forEach((achievement) => {\n const opaqueness = achievement.unlocked ? '' : 'opaque';\n const tooltip = achievement.unlocked ? achievement.descrip... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
handleClickOnComponent method accept the component data make the selected component active invokes callback to add component to the graph and hides the search bar | handleClickOnComponent(item, e) {
if(item.id === this.state.activeComponentId) {
this.setState({activeComponentId: '', activeComponentName: ''});
} else {
if(item.subType === 'CUSTOM') {
let config = item.topologyComponentUISpecification.fields,
name = _.find(config, {fieldName: "n... | [
"highlightComponent(keyCode) {\n let items = document.getElementsByClassName('list-item');\n items = Array.prototype.slice.call(items,0);\n let activeItem = document.getElementsByClassName(\"activeItem\");\n let itemIndex = null, newId = null, newItem = null;\n let {entities} = this.state;\n let n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Takes back a null move Essentially take move but we don't take back an actual move on the Game Board | function TakeNullMove ()
{
//Updating Game Board members
GameBoard.hisPly--;
GameBoard.ply--;
//If there was an en passant square, we need to reset it (hash it out), because this
//square is reset every turn
if (GameBoard.enPas != SQUARES.NO_SQ)
{
HASH_EP();
}
//Updating Game Board members
GameBoard.cas... | [
"function MakeNullMove ()\n{\n\tGameBoard.history[GameBoard.hisPly].posKey = GameBoard.posKey;\n\t\n\t//If there was an en passant square, we need to reset it (hash it out), because this\n\t//square is reset every turn\n\tif (GameBoard.enPas != SQUARES.NO_SQ)\n\t{\n\t\tHASH_EP();\n\t}\n\t\n\t//Updating the history ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Define interactivity for resource list e.g. onClick() | function setResourceListInteractions(element) {
const categoryNames = $(`#${element.attr('id')} .category-name`);
categoryNames.on('click', (e) => {
const categoryName = $(e.currentTarget);
const resources = categoryName.parent().children('.resource');
// toggle list
resources.... | [
"static bindListManipulationButtons() {\n TaskView.completeAllButton.onclick =\n TaskController.completeTasksOfCurStage.bind(null);\n TaskView.resetAllButton.onclick =\n TaskController.resetTasksOfCurStage.bind(null);\n TaskView.nextCompletedButton.onclick =\n T... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
convert latitude, longitude to UTM Converts lat/long to UTM coords. Equations from USGS Bulletin 1532 (or USGS Professional Paper 1395 "Map Projections A Working Manual", by John P. Snyder, U.S. Government Printing Office, 1987.) East Longitudes are positive, West longitudes are negative. North latitudes are positive, ... | function LLtoUTM(EQUATORIAL_RADIUS, ECC_SQUARED) {
return function (lat, lon, utmcoords, zone) {
var squared = ECC_SQUARED,
radius = EQUATORIAL_RADIUS,
primeSquared = squared / (1 - squared),
// utmcoords is a 2-D array declared by the calling routine
// note: input of lon = 180 or... | [
"function convertToUTM(obj) {\n [obj.north, obj.east] = proj4(wgs84, utm, [obj.lat, obj.lng]);\n}",
"function toUTM(usng, initial_lonlat, strict) {\n // Parse USNG into component parts\n var easting = 0;\n var northing = 0;\n var precision = 0;\n\n var digits = \"\"; /* don't... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Eliminar Registro de horarios | function eliminarHorario(){
if (tourIndex != -1) {
//MAkE THE AJAX CALL
if(confirm("Seguro de eliminar el Horario seleccionado?"))
{
var indice = tourIndex.split(" ");
//alert(indice[0]);
//alert(indice[1]);
var data = {
horario : indice[1],
id_tour : indice[0]
}
var message="info... | [
"function eliminarHorario(id) {\n\t\tparametros = {\n\t\t\t'tipsol' : '2',\n\t\t\t'id_hor':id\n\t\t};\n\t\t$.ajax({\n\t\t\turl : '/acmuniandes_hor/_php/hor_core.php',\n\t\t\tdata : parametros,\n\t\t\tdataType : 'json',\n\t\t\ttype : 'POST',\n\t\t\tsuccess : function(response) {\n\t\t\t\tif(response.redirect) {\n\t\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Fetch a `CapabilityStatement` and extract the SMART endpoints from it | function getSecurityExtensionsFromConformanceStatement(baseUrl = "/", requestOptions) {
return (0, lib_1.fetchConformanceStatement)(baseUrl, requestOptions).then(meta => {
const nsUri = "http://fhir-registry.smarthealthit.org/StructureDefinition/oauth-uris";
const extensions = ((0, lib_1.getPath)(meta || {}, ... | [
"async function getCapabilityStatement(baseUrl, noCache = false) {\n const url = new url_1.URL(\"metadata\", baseUrl.replace(/\\/*$/, \"/\"));\n return (0, request_1.default)(url, {\n responseType: \"json\",\n cache: noCache ? false : HTTP_CACHE\n }).then(x => {\n debug(\"Fetched Capab... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Set the stem (basename w/o extname) (example: `'index.min'`). Cannot contain path separators (`'/'` on unix, macOS, and browsers, `'\'` on windows). Cannot be nullified (use `file.path = file.dirname` instead). | set stem(stem) {
assertNonEmpty(stem, 'stem');
assertPart(stem, 'stem');
this.path = path$1.join(this.dirname || '', stem + (this.extname || ''));
} | [
"set stem(stem) {\n assertNonEmpty(stem, 'stem');\n assertPart(stem, 'stem');\n this.path = path__default[\"default\"].join(this.dirname || '', stem + (this.extname || ''));\n }",
"set stem(stem) {\n assertNonEmpty(stem, 'stem');\n assertPart(stem, 'stem');\n this.path = path$1.join(this.dirnam... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Serialize a NodeList/Array of nodes. | function serializeNodeList (list, context, fn, eventTarget) {
var r = '';
for (var i = 0, l = list.length; i < l; i++) {
r += serialize(list[i], context, fn, eventTarget);
}
return r;
} | [
"function serializeNodeList(list, context, fn, eventTarget) {\n var r = '';\n for (var i = 0, l = list.length; i < l; i++) {\n r += serialize(list[i], context, fn, eventTarget);\n }\n return r;\n}",
"getSerializedNodes() {\n const nodePairs = Object.keys(state.nodes).map((id) => [\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns width of widest row label | _getMaxRowLabelWidth() {
if (!this._elements.svg.selectAll('.row')) return 0;
let maxRowLabelWidth = 0;
this._elements.svg.selectAll('.row').select('.label').each(function(){
const width = this.getBBox().width;
if (width > maxRowLabelWidth) maxRowLabelWidth = width;
});
return maxRowLabelWidth;... | [
"_getMaxRowLabelWidth() {\n\n\t\t\tif (!this._elements.svg.selectAll('.row')) return 0;\n\n\t\t\tlet maxRowLabelWidth = 0;\n\t\t\tthis._elements.svg.selectAll('.row').select('.row-label').each(function(){\n\t\t\t\tmaxRowLabelWidth = Math.max(maxRowLabelWidth, this.getBBox().width);\n\t\t\t});\n\t\t\treturn Math.cei... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Purpose: Helper function to convert xmlNode to a string | function serializeXmlNode(xmlNode) {
if (typeof window.XMLSerializer != "undefined") {
return (new window.XMLSerializer()).serializeToString(xmlNode);
} else if (typeof xmlNode.xml != "undefined") {
return xmlNode.xml;
}
... | [
"function xml_to_string ( xml_node ) {\n if (xml_node.xml)\n return xml_node.xml;\n var xml_serializer = new XMLSerializer();\n return xml_serializer.serializeToString(xml_node);\n}",
"function xmlToString(node) {\r\n if (node.xml) { // Only IE supports this property.\r\n return node.xml;\r\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This handles the oneshot interaction, where the user utters a phrase like: 'Alexa, open Tide Pooler and get tide information for Seattle on Saturday'. If there is an error in a slot, this will guide the user to the dialog approach. | function handleOneshotTideRequest(intent, session, response) {
// Determine city, using default if none provided
var cityStation = getCityStationFromIntent(intent, true),
repromptText,
speechOutput;
if (cityStation.error) {
// invalid city. move to the dialog
repromptText = ... | [
"function handleOneshotTideRequest(intent, session, response) {\n var energy = getEnergyFromIntent(intent, true),\n repromptText,\n speechOutput;\n if (energy.error) {\n repromptText = \"What type of energy would you like information for?\";\n speechOutput = energy.value ? \"I'm so... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Template that can be used to create a drag preview element. | function DragPreviewTemplate() {} | [
"function DragPreviewTemplate() { }",
"function DragHelperTemplate() {}",
"function DragHelperTemplate() { }",
"_createPreviewElement() {\n const previewConfig = this._previewTemplate;\n const previewClass = this.previewClass;\n const previewTemplate = previewConfig ? previewConfig.templa... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Queries an element's rootNode and any ancestor rootNodes. based on | function queryElementRoots(element, selector) {
// Gets the rootNode and any ancestor rootNodes (shadowRoot or document) of an element and queries them for a selector.
function queryFrom(el) {
if (!el) {
return null;
}
if (el.assignedSlot) {
el = el.assignedSlot;
}
const rootNode = g... | [
"function queryElementsRoots(element, selector) {\n // Gets the rootNode and any ancestor rootNodes (shadowRoot or document) of an element and queries them for a selector.\n function queryFromAll(el, allResults) {\n if (!el) {\n return allResults;\n }\n if (el.assignedSlot) {\n el = el.assigned... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
if(num % 3 ==0) sum += num if(num % 5 ==0) sum += numasdf | function multi_sum(num){
return num==1 ? 0 : (num % 3 == 0) || (num % 5 == 0)? num + multi_sum(num-1): 0 + multi_sum(num-1) ;
} | [
"function multiplesOf3and5(number) {\n let sum = 0;\n for(let i = 3; i < number; i++) {\n if(!(i % 3) || !(i % 5)) {\n sum+=i\n }\n }\n return sum;\n}",
"function multiplesOf3and5(number) {\r\n let sum_total = 0;\r\n for (var i = 0; i < number; i++) {\r\n if (i % 3 == 0 || i % 5 == 0) {\r\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns a configured class initializer method | addInitializerMethod(assign) {
var isConstructor, method, methodName, operatorToken, variable;
({
variable,
value: method,
operatorToken
} = assign);
method.isMethod = true;
method.isStatic = variable.looksStatic(this.name);
if (method.isStatic) {
method.n... | [
"addInitializerMethod(assign) {\n var method, methodName, variable;\n ({\n variable,\n value: method\n } = assign);\n method.isMethod = true;\n method.isStatic = variable.looksStatic(this.name);\n if (method.isStatic) {\n method.name = variable.pr... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Reset sidebar, loader, and result | function reset() {
$('#locator-loader').show();
$('.sidebar-js-button').removeClass('active');
$('.result-body').hide();
$('.legend-inner-container').hide();
$('.legend-body').html('');
$('#result-list').html('');
$('.result-dropdown select').html('');
} | [
"function resetSidebar() {\n\n $sidebar.show();\n $sidebar.css({\n 'max-width': '100%'\n });\n\n }",
"function resetSidebar() {\r\n o.fixedScrollTop = 0;\r\n o.sidebar.css({\r\n 'min-height': '1px'\r\n });\r\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Function endPhase ends the current game based on the reason passed to it. The player is given feedback and offered to save his/her score. | function endPhase(reason) {
finalScore = Math.round((totalCorrect / (totalQuestions)) * 100);
$(".submitBtn").addClass("on").removeClass("active correct incorrect").text("FINAL SCORE : " + finalScore + "% CLICK TO SAVE").focus().off();
$(".answerBtn").removeClass("on active correct incorrect").off();
if (r... | [
"endPhase() {\n switch (this.public.phase) {\n case PHASE_MENTAL_SHUFFLE:\n this.initializeKeySubmit(); // Start the round\n break;\n case PHASE_KEY_SUBMIT_PREFLOP:\n // The key submit will end on the SB, so advance one seat to the BB\n this.public.activeSeat = this.findNext... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Validate that all related entities listed in the graph exist. | _validateRelatedEntities(graph) {
const verticesIds = new Set();
const relationsIds = new Set();
// eslint-disable-next-line no-plusplus
for (let i = 0; i < graph.length; i++) {
verticesIds.add(_id(graph[i]));
const { relations } = graph[i];
if (rela... | [
"function validateEntities(entityIDs, graph, cache) {\n\t // clear caches for existing issues related to these entities\n\t entityIDs.forEach(cache.uncacheEntityID); // detect new issues and update caches\n\n\t entityIDs.forEach(function (entityID) {\n\t var entity = graph.hasEntity(entityID); // don'... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
manageSite check if input is valid, if it is then update the currently selected host site with form data or add new host site if none selected | function manageSite(){
if (create_hostsite_input_is_valid()){
if($("#hsAction").html().indexOf('Edit Host Site</h4>') > -1){
//this is an edit
$.ajax({
type: 'put',
url: '/hs',
data: {
hostSiteID : $("#hostSiteID").val(),
name : $("#HSname").val(),
address : $("#address").val(),
... | [
"function addSite(edit) {\n\n $(\"#nameDiv\").animate().stop();\n $(\".linedwrap\").animate().stop();\n $(\".linedtextarea\").animate().stop();\n\t\n // Obtain site meta data (name, location, age) from input boxes\n var metaData = new constructMetaData(edit);\n if(!metaData.sanitized) {\n notify('failure',... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Fetches json teacher data from the sheet url online | function loadTeachers() {
fetch(sheetUrl)
.then(function(response) {
return response.json();
})
.then(function(json) {
console.log("Teachers: ");
console.log(json);
teachers = json.feed.entry;
appendTeachers(json.feed.entry);
});
} | [
"function readLessons() {\n data = \"\";\n console.log(\"Inside read lessones\");\n var url = \"https://spreadsheets.google.com/feeds/list/\" + lessonSpreadsheetID + \"/od6/public/values?alt=json\";\n //console.log(url);\n $.getJSON(url, function(data1) {\n if (typeof(data1) == null) {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
takes OA Annotation, gets Endpoint Annotation, and saves if successful, MUST return the OA rendering of the annotation | create (oaAnnotation, successCallback, errorCallback) {
successCallback = successCallback || noop
errorCallback = errorCallback || noop
const key = oaAnnotation.on.full
oaAnnotation['@id'] = `${key}/${Date.now()}`
oaAnnotation.endpoint = this
this.annotationsList.push(oaAnnotation)
this.sa... | [
"_getAnnotationInEndpoint(oaAnnotation) {\n const annotation = {\n '@id': oaAnnotation['@id'],\n '@type': oaAnnotation['@type'],\n '@context': oaAnnotation['@context'],\n motivation: oaAnnotation.motivation,\n resource: oaAnnotation.resource,\n on: oaAnnotation.on,\n };\n if (... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets the most recent transaction in a list of transactions | function getLastTransaction(transactions) {
var key = "timeStamp";
// var transactionsArray = transactions.map(a => a.timeStamp);
// var lastTransaction = Math.max.apply(Math,transactionsArray);
var lastTransaction = transactions[transactions.length-1];
return lastTransaction;
} | [
"getLatestTransaction() {\n return this.transactions[this.transactions.length - 1]\n }",
"function getLastTransaction() {\n return recentTransaction[0];\n }",
"async getLastTransaction () {\r\n return knex\r\n .select('*')\r\n .from(\"transactions\")\r\n .orderBy('created_at', 'd... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
index, todo from toDoRouter put() | update(index, todo){
//this.init => read json file => promise
return this.init().then(()=>{
//match client todoList to server todoList
this.todo.toDoList[index]=todo;
//write updated todoList
return this.write();
})
} | [
"EDIT_TODO (state, todo) {\r\n let todos = state.todos\r\n let index = _.findIndex(todos, {id:todo.id});\r\n todos[index] = todo\r\n // todos.splice(index, 1)\r\n state.todos = todos\r\n // state.newTodo = todo.title\r\n }",
"static async updatePut(req, res, next) {\n try {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Load all links from the LinksService | function loadLinks() {
// Get links and sort them by title
LinksService.getLinks().then(function(links) {
if (angular.isArray(links)) {
$scope.links = links.sort(function compare(a, b) {
if (a.title < b.title) {
return -1;
}
if (a.title > b.title) ... | [
"function loadLinks() {\n API.getLinks()\n .then((res) => setLinks(res.data))\n .catch((err) => console.log(err));\n }",
"function loadLinks() {\n chrome.storage.sync.get(null, function(items) {\n for (let item in items) {\n makeLink(items[item]);\n }\n });\n}",
"fun... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Guarantee that every event handler gets every event... guaranteeEvents('event', emitter) guaranteeEvents('eventA eventB ...', emitter) guaranteeEvents(['eventA', 'eventB', ...], emitter) > emitter This will add a .clearGuaranteedQueue(..) method to the emitter that will clear the event queue for a specific event. Clear... | function guaranteeEvents(names, emitter){
names = typeof(names) == typeof('str') ? names.split(/\s+/g) : names
// add ability to clear the queue...
if(emitter.clearGuaranteedQueue == null){
emitter.clearGuaranteedQueue = clearGuaranteedQueue
emitter._guaranteed_queue = {}
}
names.forEach(function(na... | [
"clearEvents() {\n this.eventQueue.clear();\n if (this.flushEventsTimer) {\n clearTimeout(this.flushEventsTimer);\n this.flushEventsTimer = 0;\n }\n }",
"_flushQueue() {\n if (this._queuedEvents.length) {\n this._queuedEvents.forEach((q) => {\n this._lo... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
creates a color input field | function color(name, onchange){
var $input = $("<input type='color' class='form-control' name='"+name+"'/>");
$input.attr("min", 0);
$input[0].onchange = onchange;
return $input;
} | [
"function mkColorPicker(){\n return $(\"<input type='color' />\"); \n }",
"function addInputColor(topdiv, inival, idcont, classnm) {\n input = document.createElement('input')\n input.setAttribute('id', idcont)\n input.setAttribute('type', 'color')\n input.setAttribute('class', 'colorInput... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Removes the document click event listener for the instance | function removeDocumentClickListener() {
document.removeEventListener('click', onDocumentClick, true);
} | [
"_removeClickToDocument(){\n document.removeEventListener('click', this._clickOnDoc)\n }",
"function removeDocumentClickListener() {\n document.removeEventListener('click', onDocumentClick, true);\n }",
"function detachDocumentEvent() {\n $document.off('click', onDocumentClick);\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get the build information for a specific beta build localization. | function readBuildInformationForBetaBuildLocalization(api, id, query) {
return api_1.GET(api, `/betaBuildLocalizations/${id}/build`, { query })
} | [
"function readBetaBuildLocalizationInformation(api, id, query) {\n return api_1.GET(api, `/betaBuildLocalizations/${id}`, { query })\n}",
"function getBuildIDForBetaBuildLocalization(api, id) {\n return api_1.GET(api, `/betaBuildLocalizations/${id}/relationships/build`)\n}",
"function readBuildInformation... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Split up the races based on type | function splitRacesIntoType(sortedRaces)
{
var itemsProcessed = 0;
var totalItems = sortedRaces.length -1;
app.greyhounds = [];
app.horses = [];
app.harness = [];
sortedRaces.forEach(function(item) {
switch(item.meeting.raceType) {
case "G":
app.greyhounds.push(item);
break;
... | [
"function splitModulesByLessonType(computationList) {\n\tconsole.log(\"Splitting modules by their lesson types\");\n\t// empty holder since we don't want to modify the computation list\n\tvar newComputationList = [];\n\t// loop through the incoming computation list\n\t// we want to output a module list that is grou... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Find availability by doc and date | findByDate (req, res) {
return availability
.findAll({
where: {
doctor_id: req.params.doctor,
date: req.params.date
}
})
.then(availability => res.status(200).send(availability))
.catch(error ... | [
"async findBookingByDate(date, { user, room }) {\n date = date.concat(\"-0-0\");\n const startDate = date_utils_1.stringToDate(date, false);\n const endDate = new Date(startDate.getTime() + 1000 * 3600 * 24);\n const whereCond = {\n or: [\n {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Adds general game world text. | function addGameWorldText(text)
{
var gameWorldTextEl = document.getElementById('game-world-text');
var newEl = document.createElement('div');
newEl.innerHTML = text;
gameWorldTextEl.appendChild(newEl);
} | [
"addStaticText(x, y, msg, scene) {\n var variable = scene.add.bitmapText(x, y-6, 'bigFontB', msg, 24);\n variable.setDepth(1);\n }",
"addTexts(){\n var startingMessage = (game.singleplayer || game.vsAi) ? \"Current Turn: X\" : \"Searching for Opponent\"\n\n game.turnStatusText = game.add.text... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Handles click on resume button and updates the state to hide modal and updates store to store pending game | resumeGameHandler() {
this.setState({ showModal: false })
this.props.onRetrievedGame(this.state.pendingGame);
} | [
"function resumeGame() {\r\n isPlaying(true);\r\n saveMessage(\"Pause the game to enable Save & Load\");\r\n animloop();\r\n }",
"resume(){\n if(this._isPaused){\n this._isPaused = false;\n this._togglePauseBtn.classList.remove(\"paused\");\n thi... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
this function validates the json data and appends it to existing data if json is invalid, the error message is logged on the console along with the work stream name data JSON string to be validated combinedStream CombinedStream instance appendChar the character to be used when valid JSON is appended to existing data wo... | function validateAndAppend(data, combinedStream, appendChar, workStreamName) {
if (isValidJson(data)) {
combinedStream.append(data);
combinedStream.append(appendChar);
} else {
//close the json array even if data is not valid
//and add empty structure so that trailing commas
... | [
"validateStream (data) {\n\t\tlet errors = [];\n\t\tconst stream = data.streams.find(stream => stream.createdAt);\n\t\tconst repo = this.test.repoOnTheFly ? data.repos[0] : this.test.repo;\n\t\tconst marker = data.markers[0];\n\t\tconst inputMarker = this.inputMarkers[0];\n\t\tconst file = this.test.streamOnTheFly ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
check if everyone is dead | everyoneDead(){
for(let i=0; i<this.n; i++){
if(this.players[i].game.alive == true){
return false
}
}
return true
} | [
"checkForDead(){\n\t\t//Everyone is dead.\n\t\tif(!this.members.length){\n\t\t\treturn -1;\n\t\t}\n\t\t\n\t\tvar r_val = false;\n\t\tvar re_index;\n\t\t//For each member, check if they're alive. If not, remove them from the array.\n\t\tfor(var i = 0; i < this.members.length; i++){\n\t\t\tif(!this.members[i].isAliv... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Upload song data to github Gist Variable(s) that need to be defined: songData, githubToken Dependent Functions: getRankedLocation, GetEndGameSummary | function UploadSongDataGist(){
//way to calculate ranked that works for me
var shouldBeSafeTimeForRankedDate = new Date();
var rankedLocation = getRankedLocation(false);
var formattedRankedDate = shouldBeSafeTimeForRankedDate.toISOString().split('T')[0];
var songDataFileName = rankedLocation + " R... | [
"function storageGithub(){\n var github = new Github({\n token: \"OAUTH_TOKEN\",\n auth: \"oauth\"\n });\n var repo = github.getRepo('tansaku','faqbot');\n repo.read('master', 'initial_kb.json', function(err, data) {});\n repo = repo + \"new data\";\n repo.write('master', 'initial_kb.json', repo, 'new d... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Reference: RFC 3171 the parameter ip is a string object If ip is multicast address, then return the true. Or return false | function IsMulticastAddress(ip) {
var addr = IsLegalIpAddress(ip);
if(addr == false) {
alert(translate_str("JavaScript",68));
return false;
}
else if(Number(addr[1]) < 224 || Number(addr[1]) > 239) {
return false;
}
return true;
} | [
"function checkMulticastMac(mac) {\n if (!checkMAC(mac)) {\n return false;\n } else {\n var hwaddr = mac.value.split(\":\");\n if ((parseInt(hwaddr[0], 16) & 1) != 0) {\n return true;\n } else {\n return false;\n }\n }\n}",
"function check_address(my_obj, mask_obj, ip_obj, is_broadcast... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Triggers the browser's print dialog | function triggerPrintDialog() {
window.print();
} | [
"function setupPrintDialog() {\n window.print();\n }",
"function setupPrintDialog() {\n setTimeout(function() {\n window.print();\n }, PRINT_DIALOG_DELAY);\n }",
"function printit() {\r\n frames.printPage.focus();\r\n frames.pri... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
enablechangeButton() disableDeleteButtonDisables a button "Delete" | function disableDeleteButton() {
var xbutton = document.getElementById("deletebutton");
if( xbutton != undefined ){
document.getElementById("deletebutton").setAttribute('hidden', 'true');
}
return true;
} | [
"function enableDeleteButton() {\t\t\n\tvar xbutton = document.getElementById(\"deletebutton\");\n\tif( xbutton != undefined ){\n\t\tdocument.getElementById(\"deletebutton\").removeAttribute('hidden');\n\t}\n\treturn true;\n}",
"function toggleBtnDelete(state)\n{\n document.getElementById('fltBtnDelete').disab... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns month name for specified date | static getMonthName(date) {
const monthName = date.toLocaleString(this.locales, { month: 'long' });
return this.firstUpperCase(monthName);
} | [
"function month_name(date) {\n let months = [\n \"January\",\n \"February\",\n \"March\",\n \"April\",\n \"May\",\n \"June\",\n \"July\",\n \"August\",\n \"September\",\n \"October\",\n \"November\",\n \"December\",\n ];\n\n let monthNum = date.getMonth();\n let result = mont... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
get stats by stat types and ISO2 Country codes | function getStats(type, countryCode, SummaryData) {
let covidData = []
switch (type) {
case "NewConfirmed":
covidData = SummaryData.filter(data => data.CountryCode === countryCode)
.map(x => x.NewConfirmed)
return (covidData.toLocaleString());
case "TotalConfirmed":
covidData = Su... | [
"function statsByCounty(country) {\n for (i = 0; i < covidData.length; i++) {\n if (covidData[i].name === country) {\n return covidData[i];\n }\n }\n}",
"function showStats(country){\n fetch(\"https://pomber.github.io/covid19/timeseries.json\")\n .then(response => response.json())\n .then(da... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Create an Anchor element. Optionally set its id, text, href or cls. | function anchor({ id, text, cls, href } = {}) {
return new Anchor({ id, text, cls, href });
} | [
"function createA(href, text) {return createHTML('a', text).attr('href', href);}",
"function createAnchor(text, href) {\n let anchor = document.createElement(\"a\");\n anchor.appendChild(document.createTextNode(text));\n if (href) {\n anchor.setAttribute(\"href\", href);\n }\n return anchor;... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Lexocographic order algorithm Using: | function lexOrder() {
/* Largest x such that locsOrder[x] < locsOrder[x+1] */
var largestX = -1;
for (var i = 0; i < locsOrder.length - 1; i++) {
if (locsOrder[i] < locsOrder[i+1]) {
largestX = i;
}
}
if (largestX === -1) { // order is finished
console.log("finished");
//console.log(bestPath);
noLoop... | [
"function s(beginWord, endWord, wordList) {\n // for each word find one letter transformations\n // find shortest traversal\n\n /* \n time:\n create graph, o(length of wordlist * length of wordlist * length of word), o(n2m)\n traverse, o(nm)\n => simplify, o(mn2)\n space:\n create graph, o(mn2)... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Increases parents siblings by 1 for each new child added. | function addSiblings(parent) {
while (parent != null) {
parent.siblings++;
parent = parent.parent;
}
} | [
"incrementCurrentParentItemCount () {\n this.currentParents[this.currentParents.length - 1][1] =\n (this.getCurrentParentItemCount()) + 1;\n }",
"function incrChild ( pid ) {\r\n \r\n\tfor ( var i = 0 ; i < model.length ; i += 1 ) {\r\n\t \r\n\t\tif ( model [ i ] .id === pid ) \r\n\t\t\tmodel [ i ] .child ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets the language service. Throws an exception if it doesn't exist. | get languageService() {
if (this._languageService == null)
throw this.getToolRequiredError("language service");
return this._languageService;
} | [
"function getLanguageService (callback) {\n google.auth.getApplicationDefault(function (err, authClient) {\n if (err) {\n return callback(err);\n }\n\n // Depending on the environment that provides the default credentials\n // (e.g. Compute Engine, App Engine), the credentials retrieved may\n /... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
remember to add the specifcis in the input question question for TA should I use console log scoring Algorithms dot description (this does not include the numbres like it does in the example right before C) or should I just console log it exactly I have added both | function scorerPrompt() {
console.log(`Which scoring alogrithm would you like to use? `);
for (let i = 0; i < scoringAlgorithms.length; i++){
console.log(`${i} - ${scoringAlgorithms[i].description}`);
}
let scoreChoice = input.question("Enter 0, 1, or 2:");
return scoringAlgorithms[scoreChoice];
} | [
"function scrabbleScore() {\n console.log(`Currently using : ${scoringAlgorithms[2].name}`);\n\tconsole.log(`The score for your word, ${userWord}, is ${oldScrabbleScoreTotal(userWord)}!`);\n}",
"function scorerPrompt() {\n let whichScorer = input.question(`Which scoring algorithm would you like to use?\\n 0 - S... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Detail component for container, displays the single day weather details | function Details (props) {
//gather strings to display
var date = getDate(props.weatherDay['dt']);
var icon = props.weatherDay.weather[0].icon;
var conditions = props.weatherDay.weather[0]['description'];
var minTemp = 'min temp: ' + props.weatherDay.temp['min'];
var maxTemp = 'max temp: ' + props.weatherD... | [
"function renderDayDetails() {\n\tdetailsPage.innerHTML = '';\n\tlet dayId = location.hash.split('/')[1];\n\tlet dayToShow = weatherData.days.find((elem) => elem.id == dayId);\n\tlet dayDetail = drawDayForecast(weatherData, dayToShow);\n\tdetailsPage.appendChild(dayDetail);\n}",
"function showDetail(city){\n v... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Update points and move to next matchup | updateMatchup(result) {
// Get the current matchup
let matchup = this.state.matchup;
// Give a point to the winner, or 0.5 to both if a draw (x10 to prevent rounding error)
if (result < 2) data.items[this.matchups[matchup][result]].points += 10;
else {
data.items[this.matchups[matchup][0]].po... | [
"switchPoints() {\n this.tl_x0 = this.tl_x1;\n this.tl_y0 = this.tl_y1;\n this.tr_x0 = this.tr_x1;\n this.tr_y0 = this.tr_y1;\n this.br_x0 = this.br_x1;\n this.br_y0 = this.br_y1;\n this.bl_x0 = this.bl_x1;\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
LOGIN / REGISTER PASSWORD TOGGLE Password toggle | function togglePassword() {
let loginRegister = document.getElementById("password-login-register-page");
if (loginRegister.type === "password") {
loginRegister.type = "text";
document
.getElementById("icon-toggle")
.setAttribute("fill", "#2ec49c");
} else {
lo... | [
"function togglePassword () {\n\tvar password = document.getElementById('password');\n\tvar toggle = document.getElementById('toggle');\n\n\tif(password.type == \"password\") {\n\t\tpassword.type = \"text\";\n\t\ttoggle.value = \"Hide Password\";\n\t} else {\n\t\tpassword.type = \"password\";\n\t\ttoggle.value = \"... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
imageMapXY(img: Image, func: (img: Image, x: number, y: number) => Pixel): Image | function imageMapXY(img, f){
let imgCopy = img.copy();
let newCopy = img.copy();
for(let i = 0; i < imgCopy.width; ++i){
for(let j = 0; j < imgCopy.height; ++j){
imgCopy.setPixel(i, j, f(newCopy, i, j));
}
}
return imgCopy;
} | [
"function imageMapXY(image, func) {\r\n let imgCopy = image.copy();\r\n for(let x=0; x<image.width; ++x) {\r\n for(let y=0; y<image.height; ++y) {\r\n imgCopy.setPixel(x,y, func(imgCopy, x, y));\r\n }\r\n }\r\n return imgCopy;\r\n}",
"function imageMapXY(img, f){\r\n let outp... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Admin level will be passed in iteratively until we find a match. | function hitTest(level) {
if (level >= 0) {
//Do Hit Test, starting with lowest available admin level
common.log("In hit test loop. checking level " + level);
sql = buildAdminStackSpatialQuery(searchObject.wkt, searchObject.datasource, level, ... | [
"updateLevel() {\n this.level = this.computeLevel()\n this.maxEnergy = this.computeMaxEnergy()\n\n // check to see if any stats are unlocked\n if (this.getStat(STATS.LEG) < 1 && this.level >= LEG_UNLOCK_LEVEL) this.setStat(STATS.LEG, 1)\n if (this.getStat(STATS.ARM) < 1 && this.level >= ARM_UNLOCK_LE... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Replaces 'class1' with 'class2' or vice versa on the specified element. | function toggleElementClass(element, class1, class2)
{
var classes = element.className.split(' ');
if (hasClass(element, class1) !== -1)
{
classes[classes.indexOf(class1)] = class2;
element.className = classes.toString().replace(',', ' ');
}
else if (hasClass(element, class2) !== -1)
{
classes[cl... | [
"function switch_class(element , class1, class2){\n if (element.hasClassName(class1)) {\n element.removeClassName(class1); \n element.addClassName(class2);\n } else if (element.hasClassName(class2)) {\n element.removeClassName(class2); \n element.addClassName(class1);\n }\n} // ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns the |value| formatted in a way that's appropriate for the given |fieldName|. Updating the value should take this format too, so when making any changes here be sure to also update the `_updateCustomPlayerField` method in this class. | formatCustomPlayerField(fieldName, value) {
switch (fieldName) {
case 'last_seen':
case 'level':
return value;
case 'custom_color': {
let colorValue = (value >>> 0).toString(16);
if (colorValue.length > 6)
c... | [
"function renderFieldValue(field, value) {\n if (!value) {\n return '';\n }\n if (value.length > 50) {\n value = value.substr(0, 50) + '...';\n } \n return '<div class=\"statsField\"><span class=\"statsFieldLabel\">' + StatsUtil.escapeHtml(field) + ':</span> <span class=\"statsFieldValue\">... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
True if only one element added to applications array | get isSingleApp() {
return !this.applications || this._appsLength < 2;
} | [
"function isOneItem(data) {\n return Array.isArray(data) ? data.length === 1 : true;\n }",
"$_appInexistent() {\n return !this.account.$$isPlaceholder && this.account.$$appsFetched && this.app.$$isPlaceholder;\n }",
"function atLeastOneInputItemInActiveStationPointsArr(station_points_arr, acti... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Place contents of array into an output string where each 10digit number is on a new line | function stringify(arr) {
arr.forEach(function(number){
outputStr += number + '\n'
});
} | [
"static writeNumberArray(array) {\n let ret = util_1.Util.ARRAY_START;\n for (let i of array) {\n ret = ret.concat(util_1.Util.convertNumberToCharArray(i));\n ret.push(util_1.Util.SPACE);\n }\n ret.push(...util_1.Util.ARRAY_END);\n return ret;\n }",
"fun... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Checks if the sum of all items' width is greater or equal to the width of the container | getIsFilled() {
return this.getAllItemsWidth() >= this.getContainerWidth();
} | [
"isFull() {\n\n let width = 0.0;\n for ( let elt of this._elements ) {\n width += elt.style.width;\n }\n return width >= 1.0;\n\n }",
"moreWidth() {\n return this.widthList_.length > 0;\n }",
"respectMinItemWidth() {\n const minItemWidth = this.layoutManager.... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
create a function that wll insert result of addOtherField() into the DOM where it should go. | function insertOtherInput(ele) {
const fieldset1 = document.querySelector('fieldset');
fieldset1.appendChild(ele)
} | [
"function addInputField(tempSqlElement, type) {\n if (type == \"root\") {\n var tempInputField = \"<span class='codeElement_\" + NR + \" inputField unfilled sqlIdentifier root' data-sql-element='\" + tempSqlElement + \"'>___</span>\";\n NEXT_ELEMENT_NR = NR;\n NR++;\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
========================================================================== Processes a new input file and return its compressed length. This function does not perform lazy evaluationof matches and inserts new strings in the dictionary only for unmatched strings or for short matches. It is used only for the fast compres... | function deflate_fast() {
while (lookahead !== 0 && qhead === null) {
var flush; // set if current block must be flushed
// Insert the string window[strstart .. strstart+2] in the
// dictionary, and set hash_head to the head of the hash chain:
INSERT_STRING();
// Find the longest match, discarding th... | [
"function zip_deflate_fast() {\n while (zip_lookahead != 0 && zip_qhead == null) {\n var flush; // set if current block must be flushed\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n zip_INSERT_STRING();\n\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
xClientWidth, Copyright 20012007 Michael Foster (CrossBrowser.com) Part of X, a CrossBrowser Javascript Library, Distributed under the terms of the GNU LGPL | function xClientWidth()
{
var v=0,d=document,w=window;
if(d.compatMode == 'CSS1Compat' && !w.opera && d.documentElement && d.documentElement.clientWidth)
{v=d.documentElement.clientWidth;}
else if(d.body && d.body.clientWidth)
{v=d.body.clientWidth;}
else if(xDef(w.innerWidth,w.innerHeight,d.heig... | [
"function xClientWidth()\n{\n var w=0;\n if(xOp6Dn) w=window.innerWidth;\n else if(document.compatMode == 'CSS1Compat' && !window.opera && document.documentElement && document.documentElement.clientWidth)\n w=document.documentElement.clientWidth;\n else if(document.body && document.body.clientWidth)\n w=d... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Turn off text selection blocking. | function unblockTextSelection() {
document.onselectstart = function () {
return true;
};
} | [
"function unblockTextSelection() {\n document__default[\"default\"].onselectstart = function () {\n return true;\n };\n}",
"function unblockTextSelection() {\n document__default['default'].onselectstart = function () {\n return true;\n };\n}",
"function unblockTextSelection() {\n document_default.a.o... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Return true if the AssetBundle is a streamed scene AssetBundle. | get isStreamedSceneAssetBundle() {} | [
"set isStreamedSceneAssetBundle(value) {}",
"isStream() {\n return this.streamRoute != null;\n }",
"hasStreams() {\n return this.video.hasStreams()\n }",
"function isParallelStage(stage) {\n if (stage.streams && stage.streams.length > 0) {\n return true;\n } else {\n return false;\n }\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
checks if user has his own column already and sets properties accordingly | function refreshUserColumns() {
//get current columns
var userCols = _.map(_.filter($localStorage.columns, { type: 'userFeed'}), 'user');
_.each($scope.users, function(user) {
if (userCols.indexOf(user.username) !== -1) {
user.hasColumn = true;
} else ... | [
"checkColumns() {\n this.checkColumnCanChangeIsShown();\n }",
"function ColumnMeta() {}",
"enterColumn_properties(ctx) {\n\t}",
"singleColumn() {\n\t\t\treturn this.uiSetting?.dataObject?.singleColumn ?? false;\n\t\t}",
"hasColumn(tableName, column) {\n const formattedColumn = this.formatter.pa... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
scroll content to bottom(newest) | function toBottom() {
$('#scroll-content')[0].scrollTop = $('#scroll-content')[0].scrollHeight;
} | [
"static scrollToBottom() {\n $(\".entries\").scrollTop($(\".entries\")[0].scrollHeight);\n }",
"function scrollToBottom() {\n msgsEnd.scrollIntoView({ behavior: \"smooth\" });\n }",
"function scrollBottom () {\n window.scrollTo(0, document.body.scrollHeight);\n }",
"scrollToBottom() {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
sumStartAt([1, 2, 3, 4, 5], 1) > 14 sumStartAt([1, 2, 4], 2) > 4 Write a function called sumUntil that takes an array of numbers, and an index as parameters and returns the summation of every number starting from the index 0, until the index parameter. | function sumUntil(array, index) {
//Write your code here
} | [
"function sumStartAt(array, index) {\n //Write your code here\n}",
"function sum(sumUntil) {\n var sum = 0;\n for(var i = 0; i < sumUntil; i++) {\n sum += (i + 1);\n }\n console.log(sum);\n}",
"function sumRange(start, end) { \n let myArr = [];\n for (let i = start; i <= end; i++)\n myArr.push(i)... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Q7 Write a function that accepts 2 arrays and prints the second array containing the first and last elements from the first array. Sample Output: makeEnds([1,2,3],[]); >[1,3] makeEnds([1,2,3,4],[]); >[1,4] makeEnds([7,4,6,2],[]); >[7,2] | function makeEnds(array1, array2){
array2.push(array1[0],array1[array1.length-1])
console.log(array2)
} | [
"function makeEnds(array1, array2) {\r\n array2.push(array1[0]);\r\n array2.push(array1[array1.length-1]);\r\n console.log(array2);\r\n}",
"function makeEnds(nums){\n return [nums[0], nums[nums.length-1]]\n}",
"function showFirstAndLast(arr) {\n\n const outFirstLast = arr.map(function (inVal) {\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Removes all stations from list. | function removeAll() {
stationList = [];
saveToDatabase();
} | [
"function __removeListItems() {\n var coachStationsListElem = coachStationsElem.find('.transport__coachstations-list');\n coachStationsListElem.find('li').remove();\n }",
"function clearStationList() {\n for (i = 0; i < stationList.length; i++) {\n stationList[i].className = \"stationName non... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
enableAcceptButton() disableInsConsButtonDisable a button "accept" | function disableInsConsButton() {
var xbutton = document.getElementById("insconsbutton");
if( xbutton != undefined ){
document.getElementById("insconsbutton").setAttribute('hidden', 'true');
acceptButton = false;
}
return true;
} | [
"function enableInsConsButton() {\t\t\n\tvar xbutton = document.getElementById(\"insconsbutton\");\n\tif( xbutton != undefined ){\n\t\tdocument.getElementById(\"insconsbutton\").removeAttribute('hidden');\n\t\tacceptButton = true;\n\t}\n\treturn true;\n}",
"function enableAcceptButton() {\t\t\n\tvar xbutton = doc... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Load all photos onto the map as markers | function loadPhotos(){
var geoJson = [];
for (var i = 0; i < photoList.length; i++) {
var date = photoList[i].filename.slice(0,10);
if (tracks[date]) {
geoJson.push({
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": photoList[i].c... | [
"function populateMap(map) {\n // Load JSON of all files\n // TODO: only fetch nearby files \n $.getJSON('/files.json', function(data) {\n\t$.each(data, function(i, obj) {\n\t $.each(obj, function(type, file) {\n\t\tvar fileLocation = new google.maps.LatLng(file.Lat, file.Lon);\n\t\tvar marker = new goo... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Restart the given event | _restartEvent(event) {
this._state.forEach((stateEvent) => {
if (stateEvent.state === "started") {
this._startNote(event, stateEvent.time, stateEvent.offset);
}
else {
// stop the note
event.stop(new TicksClass(this.context, sta... | [
"_restartEvent(event) {\n this._state.forEach((stateEvent) => {\n if (stateEvent.state === \"started\") {\n this._startNote(event, stateEvent.time, stateEvent.offset);\n }\n else {\n // stop the note\n event.stop(new _core_type_Tic... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Recurse through a key value set and call the handler on all primitive type values. | function traverseRecursive(value, key, list, handler) {
if (_.isObject(value) || _.isArray(value)) {
_.each(value, function(v, k, l) {
l[k] = traverseRecursive(v, k, l, handler);
});
return list[key];
} else {
// jsonOb is a number or string
return handler(value, key, list)... | [
"forEach(...args) {\n return this.valuesContainerMap.forEach.call(\n this.valuesContainerMap,\n ...args\n )\n }",
"function getValueHandler(value) {\n for (var _len2 = arguments.length, handlerLists = Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
seccion de funciones especificas del juego genera un patron de botones a oprimir y devuelve un arreglo llamado secuencia | function generarPatron(tamaño) {
secuencia = [];
for (var i = 0; i < tamaño; i++) {
secuencia[i] = Math.floor(Math.random() * 4 + 1);
}
} | [
"function cambiaPatron() {\n switch (tipoIdentificacion.value) {\n case \"fisica\":\n labelPatron.innerText=\"ex. 01-0234-0567 debe de contener 12 dígitos, con cero al inicio y 2 guiones \";\n patronIdentificacion= /(^0(?:[1-9]{1}-))((?:[1-9]{4}-))((?:[1-9]{4}$))/gm; //fisica nacion... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
The identifier of the button Y | static get BUTTON_Y() {
return "y";
} | [
"get buttonId() { return `${this.id}-button`; }",
"get buttonNumber() {\n return this.button + 1;\n }",
"static get BUTTON_X() {\n return \"x\";\n }",
"static get BUTTON_L() {\n return \"tl\";\n }",
"*pressButtonY() {\n yield this.sendEvent({ type: 0x01, code: 0x134, val... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Update the waiting time in seconds. | function updateWaiting() {
var d = new Date();
var diff = d.getTime() - waitingTime;
waiting = Math.floor(diff / 1000);
} | [
"function updateWaitTimer() {\r\n\r\n // Update Game clock\r\n waitTime--;\r\n\r\n // Times Up!\r\n if (waitTime <= 0) {\r\n stopWaitTimer();\r\n\r\n hideResults();\r\n\r\n // Load the next question if applicable\r\n if (game.questionsLeft > 0)... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Name of the park that has more than 1000trees | parkName(){
return this.nbrOfTrees >= 1000;
} | [
"function treeAmountOver1000(arrOfParks) {\n arrOfParks.forEach((cur) => {\n (cur.trees > 1000) ? console.log(`${cur.name} has more than 1000 trees`): null;\n\n });\n }",
"function isMore1000Trees(...parks) {\n parks.forEach(park => {\n if (park.numTrees > 1000) {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns Y coordinate by putting x coordinate in circle with radius r & center (cX, cY) with given position of pencil nib | function getYCoordinateCircle(x, curY, cX, cY, r) {
var expr;
if (r * r < (x - cX) * (x - cX)) expr = 0;
else expr = Math.sqrt(r * r - (x - cX) * (x - cX));
if (curY > cY) {
return cY + expr;
}
else {
return cY - expr;
}
} | [
"function getCircleYFromX(y, circCenterX, circCenterY, radius){\n return Math.round(Math.sqrt(Math.pow(radius, 2) - Math.pow(x - circCenterX, 2))) + circCenterY;\n}",
"function circle_center(px, py, qx, qy, rx, ry) {\n let v1 = sq(rx)+sq(ry)-sq(px)-sq(py);\n let v2 = sq(qx)+sq(qy)-sq(px)-sq(py);\n let y = (... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
remove raw data (key property starting with 'raw') | function rawDataOut(offer) {
return Object.entries(offer).reduce((withoutRawData, [key, val]) => {
if (key.substr(0, 3) === 'raw') return withoutRawData;
return { ...withoutRawData, [key]: val };
}, {});
} | [
"function remove_raw(tokens) {\n\treturn tokens.filter(function (token) {\n\t\treturn (token.type !== \"raw\");\n\t})\n}",
"_removeHeaders(keyData) {\n // Simple remove all lines that start with '-----'\n return keyData.replace(/^-----.*\\n?/gm, '').trim();\n }",
"function removePrivate (data) ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Display coming soon modal window modal : The id of the modal window title : The title of the modal window message : The message to be displayed, can be HTML code buttonText : The text of the button(default: OK) buttonHandler : The event handler of the button(default: closeModal) | function displayComingSoonMessage(modal, title, message, buttonText, buttonHandler) {
buttonText = buttonText || "OK";
buttonHandler = buttonHandler || closeModal;
$(modal + " .modalHeader .modalHeaderCenter h2").text(title);
$(modal + " .modalBody").addClass("comingSoon");
$(modal).addClass("large2");
$... | [
"function showModal(title, content, acceptButton, handler){\n\t// acceptButton is the text of the blue button and handler is the function that says what will be done when the acceptButton is pressed\n\t$(\"#mdlblTitle\").text(title);\t\t\t\t\t\t// Set title of modal\n $(\"#mdlblContent\").text(content);\t\t\t\t\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
handle the http options method,response 204 | function option (req,res){
res.status(204);
res.send('end');
} | [
"sendNoContent() {\n this.res.status = 204;\n }",
"function noContent () {\n this.status = 204\n}",
"onNoContent() {\n this.response.status(ExpressHandler.httpStatus.noContent);\n this.response.json(null);\n }",
"function handleOPTIONS(ctx) {\n ctx.set('Access-Control-Allow-Methods', 'HEAD,... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
TIMEMAP DROPDOWN =========================================== ============================================================ | function timemapDropdown() {
var buttons = $('.button-performance'),
performances = $('.performance-hidden');
for (var i = 0; i < buttons.length; i++) {
var button = $(buttons[i]);
//Повесили РЅР° РІСЃРµ РєРЅРѕРїРєРё «Остальные событиС... | [
"function initEventTimeOptions() {\n\t// Set default\n\t$('#selected_time').html(timeMap['any']);\n\t\n\tvar container = $('#time_options').empty();\n\tvar table = $('<table></table>');\n\tcontainer.append(table);\n\n\t// Add all time options to the dialog\t\n\tfor (var i in timeMap) {\n\t\tvar row = $('<tr></tr>')... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Creates a DEFLATE stream that can be added to ZIP archives | function ZipDeflate(filename, opts) {
var _this_1 = this;
if (!opts)
opts = {};
ZipPassThrough.call(this, filename);
this.d = new Deflate(opts, function (dat, final) {
_this_1.ondata(null, dat, final);
});
this.compression = 8;
... | [
"function inflate() {\n var push = inflateStream(onEmit, onUnused);\n var more = true;\n var chunks = [];\n var b = bodec.create(1);\n\n return { write: write, recycle: recycle, flush: flush };\n\n function write(byte) {\n b[0] = byte;\n push(null, b);\n return more;\n }\n\n function recycle() {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Validate if the athlete is able to assess the coach according to `ATHLETE_COACH_ASSESSMENT_TIMEOUT` | validateAthleteCoachAssessmentTimeout() {
const dummyData = {
assessor_permission: 'read_write',
dry_run: true,
};
Api.newAssessments([dummyData], this.coach.id)
.catch(err => {
try {
this.apiMsg = err.responseJSON.rejected[0].error;
} catch (e) {
}
... | [
"function checkAchievability() {\n let totalWorkTime = 0;\n suggestions.forEach((suggestion) => {\n totalWorkTime += suggestion.amount.asMilliseconds();\n });\n\n if (totalWorkTime < estTime.asMilliseconds()) {\n let timeNeeded = dayjs.duration(estTime.asMilliseconds() - totalWorkTime);\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
add the files to the data transfer, and update the interface. | addFiles(e) {
this.updateDataTransfer(e);
this.updateUserInterface();
if(this.options.get("uploadOnDrop")) this.form.submit();
} | [
"function updateFiles(){ ctrl.collection.files = Data.files.get() }",
"_addFiles(files) {\n if(!(files instanceof Array)) {\n files = Array.from(files);\n }\n\n files.forEach((file) => {\n this.emit('addedfile',file);\n });\n\n return this;\n }",
"func... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |