query stringlengths 9 34k | document stringlengths 8 5.39M | negatives listlengths 19 20 | metadata dict |
|---|---|---|---|
Create ranges for each storage based on transactions obtained | createRangesForSplitStorage(storageInfo, firstTransactionInSegment, lastTransactionInSegment) {
let earliestStorage = this.findEarliestStorage(storageInfo);
let lastStorage = this.findLastStorage(storageInfo);
for (const storage in storageInfo) {
let storageObject = storageInfo[stor... | [
"implantRangeTransactions(storageInfo, rangeEndsHit, range) {\n if (rangeEndsHit.last === true) {\n let storage = this.findLastStorage(storageInfo);\n storageInfo[storage].lastTransaction = {number: range.lastTransaction.number, id: range.lastTransaction.id};\n }\n\n if (r... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
change app to create house | function createHouse() {
if (!vm.user) {
appService.alert('Please login first!');
return;
}
appService.moveTo('createHouse');
} | [
"function createApp(){\n\tconsole.log('createApp: ')\n\tu.createMetroApp(app.name);\n}",
"function createapp(){\n var project = getProjectInfo()\n createTiApp(project.appname, atom.config.get(\"ti-atom.id\"), atom.config.get(\"ti-atom.url\"), project.dirname);\n}",
"function createApp() {\n const appContaine... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Squash the current playing sound | _squash(time) {
if (this._currentSound && this._currentSound.state !== "stopped") {
this._currentSound.stop(time);
}
this._currentSound = null;
} | [
"_squash(time){\n\t\tif (this._currentSound){\n\t\t\tthis._currentSound.stop(time+0.1, 0.1)\n\t\t}\n\t\tthis._currentSound = null\n\t}",
"_squash(time){\n\t\tif (this._currentSound){\n\t\t\tthis._currentSound.stop(time, 0.1)\n\t\t}\n\t\tthis._currentSound = null\n\t}",
"function hitSound() {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
circleMouseOut purpose: mouse event to make the label text go back to normal when the mouse leaves a circle Parameters: N/A | function circleMouseOut() {
var text = d3.select(this.parentNode).moveToBack().select('.MST.label')
.transition()
.duration(250)
.style('font-size', '10px')
} | [
"function mouseoutCircle() {\n\n\t// Get circle\n\tvar circle = d3.select(this);\n\n\t// Display idle circle\n\tcircle.attr(\"r\", circle.attr(\"r\") / circleEnlargeConstant);\n\n}",
"function mouseOutCircle() {\n $(this).css(\"opacity\", \"1\");\n }",
"function circleRegionMouseOutHandler(kmlEvent) {... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Update table classing for kickstart after AJAX insertion | function updateTableClassing() {
var rows = $('table.sortable').find('tbody tr');
rows.removeClass('alt first last');
var table = $('table.sortable');
table.find('tr:even').addClass('alt');
table.find('tr:first').addClass('first');
table.find('tr:last').addClass('last');
} | [
"function reload_hazard_class_table() {\n datatable_hazard_class_tab.ajax.reload(null, false);\n }",
"function reload_user_class_table() {\n datatable_user_class_tab.ajax.reload(null, false);\n }",
"function assignTableClasses(hook){\n t = $(hook);\n t.each(function(){\n $(this)... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Renames a dir in the file system and creates an event to represent it. | function renameDir(newDirPath, newDirName, oldDirPath, timestamp) {
//if this should be ignored due to the st-ignore.json file
if(!ignoreThisFileOrDir(newDirPath)) {
//get the id of the renamed dir
var dirId = getIdFromDirPath(oldDirPath);
//if the directory is being tracked
i... | [
"function moveDir(newDirPath, newDirParentPath, oldDirPath, oldDirParentPath, timestamp) {\n\n //if this should be ignored due to the st-ignore.json file \n if(!ignoreThisFileOrDir(newDirPath)) {\n\t\n //get the id of the moved dir\n var dirId = getIdFromDirPath(oldDirPath); \n \n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Create the draggable list | function createDraggableList(ex, elementList, elementW, elementH, x0, y0, successFn, failureFn, drawAllFn, digitIndex, maxDigits, emptySpots, enabledColor, disabledColor, fontSize){
var self = {};
self.elementList = elementList;
self.elementW = elementW;
self.elementH = elementH;
self.x0 = x0;
s... | [
"function makeListViews(){\n $('#ppc-list').empty();\n ppc_li.forEach(function(name, index){\n ($(\"<div class='names ppc'>\" +index+\": \" + name + \"</div>\").data( 'name', name ).data( 'index', index )).draggable(draggableSettings).appendTo($('#ppc-list'));\n });\n}",
"function makeGalleriesDra... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Updates the flash message area | function flash_message(message) {
$("#flash_message").empty();
$("#flash_message").append(message);
} | [
"function flash_message(message) {\r\n $(\"#flash_message\").empty();\r\n $(\"#flash_message\").append(message);\r\n }",
"function refresh_flash(flash){\r\n $('#notice').html(flash)\r\n show_flash()\r\n}",
"updateFlash() { if (this._isFlashing()) this._updateFlashing(); }",
"function fl... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
end of artBoardNameCheck() / DESC : Searches for a specific object type on all artboards PARM : OBJECT_TYPE(type of object to search for) RTRN : STRING(artboard object type was found on, or none) | function searchAllPageItemsForObject( _objectType ){
var activeDoc = app.activeDocument;
var foundOnArtboard;
var foundObjectTypeLoc = "";
for(var g = 0; g < activeDoc.artboards.length; g++){
app.selection = false;
activeDoc.artboards.setActiveArtboardIndex(g);
activeDoc.selectObjectsOnActiveArtb... | [
"function GetObjectTypeNameAvailable() {\n\t}",
"function findArtBoardByName(name) {\n var artboards = activeDocument.artboards;\n\n var length = artboards.length;\n for (var i = 0; i < length; i++) {\n var artboard = artboards[i];\n if (artboard.name == name) {\n $.writeln(\"Fou... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
firstToAsync : e > First a > Async e a firstToAsync : e > (a > First b) > a > Async e b | function firstToAsync(left, first) {
if(isFunction(first)) {
return function(x) {
var m = first(x)
if(!isSameType(First, m)) {
throw new TypeError('firstToAsync: First returing function required for second argument')
}
return applyTransform(left, m)
}
}
if(isSameType(Fir... | [
"function firstToAsync(left, first) {\n if(isFunction(first)) {\n return function(x) {\n var m = first(x)\n\n if(!isSameType(First, m)) {\n throw new TypeError('firstToAsync: First returning function required for second argument')\n }\n\n return applyTransform(left, m)\n }\n }\n\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This is the presentational component for displaying the rules of the game. | function RulesComponent(){
return(
<div className="row">
<div className="column">
<ul>
<li>You start with 16 cards with 8 identical pairs. Click on any card and the value of that card is revealed.</li>
<li>Try to match the card with its twin. If the cards match, you gain 100 poi... | [
"function displayRules() {\n\treset();\n\tversion = 'extended';\n\tgameState = 'rules';\n\tsetVersion();\n\tsetGameElements();\n}",
"function Rules(props) {\n return(\n <div>\n <h1>Rules of the game:</h1>\n <ul>\n <li>The goal of the game is to find all the mines on the ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
selector for create password field | get inputFirstPassword () { return $('#form-register-first-password') } | [
"function createPasswordField(id)\n{\n const style = createObject([['width', '200px'], ['height', '50px'], ['fontSize', '22px']]);\n return createObject([['tag', 'input'], ['id',id] ,['type', 'password'], ['style', style]]);\n}",
"_init_password(){\n if (this.password) {\n const el = t... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
adds a floor at level, if hasOpening, one opening per floor is added to make it possible to get to any floor in the 3d maze | addFloor(level, gridSize, gridScale, hasOpening) {
let openingX = Math.min(Math.floor(Math.random() * gridSize), gridSize - 1);
let openingZ = Math.min(Math.floor(Math.random() * gridSize), gridSize - 1);
for(let i = 0; i < gridSize; i++) {
for (let j = 0; j < gridSize; j++) {
... | [
"function addFloor() {\r\n\r\n // Push empty array to internal attribute for building\r\n savedShapes[buildingBeingViewed].internal.push([]);\r\n\r\n // Update lifts and stairs to account for the new floor\r\n var lifts = savedShapes[buildingBeingViewed].lifts;\r\n\r\n for (var i ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Checks if there's any vulnerable target. | function renderVulnerableTargetCheckLogic () {
vulnerableTargetCheckDelta++;
if (vulnerableTargetCheckDelta >= SI.res.ResourceLoader.getResources().game.properties.HUDVulnerableTargetCheckMaxDelta) {
vulnerableTargetCheckDelta = 0;
if (SI.game.target.Enemy.isVulnerableTarget(SI.game.Rend... | [
"function checkTargets(){\n\n if(hitsToLevelup <= 0){\n\n levelUp();\n }\n\n if(targetsRemaining.length > 6){\n\n gameOver = true;\n }\n\n if(Date.now() - lastTargetSpawn > (targetInterval - level*(lvlSpawnReduce))){\n\n spawnTarget();\n }\n }",
"_isInGivenRequestTargets(target... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Initialize the Bandcamp API. | function Bandcamp() {} | [
"function thirdpartyapiInit () {\n\t debug('Initialized');\n}",
"function init() {\n api.init();\n }",
"function init() {\n ADL.XAPIWrapper.changeConfig({\n // Get this auth from the container?\n \"endpoint\" : \"https://cloud.scorm.com/tc/7RCTBEES1P/sandbox/\",\n \"auth\" : \"Basic ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets namespaces belonging to a NEM address | function getNamespacesFromAddress() {
let adr = address.value;
let sanitizedAdr = adr.toUpperCase().replace(/-|\s/g, "");
if (adr == "") {
address.focus();
return false;
}
_doGet('/account/namespace/page?address=' + sanitizedAdr);
} | [
"getNamespacesFromAccount(address, queryParams) {\n return this.getNetworkTypeObservable()\n .flatMap((networkType) => Observable_1.Observable.fromPromise(this.namespaceRoutesApi.getNamespacesFromAccount(address.plain(), queryParams != null ? queryParams : {}))\n .map((namespaceInfosDTO... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns a +/ random of 'percent' on the specified 'val'. | function numWithPercentRandomness(val, percent) {
var max = val * (1 + (percent / 100));
var min = val * (1 - (percent / 100));
return Math.round(getRandomInt(min, max));
} | [
"function percentOf(val, percent) {\r\n return (val * percent) / 100;\r\n}",
"function percent(num) {\n return (rand(100) < num);\n}",
"function rand(val)\n{\n var r = Math.floor(Math.random() * val);\n return r;\n}",
"function generateVal() {\n return Math.floor((Math.random() * 100) + 1);\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Uses the stimuli factor (static or pursuit) to progress further into the calibration task (e.g. by spawning a new dot or moving the dot along the screen, as appropriate). | function continue_calibration() {
var canvas = document.getElementById("canvas-overlay");
var context = canvas.getContext("2d");
if (stimuli == "static") {
num_objects_shown++;
draw_static_dot_calibration(context);
}
else if (stimuli == "pursuit") {
num_objects_shown++;
draw_pursuit_dot_cali... | [
"function start_calibration_exp(i, s, f) {\n // Define independent variables for this run\n interaction = i;\n stimuli = s;\n first_validation_task = f;\n\n remaining_tasks = [\"static\", \"pursuit\"];\n paradigm = \"calibration\";\n setup_calibration_html();\n}",
"function check_calibration_finished() {\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Calculating logo size on smaller screens | function logoSizeOnSmallScreens(){
"use strict";
// 100 is height of header on small screens
if((100 - 20 < logo_height)){
$j('.q_logo a').height(100 - 20);
}else{
$j('.q_logo a').height(logo_height);
}
$j('.q_logo a img').css('height','100%');
$j('header.page_header').removeClass('sticky_animate sticky'... | [
"determineScale (oWidth, oHeight, logoWidth, logoHeight) {\n\n function diff(a,b) {\n return Math.abs(a-b);\n }\n \n let widthDiff = diff(logoWidth, oWidth); \n let heightDiff = diff(logoHeight, oHeight);\n \n if (widthDiff >= heightDiff) { \n return logoWi... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
On a mouse click, check if any of the events have been clicked. | function check_event_clicks(click) {
for (var i = 0; i < event_array.length; i++) {
var event = event_array[i];
var yd = click.y - event.y;
var xd = click.x - event.x;
if ((yd < event_dimensions) && (xd < event_dimensions)) {
if ((yd > (0-event_dimensions)) && (xd > (0-event_dimensions))) {
... | [
"function mouseClicked() {\n // If it has been clicked return true\n return true;\n }",
"function checkMouse(e){\n\t\tvar mouse = getMouse(e);\t// mouse position\n\t\tvar elem;\t\t\t\t\t// UI element\n\t\tvar but;\t\t\t\t\t// button\n\t\tvar clicked = false;\n\t\t\n\t\t// check if any UI elements... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Fill Page Fill the HTML Page with the various questions | function fillPage(questions) {
var output = ""
questions.forEach(q=>{
output += getQuestionText(q);
})
return output;
} | [
"function renderQuestionPage() {\n\trenderQuestionHeader(numberofQuestionsCorrect);\n\trenderQuestionDescription();\n\trenderChoices();\n\tsubmitAnswer();\n}",
"function questionPage() {\n let num = currentQuestion();\n\n //------Create the elements for question page\n //Create the header for... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
show the filter by category on page | async function showCatFilter() {
const cates = await getCatsList();
for (let cate of cates) {
generateFilterItemHTML(cate, $("#catFilter"));
}
} | [
"function categoryFilter() {\n\t\t$(\".category.\" + catergoryName).show(\"400\"); // Show the filter items\n\t\t$(\".category:not(.\" + catergoryName + \")\").hide(\"400\"); // Hide the non-filter items\n\t\t$(\".filter-menu li[data-filter='\" + catergoryName + \"']\").addClass(\"active\").siblings(\"li\").removeC... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
isNonpositiveInteger (STRING s [, BOOLEAN emptyOK]) Returns true if string s is an integer <= 0. For explanation of optional argument emptyOK, see comments of function isInteger. | function isNonpositiveInteger (s)
{ var secondArg = defaultEmptyOK;
if (isNonpositiveInteger.arguments.length > 1)
secondArg = isNonpositiveInteger.arguments[1];
// The next line is a bit byzantine. What it means is:
// a) s must be a signed integer, AND
// b) one of the following m... | [
"function isNonpositiveInteger(s) {\r\n var secondArg = defaultEmptyOK;\r\n\r\n if (isNonpositiveInteger.arguments.length > 1)\r\n secondArg = isNonpositiveInteger.arguments[1];\r\n\r\n // The next line is a bit byzantine. What it means is:\r\n // a) s must be a signed integer, AND\r\n // b) one of the fol... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Car Rental Service Pickup/Dropoff time functions For Car Only, when a car service radio button is selected, save the service and check if its Per24Hrs. | function checkPer24(dest, svc, grace)
{
document.getElementById('maincarpickuploc' + dest).disabled = false;
document.getElementById('maincarpickuptime' + dest).disabled = false;
document.getElementById('maincardropoffloc' + dest).disabled = false;
document.getElementById('maincardropofftime' + dest).disab... | [
"function validatePickup(){\n var dateValue = $('#date-picker').val()\n var timeValue = $('#time-picker').val()\n hasValidDateTime = !(dateValue === '' || timeValue === '')\n cartEntry.productModifier.dateTime.needed = needsDateTime\n cartEntry.productModifier.dateTime.value = {\n date: dateVa... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
FUNCTION: dwscripts.getTernaryStatement DESCRIPTION: Gets the syntax for a ternary statement ((condition) ? trueClause : falseClause) ARGUMENTS: condition string. trueClause string. Value for the statement to be executed if the condition is true. falseClause string. Value for the statement to be executed if the conditi... | function dwscripts_getTernaryStatement(condition, trueClause, falseClause)
{
var retVal = null;
var serverObj = dwscripts.getServerImplObject();
if (serverObj != null && serverObj.getTernaryStatement != null)
{
retVal = serverObj.getTernaryStatement(condition, trueClause, falseClause);
}
return retVal... | [
"function ternary(value)\r\n{\r\n return value ? \"Yeah\" : \"Nope\";\r\n}",
"function ternaryOperatorExpressionHandler(node, scope) {\n let predicate = traverse(node[0], scope);\n let trueBranch = node[1];\n let falseBranch = node[2];\n\n d('ternaryOperatorExpressionHandler');\n d(predicate);\n d(tru... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets up the tracking of the target window | function startTrackingTargetWindow() {
//For now, just grab whatever happens to be the current window and use that as the default target
//TODO: Try to maintain the target window across launches of Chrome. This will require a way to uniquely identity windows
// because the windowId is not persisted a... | [
"_buildWindow()\n\t{\n\t\tthis.window = new MotionTrackerWindow();\n\t\tthis.currentCanvasPosition = MotionTracker.CONFIG.canvasZIndex;\n\t\tthis.currentUseHighDPI = MotionTracker.CONFIG.useHighDPI;\n\t}",
"function trackCurrentWindow(win) {\n\tcurrentWindow = win;\n\twin.on(\"focus\",function() {\n\t\tcurrentWin... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
decorator of a provide | function Provide(key) {
return createDecorator(function (componentOptions, k) {
var provide = componentOptions.provide;
if (needToProduceProvide(provide)) {
provide = componentOptions.provide = produceProvide(provide);
}
provide.managed[k] = key || k;
});
} | [
"function Provide(key) {\n return createDecorator(function(componentOptions, k) {\n var provide = componentOptions.provide\n if (needToProduceProvide(provide)) {\n provide = componentOptions.provide = produceProvide(provide)\n }\n provide.managed[k] = key || k\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
TODO: substitute getRatingFromServer for every picture with getRatingsFromServer for the whole collection | function getRatingsFromServer(path, setRating) {
readServer('ratings', path, setRating);
} | [
"fetchRatingsFromApi(){\n\n }",
"getReviewImage(rating) {\n var images = {\n 0: 'https://i.ibb.co/mc2Fh55/00Star.png',\n 2: 'https://i.ibb.co/kQwfftD/10Star.png',\n 3: 'https://i.ibb.co/BP4WJBs/15Star.png',\n 4: 'https://i.ibb.co/YB9kMjb/20Star.png',\n 5: 'https://i.ibb.co/5FChKj1/25S... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
if Ldesign setup, update layout and init event | function queryLdesignSetup() {
console.log("queryLdesignSetup");
if (legdesign.queryIsSetup()) {
console.log("queryLdesignSetup done");
clearInterval(idTimerLdesign);
idTimerLdesign = null;
ldListHeight = Math.ceil($('a.Ldesign').length / 3) * designPerHeight;
updateL... | [
"function setupLayout() {\n\n fallbacks();\n\n /** Layout stuff to do on the home page */\n if (pageState.isHome === true) {\n\n $$('.gap').setStyle('height', 0.5625 * window.getSize().x);\n\n $$('.logo-video').pick().addEventListener('loadedmetadata', ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns the name of the component at the top most position of the React stack trace (which is the one that raised the error). A typical React component looks like that: in COMPONENT (at file.jsx:5) in COMPONENT2 (at file2.jsx:45) etc... | function getTopMostStackEntryComponent(componentStack) {
// We start looking for the first line wrap after the first character since stack traces start with a '/n'
const topMostEntry = componentStack.slice(0, componentStack.indexOf('\n', 1)).trim();
// At this point topMostEntry contains a string like "in COMPONE... | [
"function getName(component: React.Element<any>) {\n if (!component) {\n return '(no component)';\n }\n return component.type.displayName || component.type.name;\n}",
"function getFriendlyCallerName() {\n var friendlyName = 'unknown';\n var err = new Error();\n var originalPrepareStackTrace = Error.prepa... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This is the async version of `nonMaxSuppression` | function nonMaxSuppressionAsync_(boxes, scores, maxOutputSize, iouThreshold, scoreThreshold) {
if (iouThreshold === void 0) { iouThreshold = 0.5; }
if (scoreThreshold === void 0) { scoreThreshold = Number.NEGATIVE_INFINITY; }
return __awaiter(this, void 0, void 0, function () {
var $boxes, $scores, ... | [
"function nonMaxSuppressionAsync_(boxes, scores, maxOutputSize, iouThreshold, scoreThreshold) {\n if (iouThreshold === void 0) { iouThreshold = 0.5; }\n if (scoreThreshold === void 0) { scoreThreshold = Number.NEGATIVE_INFINITY; }\n return __awaiter(this, void 0, void 0, function () {\n var $boxes, ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Toggle squad true or false on click | function clickSquad() {
if (theSystemIsHacked === true && student.house === "Slytherin" && student.bloodStatus === "Pure-blood" ) {
student.squad = true;
limitedSquad();
} else if (student.house === "Slytherin" && student.bloodStatus === "Pure-blood"){
student.squad ... | [
"function squad(){\n const studentData = findStudent(HTML.modalContent.dataset.id);\n if(!studentData.inquisitorialSquad && (studentData.bloodStatus || studentData.house === \"Slytherin\")){\n studentData.inquisitorialSquad = true;\n\n if(settings.hackedSystem){\n setTimeout(function(... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Add a switch for selected day (weekplanning.js:daySelect) | function addSwitch() {
saver = get("weekProgramState", "week_program_state");
$(".hide1").text($("#inputStart").val());
$(".hide2").text($("#inputEnd").val());
addPeriod(daySelect, $(".hide1").text(), $(".hide2").text());
setWeekProgram();
refresh();
correctProgram();
goBack();
... | [
"function selectDay(idx) {\n\t\t\t\t\tvar daySelected = weekView.querySelectorAll('.cal-lg-day')[idx];\n\t\t\t\t\tsetTimeout(function () {\n\t\t\t\t\t\t_h.toggleClass(daySelected, 'selected');\n\t\t\t\t\t}, 200);\n\t\t\t\t}",
"selectDay() {\n const day = this.dayView.dayModel;\n this._dateNavigation... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Method to set visibility of Wounds list segment | function frmPatientSummary_showSegWounds() {
searchPatient_closeSearchList();
kony.print("------frmPatientSummary_showSegWounds---->>");
if(frmPatientSummary.fcwoundslist.isVisible) {
frmPatientSummary.fcwoundslist.setVisibility(false);
} else {
frmPatientSummary.fcwoundslist.setVisibility(true);
}
... | [
"function updateStopsVisibility() {\n visible_stops = getVisitbleStops();\n //console.log(Object.keys(visible_stops).length);\n stops.forEach( function(s) {\n var visible = Boolean(s.id in visible_stops);\n s.bubble.setVisible(visible);\n });\n if(active_stop != null) {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns true if this material library is empty. | get isEmpty() {
return this.materials.length === 0;
} | [
"static isEmpty() {\n if (Storage.getBooksFromLS().length === 0) {\n return true;\n } else {\n return false;\n }\n }",
"isEmpty() {\n\t\treturn this._count === 0;\n\t}",
"function libraryEmpty() {\n var empty = true;\n for (shelf in library) {\n return empty = false;\n }\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Changes whether the |userId| has VIP rights or not. | async setUserVip(userId, vip) {
await server.database.query(PLAYER_BETA_SET_VIP, (!!vip) ? 1 : 0, userId);
} | [
"set isVIP(isVIP){\n this._isVIP = isVIP;\n }",
"async setFlagForUser (userId) {\n\t\tlet op;\n\t\t// set or clear flag\n\t\tif (this.clear) {\n\t\t\top = { $unset: { [this.flag]: true } };\n\t\t}\n\t\telse {\n\t\t\top = { $set: { [this.flag]: true } };\n\t\t}\n\t\tawait this.data.users.updateDirect({ _... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
"Whosa whatsis" suggested "Chain Hull" as described at essentially hull A+B, B+C, C+D and then union those | function chain_hull() {
var a = arguments;
var j = 0, closed = false;
if(a[j].closed!==undefined)
closed = a[j++].closed;
if(a[j].length)
a = a[j];
var h = []; var n = a.length-(closed?0:1);
for(var i=0; i<n; i++) {
h.push(hull(a[i],a[(i+1)%a.length]));
}
return union(h);
} | [
"function delaunay(points) {\r\n// The function receives a set of points (sorted by x value in ascending order)\r\n// and returns two edges: the left-most and right-most edge of the convex hull\r\n// formed by the set of points.\r\n let leftedge;\r\n let rightedge;\r\n\r\n if (points.length == 2) {\r\n// LET TH... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Below function adds beats to state if the string is not empty | function handleAddBeat(event) {
const name = beatNameRef.current.value
if (name === "") return /* prevents empty string being entered into state */
beatNameRef.current.value = null;/*This line clears input after submission*/
setBeats(prevBeats => {
return [...prevBeats, {id:uuidv4(), name:name, s... | [
"function addState(state) {\n var stateInput = document.getElementById('eventState').value;\n if (!stateInput) {\n join(state);\n } else {\n var biggerPlace = stateInput.toLowerCase();\n state.push(\"&stateCode=\", biggerPlace);\n join(state);\n }\n}",
"setEmptyFieldInvalid... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Iterate over all defined fields of an object, including those missing or undefined, passing each field name and effective value (as returned by getFieldValue) to the callback. If the object has no corresponding Def, the callback will never be called. | function eachField(object, callback, context) {
getFieldNames(object).forEach(function (name) {
callback.call(this, name, getFieldValue(object, name));
}, context);
} | [
"function eachField(object,callback,context){getFieldNames(object).forEach(function(name){callback.call(this,name,getFieldValue(object,name));},context);}// Similar to eachField, except that iteration stops as soon as the",
"function eachField(object, callback, context) {\n \t\t getFieldNames(object).forE... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Algorithm to find the largest free quadrant. | function findQuadrant() {
var area = 0;
var slot = null;
function find(node) {
if (node instanceof Desktop) {
find(node.child);
}
else if (node instanceof Split) {
find(node.first);
find(node.second);
}
else if (node instanceof Window) {
var winA... | [
"function greatestProductDiagonal(arr, digits) {\n return Math.max(\n greatestProductDiagonalTopLeftToRightBottom(arr, digits),\n greatestProductDiagonalBottomLeftToTopRight(arr, digits)\n );\n}",
"function findLargestSubSquareMatrixWithZeros() {\n\n}",
"max() {\r\n let m = 0;\r\n let i = this.ele... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
2. Figure out how to get data on multiple numbers in a single request. Make that request and when you get the data back, put all of the number facts on the page. | async function multipleNums() {
let response = await axios.get(`${baseURL}/${luckyNums}?json`);
$('body').append('<p>Part 2.</p>');
for (let num in response.data) {
$('body').append(`<p>${response.data[num]}</p>`);
}
$('body').append('<hr>');
} | [
"async function getMultNumbers() {\r\n try {\r\n $('body').append(`<h1>#2 RESOLVED</h1>`)\r\n let nums = await axios.get(`${baseURL}/3,33,333?json`);\r\n for (num in nums.data) {\r\n $('body').append(`<p>${nums.data[num].text}</p>`)\r\n }\r\n }\r\n catch (... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Return the best individual in the population (this.population[bix]) | best()
{
let max = -1;
let bix = 0;
for(let i = 0; i < this.popSize; i++)
{
if(this.population[i].fitness > max)
{
max = this.population[i].fitness;
bix = i;
}
}
return this.population[bix];
... | [
"getBest() {\n\t\t\tvar best = this.population[0];\n\t\t\tvar bestIndex = 0;\n\n\t\t\tfor(var i = 0; i < this.population.length; i++) {\n\t\t\t\tif(this.population[i].fitness > best.fitness) {\n\t\t\t\t\tbest = this.population[i];\n\t\t\t\t\tbestIndex = i;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn {obj: best, index: best... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
set meals to LS | function addMealsToLs(idMeal) {
const favMeals = getMealsFromLs();
localStorage.setItem("fav-meals", JSON.stringify([...favMeals, idMeal]));
} | [
"set meals(meals) {\n this._meals = meals;\n this.render();\n }",
"function resetMeals() {\n this.meals = [];\n }",
"function addMealToLS(mealId){\n const mealIds = getMealsFromLS();\n\n localStorage.setItem('mealIds', JSON.stringify\n ([...mealIds, mealId]));\n}",
"function getMeals() {\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
GET Album Images // useless? | async albumImages({ albumHash }) {
// if (!enable()) return null;
try {
console.log("[imgur] GET Album Images " + albumHash);
return await _apiRequest2("GET", "album/" + albumHash + "/images");
} catch (error) {
... | [
"async getAlbums(){\n const token = await GoogleSignin.getTokens();\n await this.getDbUserData();\n data = {\n URI: 'https://photoslibrary.googleapis.com/v1/albums?excludeNonAppCreatedData=true',\n method: 'GET',\n headers: {\n 'Authorization': 'B... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
returns true if this session is a ConfirmCallSession | get isConfirmCallSession() {
return this.constructor.name === 'ConfirmCallSession';
} | [
"isInitiator() {\n precondition.ensureNotNull('this.ctxPtr', this.ctxPtr);\n\n let proxyResult;\n proxyResult = Module._vscr_ratchet_session_is_initiator(this.ctxPtr);\n\n const booleanResult = !!proxyResult;\n return booleanResult;\n }",
"get isSmsCal... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
generateCardDeck() This function takes no parameters. This function creates a new deck in the deck[] global variable, and is run when generating the game area to ensure every card remains drawable in a given round. This function does not return a value. | function generateCardDeck(){
cardDeck.length = 0;//empty any potentially existing instance of the deck, to prevent it duplicating entries.
cardDeck = [];
for(let suitNo = 0; suitNo < 4; suitNo++){ //condensed it all down to two for loops, and a two switch statements in a constructor.
for(let rankNo ... | [
"generateDeck () {\n\n let suit,\n face;\n\n for (suit = 0; suit < 4; suit += 1) {\n\n for (face = 0; face < 13; face += 1) {\n\n this.deck.push({\n id: face + 1,\n className: suits[suit] + '-' + faces[face],\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
[END apps_script_admin_sdk_insert_license_assignment] [START apps_script_admin_sdk_generate_login_activity_report] Generates a login activity report for the last week as a spreadsheet. The report includes the time, user, and login result. | function generateLoginActivityReport() {
var now = new Date();
var oneWeekAgo = new Date(now.getTime() - 7 * 24 * 60 * 60 * 1000);
var startTime = oneWeekAgo.toISOString();
var endTime = now.toISOString();
var rows = [];
var pageToken;
var page;
do {
page = AdminReports.Activities.list('all', 'logi... | [
"function generateUserUsageReport() {\n var today = new Date();\n var oneWeekAgo = new Date(today.getTime() - 7 * 24 * 60 * 60 * 1000);\n var timezone = Session.getScriptTimeZone();\n var date = Utilities.formatDate(oneWeekAgo, timezone, 'yyyy-MM-dd');\n\n var parameters = [\n 'accounts:last_login_time',\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Displays gists to the screen. Input should be an array of gist objects | function displayResults(gists) {
var resultsDiv = document.getElementById("results");
for (var i = 0; i < gists.length; i++) {
var url = gists[i].html_url;
var desc = gists[i].description;
if (desc === null || desc === "") {
desc = "Untitled";
}
resultsDiv.app... | [
"function format_gists(gists) {\n var html = \"\";\n\n for(var i=0; i<gists.length; i++) {\n var gist = gists[i];\n\n html += `<div class=\"row\"><a href=\"${gist.html_url}\" target=\"_blank\">\n\n <div class=\"about\">\n ${Object.keys(gist.files).length > 1\n ? `<button class=\"files s... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Search contract for created events | getCreatedEvents() {
if (!this.contract) {
return;
}
// Search the contract events for the hash in the event logs and show matching events.
this.contract.getPastEvents(
"DeviceCreated",
{
filter: { _from: this.coinbase },
fromBlock: 0,
toBlock: "latest"
},... | [
"function searchEvents() {\n events.get().then((eventQuery) => {\n eventQuery.forEach((document) => {\n if (document.data().EventName.toLowerCase().includes(searchURLParam)) {\n printEvents(document)\n }\n })\n })\n}",
"getTriggerEvents() {\n if (!this.c... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Public function `nonEmptyArray`. Returns true if `data` is a nonempty array, false otherwise. | function nonEmptyArray (data) {
return array(data) && greater(data.length, 0);
} | [
"function nonEmptyArray(data) {\n return isArray(data) && data.length > 0;\n }",
"function nonEmptyArray (data) {\n return array(data) && data.length > 0;\n }",
"function nonEmptyArray(data) {\n return isArray(data) && data.length > 0;\n}",
"function nonEmptyArray(data) {\n return array(data) &&... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Add a .def to the core to export symbols | function ADD_DEF_FILE(name)
{
if (!configure_subst.Exists("PHPDEF")) {
DEFINE("PHPDEF", "$(BUILD_DIR)\\$(PHPDLL).def");
ADD_FLAG("PHP_LDFLAGS", "/def:$(PHPDEF)");
}
ADD_FLAG("PHP_DLL_DEF_SOURCES", name);
} | [
"function createExport(def) {\n return \"export * from './\" + conf.defsDir + \"/\" + def + \"';\";\n}",
"static GetScriptingDefineSymbolsForGroup() {}",
"static SetScriptingDefineSymbolsForGroup() {}",
"function extendExportSymbols(target,source,lookupTable,exportNode){if(!source)return;source.forEach(fun... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Chain a new load handler onto the existing handler chain if prepend is true, adds the function to the head of the handler list otherwise it will be added to the end (executed last) | function addLoadEvent(func, prepend) {
var oldonload = window.onload;
if (typeof window.onload != 'function') {
window.onload = function() {
func();
};
} else {
var prependFunc = function() {
func(); oldonload();
};
var appendFunc = function() {
oldonload(); func();
};
window.onload = prepend ... | [
"prepend(handler) {\n const layer = this._wrap(handler);\n layer.next = this.first;\n this.first = layer;\n this.last = this.last || layer;\n return this;\n }",
"function startInterceptingLoad () {\n var original = Module._load;\n Module._load = function (request, parent, isMain) {\n v... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Function for dynamically creating adding a category to all games called "Game" | function createGameCategoryAll(){
Games.forEach(game => game.categories.push("Games"));
GameCategories.push("Games");
} | [
"function createGameCategories(){\n\tGameCategories = new Set();\n\tGames.map(game => game.categories).flat().forEach(function(subcategory){\n\t\tGameCategories.add(subcategory);\n\t});\n\tGameCategories = Array.from(GameCategories); //turn the set into an array\n}",
"function addToCateg () {\n\n\t\tfor(var i=0;i... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
test to add microdata | function add_microdata(that){
//find appropriate itemtype for microdata
var itemid, schematype;
if(pprop){
//disabled in favor of flat microdata structure
schematype = ttype.match(/^[A-Z]/) ? ttype : "";
}else{
itemid = uri;
schematype = that.rdftype.match(/^[A-Z]/) ? that.rdftype : ... | [
"makeTestData (callback) {\n\t\tthis.expectedResponse = {\n\t\t\tcodemark: {\n\t\t\t\t_id: this.codemark.id,\t// DEPRECATE ME\n\t\t\t\tid: this.codemark.id,\n\t\t\t\t$set: {\n\t\t\t\t\tversion: this.expectedVersion,\n\t\t\t\t\tmodifiedAt: Date.now() // placeholder\n\t\t\t\t},\n\t\t\t\t$addToSet: {\n\t\t\t\t\ttags: ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
HINT: DISPLAY ROSTER Create a function called display that prints out the roster to the console. | function display() {
// body...
console.log(roster)
} | [
"function displayToScreen() {\n\n\n\t}",
"function display() {\n console.log(roster);\n}",
"function display(){\n console.log(chalk.yellow.underline.bold(\"Please use one of the following commands:\"))\n console.log(chalk.blue('\\tconcert-this')+\" to find the bands in the town\")\n console.log(... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
returns an array of formatted email addresses | formatAddresses(recipients){
return recipients.map(({ email }) => {
return new helper.Email(email);
});
} | [
"function extractEmails(val, names, filter, format){\n\tvar emails=[];\n\tif (!names && names!==false && ECClientCFG.supportNotations)names=true;\n\tif (val){\n\t\tvar spl=val.split(',');\n\t\temails.initCount=0;\n\t\tfor(var i=0;i<spl.length;i++){\n\t\t\tvar e=spl[i];\n\t\t\tvar n=\"\";\n\t\t\tif (!e.replace(regWS... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
number of lights & repetitions output array of "on" switches algorithm use array to store booleans, index is the light number two loops: One loop for the repetitions used as a remainder function of which switch to change one loop for the "light switching" index % repetition === 0, change light return a new array with t... | function lightsOn(num) {
var i;
var j;
var lights = [];
var returnedLights = [];
for (i = 1; i <= num; i += 1) {
for (j = 1; j <= num; j += 1) {
if (j % i === 0) {
lights[j] = lights[j] ? false : true;
}
}
}
lights.forEach(function(item, index) {
if (item) {
returnedLig... | [
"function lightsOn(num) {\n if (num === 0 || num === undefined) return [];\n\n let switches = Array(num).fill(false);\n\n switches.forEach((state, idx, switches) => {\n state = !state;\n let toggleIdx = idx;\n while (toggleIdx < num) {\n toggleIdx += (idx + 1);\n switches[toggleIdx] = !switche... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Extracts the method that we are trying to run once from the list of arguments. An optional target parameter can be passed in as the first parameter so we need to check the length of the array to determine where our function is being passed in. | function getMethodToRunOnce(args) {
return args.length > 1 ? args[1] : args[0];
} | [
"function invoker (name, method) {\n return function(target /* args ... */) {\n if (!existy(target)) fail(\"Must provide a target\");\n\n var targetMethod = target[name];\n var args = _.rest(arguments);\n\n return doWhen((existy(targetMethod) && method === targetMethod), function() {\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Function playerPopulate Ask player for replacement words. | function playerPopulate(){
for(i=0; i<toReplace; i++){
console.log(sentence + replacements[i]);
replacement=prompt("Enter a "+sentence[replacements[i]]);
sentence[replacements[i]]=replacement;
}
displayResult();
} | [
"setupGame() {\n const wordKeys = Object.keys(this.wordsToPick);\n this.wordInPlay = wordKeys[Math.floor(Math.random() * wordKeys.length)];\n this.lettersOfTheWord = this.wordInPlay.split(\"\");\n this.rebuildWordView();\n this.processUpdateTotalGuesses();\n }",
"function authorSetup(){\r\n\t se... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Evaluates, or attempts to evaluate, an IfStatement | function evaluateIfStatement({ node, environment, evaluate, statementTraversalStack }) {
const expressionValue = evaluate.expression(node.expression, environment, statementTraversalStack);
// We have to perform a loose boolean expression here to conform with actual spec behavior
// eslint-disable-next-line ... | [
"function ifStatement(param)\n{\n var ok = eval(param);\n if (ok)\n {\n novel.ifStack.push(0); // 0 == \"then\" part\n }\n else\n {\n novel.frame = novel_findMatchingElse();\n if (novel_script[novel.frame] == elsePart)\n {\n novel.ifStack.push(1);\n }\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Function to save kanji to user favourites | async function saveToFavourite(index) {
const isLogined = sessionStorage.getItem('isLogined')
if (Object.is(isLogined, 'true')) {
const kanji = JSON.parse(document.getElementById(`kanjiDetails${index}`).value)
const kanjiObj = {
"kanji": kanji
}
const token = sessionStorage.getItem('token')
... | [
"function saveFavorite() {\n\tfavorites.push(startupIdea);\n}",
"function saveFavs(favs) {\r\n localStorage.setItem(\"favourites\", JSON.stringify(favs));\r\n}",
"function saveButtonClick() {\n var favorites = JSON.parse(localStorage.getItem(\"favorites\"));\n \n if (favorites == null){\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Primary key name configured for specific collection | getPrimaryKey(collectionName) {
return this.schema[collectionName]['primary'];
} | [
"getPrimaryKey ({ collections }, tableName) {\n let definition = collections[tableName].definition\n\n\n if (!definition._pk) {\n let pk = _.findKey(definition, (attr, name) => {\n return attr.primaryKey === true\n })\n definition._pk = pk || 'id'\n }\n\n return definition._pk\n }... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
old hash deeplinking method for old browsers | function DeeplinkingHash() {
this.param = 'location';
this.init = function() {
var s = this;
this.check(0);
$(window).on('hashchange', function() {
s.check(600);
});
}
this.check = function(duration) {
var id = location.hash.slice(this.param.length + 2);
self.showLocation(id,... | [
"function DeeplinkingHash() {\n this.param = 'location';\n\n this.init = function() {\n var s = this;\n this.check(0);\n\n $(window).on('hashchange', function() {\n s.check(600);\n });\n }\n\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
check device group has no device | static checkDeviceGroupHasNoDevice(dg) {
return ImptTestHelper.runCommand(`impt dg info -g ${dg} -u -z json`, (commandOut) => {
const json = JSON.parse(commandOut.output);
expect(json['Device Group'].Devices).toBeUndefined();
ImptTestHelper.checkSuccessStatus(commandOut);
... | [
"static checkDeviceGroupNotExist(dg) {\n return ImptTestHelper.runCommand(`impt dg info --dg ${dg}`, ImptTestHelper.checkFailStatus);\n }",
"static checkDeviceGroupHasDevice(dg) {\n return ImptTestHelper.runCommand(`impt dg info -g ${dg} -u -z json`, (commandOut) => {\n const json = JS... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
make enemies using randoms for speed and track and add them to allEnemies | function createEnemies() {
let numberEnemies = 8;
for (let i = 0; i < numberEnemies; i++) {
let randomTrack;
if (i == 0 || i == 1) {
randomTrack = 0;
}
if (i == 2 || i == 3) {
randomTrack = 1;
}
if (i == 4 || i == 5) {
randomTrack = 2;
}
if (i == 6 || i == 7) {
... | [
"function createEnemies() {\n for (var i = 0; i < 3; i++) {\n let speed = Math.floor(Math.random() * 4) + 1;\n let x = 1;\n let y = Math.floor(Math.random() * 3);\n allEnemies.push(new Enemy(x, ((y + 1) * 83) - 15, speed));\n }\n}",
"function generateEnemies() {\n for (let i = ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
load_policy can take in either an ArrayBuffer or WebAssembly.Module and will return a LoadedPolicy object which can be used to evaluate the policy. | async load_policy(wasm) {
const memory = new WebAssembly.Memory({initial: 5});
const policy = await _load_policy(wasm, memory);
return new LoadedPolicy(policy, memory)
} | [
"async function _load_policy(policy_wasm, memory) {\n\n const addr2string = stringDecoder(memory);\n\n let env = {};\n\n const wasm = await WebAssembly.instantiate(policy_wasm, {\n env: {\n memory: memory,\n opa_abort: function(addr) {\n throw addr2string(addr);\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
get binding data from dom | function getBindingData(dom){
var bindingDataRegExp= RegExp('{{.*}}','gim');
// matched=bindingDataRegExp.exec(dom);
matched=dom.match(bindingDataRegExp);
// matchedIndex=dom.search(bindingDataRegExp);
// console.log(matchedIndex);
return matched;
} | [
"function getBindingFromElement(element) {\n return getPropertyFromElement(element, DATA_BINDING_ID);\n }",
"function dataBind(domElement) {\n var bind = domElement.getAttribute(attrLbl).split(\":\"), domAttr, itemAttr, defaultValue, parentObjArr, propertyName; \n domAttr = \"textConte... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This method is used to perform ajax request with return type only | function doAjaxWithReturn(url, requestType, updateMethod){
try{
$.ajax({
url : G_URL_Rest + url,
type : requestType,
dataType: "json",
async: false,
cache: false,
beforeSend: function(request){
request.setRequestHeader("authorization", G_Session);
showInProgress();
console.log("doAja... | [
"function returnCallAjaxDo(toUrl,returnType){\r\n $.ajax({\r\n async: false,//同步提交 \r\n type:'post',\r\n dataType: returnType,\r\n url:toUrl,\r\n //data:$('#'+formId).serialize(),\r\n success:function(response,status,xhr){\r\n data=response;//把反回结果retu... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Method :: popTemplates Desc :: Handles all the template looping activities | popTemplates() {
let that = this;
const {memberInfo} = that.state;
let popTemplateData = this.state.templateDetails || [];
if(this.props.view) {
if (!popTemplateData || !popTemplateData.length)
return <NoData tabName={'Templates'}/>
}
const popTemplates = popTemplateData.map(funct... | [
"parseTemplates() {\n var self = this;\n var templates = this.view.find('[data-view-templates]');\n templates.find('[data-view-template-wrapper]').each(function(){\n var twrapper = $(this);\n self.templates[twrapper.data('view-template-name')] = twrapper.html();\n })\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
FULFILL STRING Replace slots and attributes into a string. From the most specific to the most generic. | fulfillString(str) {
return str.replace(/{{([^}]+)}}/g, (match, group) => {
if (this.hasSlot(group)) {
return this.slot(group);
}
if (this.hasRequestAttr(group)) {
return this.getRequestAttr(group);
}
if (this.hasSession... | [
"toString(){ return `Field('${this.name}': ${this.type}) = ${strings.describe(this.value, 18)}`; }",
"toString() {\r\n const arrToString = [this.name];\r\n if (this.optionality === undefined) {\r\n arrToString.push(`${this.asnType.toString()}${sequenceType_1.COMMA_PLACEHOLDER}`);\r\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
_addBaselineStyles Adds baseline styles to the page, used by all AnchorJS links irregardless of configuration. | function _addBaselineStyles() {
// We don't want to add global baseline styles if they've been added before.
if (document.head.querySelector('style.anchorjs') !== null) {
return;
}
var style = document.createElement('style'),
linkRule =
'.anchorjs-link{' ... | [
"function _addBaselineStyles() {\n // We don't want to add global baseline styles if they've been added before.\n if (document.head.querySelector('style.anchorjs') !== null) {\n return;\n }\n\n var style = document.createElement('style'),\n linkRule =\n ' .anchorjs-link ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get search map feature for the given level ID | featuresForLevel(level_id) {
return (this.searchables || []).filter((i) => i.level_id === level_id);
} | [
"function findFeatureById(id) {\n for (var x = 0; x < scope.features.length; x++) {\n if (scope.features[x].getId() === id) {\n return scope.features[x];\n }\n }\n return null;\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Fit the model specified in the data fields to the data in the plot | fit(model) {
$("#metrics").removeClass("visible").addClass("invisible");
if (this.dataset.length == 0) {
console.log("cannot fit model to no data!");
return
}
// The contours grid determines what to make predictions on.
// TODO: don't pass this to the server ... | [
"function applyModel(data, theta, degree)\n{ \n\t// if the degree is not provided, use the default\n\tif(!degree) degree = DEFAULT_POLYNOMIAL_DEGREE;\n\n\t// turn the input into the same form we used for generating theta (or else this won't work)\n\tvar xMatrix = generateInputMatrix(data[\"x\"], degree).transpose()... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Updates the activities array with the description from Strava | function updateActivityUserGeneratedContent(header, data, sheet) {
var activities = data.activities;
var stravaIdIndex = header.indexOf('Strava ID');
var nameIndex = header.indexOf('Name');
var descriptionIndex = header.indexOf('Description');
var updatedActivities = 0;
var label = 'For Loop';
console.... | [
"function updateActivities() {\n vm.updateResponse = \"\";\n if (!vm.isConnected()) {\n alert(\"Connect to Strava to update the local DB.\");\n return;\n }\n vm.updateResponse = \"Update in progress...\";\n $http.get('updateactivities').then((response) => {\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Convert hash to an array | function convertHashToArray(hash){
result = []
Object.keys(hash).sort().map((k) => result.push([k, hash[k]]))
return result
} | [
"function convert(hash) {\n for (var key in hash) {\n hashArray.push([key, hash[key]]);\n }\n return hashArray;\n}",
"function getHashArray( hash ) {\n return hash.split( '/' );\n }",
"function convert(hash) {\n return Object.entries(hash);\n}",
"function values(hash) {\n var keys = Object... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
generate a noun phrase that contains a prepositional phrase | function nounphrase(){
var i=0;
var npresponse=[]
npresponse.push(nbar())
do{
var pphrase=prepphrase();
if(pphrase[1]==undefined){
i=1
}
else{
npresponse.push(pphrase)
}
}
while(i<1);
return npresponse;
} | [
"function generatePhrase() {\n\n const pronouns = ['My', 'His', 'Her', 'Its', 'Our', 'Their'];\n\n const pi = Math.floor(Math.random() * pronouns.length);\n const ni = Math.floor(Math.random() * nouns.length);\n const ai = Math.floor(Math.random() * adjectives.length);\n\n const phrase = pronouns[pi] + ' ' + n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Go over each story module, to invoke it's default export with: 1. A simplified storybook API, called HeidiStorybook. 2. The storybook object, in case it's needed. 3. An object of all the addons being used. | function setupEachStory (modulePath) {
const packageReadmePath = modulePath.replace(
'src/.stories.js',
'readme.md'
);
const readme = readmes[packageReadmePath];
// Setup each story to have a readme in it, when available, regardless of if
// the consumer uses a HeidiStorybook.
const... | [
"function loadStories() {\n require(\"../index.stories\");\n}",
"function loadStories() {\n require('../stories/index.ts');\n}",
"function loadStories() {\n require('../src/stories');\n}",
"function loadStories() {\n const req = require.context(__PACKAGES__, true, /story\\.jsx$/);\n req.keys().forEach(fi... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
toMS(duration) Converts given `duration` to a millisecond string. toMS('fast') => jQuery.fx.speeds[i] => "200ms" toMS('normal') //=> jQuery.fx.speeds._default => "400ms" toMS(10) //=> '10ms' toMS('100ms') //=> '100ms' | function toMS(duration) {
var i = duration;
// Allow string durations like 'fast' and 'slow', without overriding numeric values.
if (typeof i === 'string' && (!i.match(/^[\-0-9\.]+/))) {
i = jQuery.fx.speeds[i] || jQuery.fx.speeds._default;
}
return unit(i, 'ms');
... | [
"function toMS(duration) {\n var i = duration;\n\n // Allow string durations like 'fast' and 'slow', without overriding numeric values.\n if (typeof i === 'string' && (!i.match(/^[\\-0-9\\.]+/))) { i = jQuery.fx.speeds[i] || jQuery.fx.speeds._default; }\n\n return unit(i, 'ms');\n }",
"function toMS(... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Esta funcion se encarga localizar un punto en el cuerpo | function localizarPunto(id) {
// Desactivar la localización del punto anterior
$('#' + puntoAnteriorLocalizado).css({
'background':'#1F95D0',
'animation': 'punto 2s infinite'
});
// Cerrar menu lateral
$('.menu_lesiones').css({right: '-1000px'});
// Activar localización del punto ... | [
"function localizar(punto){\n\tlocalizador.geocode({location:punto}, function(respuesta, estado){\n\t\tvar latlng = respuesta[0].geometry.location;\n\t\tif(estado == google.maps.GeocoderStatus.OK){\n\t\t\tdocument.getElementById('form-posicion').direccion.value = respuesta[0].formatted_address;\n\t\t\tdocument.getE... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Reads the contents of a symlink if it exists, otherwise returns null. Rethrows errors that aren't related to file existance. | async readlink(filename, opts = { encoding: 'buffer' }) {
// Note: FileSystem.readlink returns a buffer by default
// so we can dump it into GitObject.write just like any other file.
try {
const link = await this._readlink(filename, opts);
return Buffer.isBuffer(link) ? link : Buffer.from(link)
... | [
"async readlink(filename, opts = { encoding: 'buffer' }) {\n // Note: FileSystem.readlink returns a buffer by default\n // so we can dump it into GitObject.write just like any other file.\n try {\n return this._readlink(filename, opts)\n } catch (err) {\n if (err.code === 'ENOENT') {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
get active object function for cross browser | function getActivatedObject(e)
{
var obj;
if(!e)
{
obj = window.event.srcElement; //old explorer
}
else if(e.srcElement)
{
obj = e.srcElement; //ie7 or later
}
else
{
obj = e.target; //dom level 2
}
return obj;
} | [
"function getActivatedObject(e){\r\n\tvar obj;\r\n\tif(!e){\r\n\t\tobj = window.event.srcElement; //old explorer\r\n\t}else if(e.srcElement){\r\n\t\tobj = e.srcElement; //ie7 or later\r\n\t}else{\r\n\t\tobj = e.target; //dom level 2\r\n\t}\r\n\treturn obj;\r\n}",
"function safeActiveElement(){try{return document.... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
redirect to the login route and store the attempted transition so we can move to it later. | redirectToLogin(transition) {
this.controllerFor('sessions').set('attemptedTransition', transition);
return this.transitionTo('sessions');
} | [
"function redirectToLogin() {\n changeRedirectLogin(true);\n }",
"redirect() {\n if (get(this, 'session.isAuthenticated')) {\n this.transitionTo('index');\n }\n }",
"sessionAuthenticated() {\n const attemptedTransitionUrl = this.get('session.data.attemptedTransitionUrl');\n if(attemptedTra... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Create the next ad page to be shown based on predetermined placements. | createNextPage_() {
const position = this.adPositions_[this.pagesCreated_];
const adPage = this.pageManager_.createAdPage();
adPage.registerLoadCallback(() => {
// TODO(ccordry): we could maybe try again if insertion fails.
this.pageManager_.maybeInsertPageAfter(
this.storyPageIds_[posit... | [
"function prepareNextPage() {\n pageDOM.push(NEW_PAGE);\n\n currentHeight = 0;\n\n // This function is responsible for handling the headers and footers.\n // This provides support for a unique first-page header and footer.\n // Pass the first page header or foo... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Draw trend type title | function drawTrendDisplayName(trendDisplayName) {
var margin = {top: 15, left: 5};
var svg = d3.select(container)
.append("div")
.classed("svg-trendtype-title", true)
.append("svg")
.attr("height", 30)
.append("g")
.attr("transform", "translate(" + margin.left + "," + margin.top + ")");
... | [
"renderTitle() {\n this.plot.append(\"text\")\n .classed(\"diagramTitle\", true)\n .classed(\"diagramSubTitle\", true)\n .text(\"deaths per\")\n .attr(\"x\",this.width/2)\n .attr(\"y\",this.width/2 - (this.width * 0.05))\n .style(\"font-size\",\"2vh\")\n\n this.plot.append(\"text\")\n .cl... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
copied from schema queries included_types | function included_types(id) {
return freebase.mqlread({
id: id,
"/freebase/type_hints/included_types": [{
optional: true,
id: null,
name: null,
type: "/type/type",
index: null,
sort: "index",
"!/freebase/domain_profile/base_type": {optional: "forbidden", id: null, lim... | [
"function add_included_types(id, included_types) {\n var q = {\n id: id,\n \"/freebase/type_hints/included_types\": []\n };\n included_types.forEach(function(type_id) {\n q[\"/freebase/type_hints/included_types\"].push({id: type_id, connect: \"insert\"});\n });\n return freebase.mqlwrite(q)\n .then... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
isDataMissing() Function to check if any field its missing | function isDataMissing() {
// Loop through each key in JSON
for (let _key in data) {
// get the value for the current key
let _data = data[_key];
// check if data is available
if (_data.length < 1) {
// if no data return true
return true;
}
}
... | [
"function missingFields(fields){\n let isMissing = false\n fields.forEach(field => {\n if(!field){\n isMissing = true\n }\n })\n return isMissing\n }",
"function isDataMissing(iStart, iEnd) {\n\t\t\tvar i;\n\t\t\tfor (i = iStart; i < iEnd; i += 1) {\n\t\t\t\tif (aElements[i] === unde... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Provides default behavior for invoke activities. | onInvokeActivity(context) {
return __awaiter(this, void 0, void 0, function* () {
try {
switch (context.activity.name) {
case signInConstants_1.verifyStateOperationName:
case signInConstants_1.tokenExchangeOperationName: {
... | [
"function createInvokeActivity() {\n return { type: index_1.ActivityTypes.Invoke };\n }",
"launchAction() {\n switch (this.config.actionType) {\n // Simple link\n case 'link' :\n this.gotoUrl()\n break\n\n // Ajax call\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Function 12 Is Friend /////////////////////////////////////////// //////////////////////////////////////////////////////////////////// chheck if the friends array in the object includes the input name return true if is a friend of and false otherwise | function isFriend(name, object) {
if (Array.isArray(object.friends) && object.friends.includes(name)){
return true;
}
return false;
} | [
"function isFriend(name, object) {\n if(object.friends === undefined){\n return false;\n }else if(object.friends.length > 0){\n for(let i = 0; i < object.friends.length; i++){\n if(name === object.friends[i]){\n return true;\n }\n }\n }return false;... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
class Time argument time is object Date (Event's start/end .dateTime) | function Time(time) {
/*
* PRIVATE
* time is object Date
* return time in minutes (from 00:00:00)
*/
var toMinute = function() {
if (time != null) {
var hour = time.getHours(); // 0 - 23
var min = time.getMinutes(); // 0 - 59
return hour * 60 + min; // 0 - 1439
} else {
return nul... | [
"function Time_Event(data){\r\n this.initialize.apply(this, arguments);\r\n}",
"timeSelection(e, time) {\n this.selectedTime = time;\n }",
"function TimeRange() {}",
"constructor(dateBody, timeBody) {\n this.time = timeBody;\n this.date = dateBody;\n }",
"function TimeRange(start, end) {... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
create the detail chart | function createDetail(masterChart) {
// prepare the detail chart
var detailData = [],
detailData2 = [],
detailStart = d.getTime()-30*24*3600*1000;
jQuery.each(masterChart.series[0].data, function(i, point) {
if (point.x >= detailStart) {
... | [
"function createDetail(masterChart, data) {\n // prepare the detail chart\n var detailData = [],\n detailStart = data[0][0];\n\n\n // console.log(data[0][0])\n\n $.each(masterChart.series[0].data, function () {\n if (this.x >= detailStart) {\n // console.log(th... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
change "prescription_taken" to "false" | function makeFalse(prescription) {
setTimeout(function () { // add delay in loop
fetch(`${url}${prescription.id}`, {
method: "PATCH",
headers: {
"Content-Type": "application/json",
"Accept": "application/json"
},
body: JSON.stringify({
prescription_tak... | [
"function skipValidation() {\n unsaved = false;\n }",
"function checkprescriptionexists(medication) {\n console.dir(medication);\n let result = prescriptions.find(pres => pres.medication.fda_number === medication.appNumber) \n setExistingPrescription(result); \n console.log(\"24:AddMedication - Se... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Read CURRENT, create a calendar. Binds click events to buttons. | function generateCalendarForCurrent ( ) {
CURRENT.setDate(1);
var currentCopy = copy(CURRENT);
CAN_PREV = currentCopy >= MIN;
CAN_NEXT = currentCopy <= END_LIMIT;
clearClickedCells();
ROOT.innerHTML = '';
ROOT.appendChild(build(currentCopy, 0, options, CAN_PREV, CAN_NEXT, classify));
if ( ... | [
"function performCalendarReadFunctions() {\n\n\t\t\tvar label = Ti.UI.createLabel({\n\t\t\t\tbackgroundColor : 'white',\n\t\t\t\ttext : 'Add Calendar Event\\nPick a calendar to add this event to:',\n\t\t\t\ttextAlign : Ti.UI.TEXT_ALIGNMENT_CENTER,\n\t\t\t\tbackgroundColor : '#2399A3',\n\t\t\t\ttop : 80,\n\t\t\t\twi... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Go to Discuss Given a nonempty array of integers, return the third maximum number in this array. If it does not exist, return the maximum number. The time complexity must be in O(n). Example 1: Input: [3, 2, 1] Output: 1 Explanation: The third maximum is 1. Example 2: Input: [1, 2] Output: 2 Explanation: The third maxi... | function thirdMaximum(nums) {
let max = Array(3).fill(-Infinity);
for( let i=0; i<nums.length; i++) {
if(max.includes(nums[i])) continue
max[2] = Math.max(max[2], Math.min(max[1],nums[i]));
max[1] = Math.max(max[1], Math.min(max[0],nums[i]));
max[0] = Math.max(max[0], nums[i]... | [
"function thirdMax(arr, n) {\n // let maxNum = -Infinity;\n // let secondMaxNum = -Infinity;\n // let thirdMaxNum = -Infinity;\n // // let arr = new Array(6).fill(-Infinity);\n\n // for (const num of arr) {\n // if (num > maxNum) {\n // maxNum = num;\n // } else if (num < maxNum && num > secondMaxNu... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Extend a traversal by adding a 'map' step that uses a Groovy function to transform the traverser. | function mapTraversal(traversal, groovy) {
var gfunction = makeGroovyFunction(groovy);
var unwrapped = traversal.unwrap();
var mappedTraversal = gremlin.wrapTraversal(unwrapped.mapSync(gfunction));
return mappedTraversal;
} | [
"function mapVisit(nodes, fn) {\n var len = nodes.length;\n var idx = -1;\n while (++idx < len) {\n visit(nodes[idx], fn);\n }\n }",
"function mapVisit(nodes, fn) {\n var len = nodes.length;\n var idx = -1;\n\n while (++idx < len) {\n visit(nodes[idx], fn);\n }\n }",
"functio... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
render static header on every page pass through handleLinks and handleLoginClick because we have clickable login in the header | render() {
return (
<div className="App">
<Header
handleLogoutSubmit={this.handleLogoutSubmit}
handleLoginClick={this.handleLoginClick}
handleLinks={this.handleLinks}
userInfo={this.state.userInfo}
/>
{this.pageView()}
</div>
);
} | [
"function addLoginOrLogoutLinkToHeader() {\n\t const navigationElement = document.getElementById('header');\n\t if (!navigationElement) {\n\t console.warn('Navigation element not found!');\n\t return;\n\t }\n\t fetch('/login-status')\n\t .then((response) => {\n\t return response.json();\n\t ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Handler that pays people. Creates Bill doing so. | function payPersonHandler(group, title, amount, members, date) {
createBillHandler(group, title, amount, members, date);
} | [
"function makeBuyer() {\r\n registerBuyer();\r\n getUserId();\r\n updateBuyerInfo();\r\n createBuyerAddress();\r\n}",
"function _qboCallback(err, bill){\n if (err) return console.error(JSON.stringify(err, null, 2));\n console.info('The following bill was created for ' + ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Creates a factory for a platform | function createPlatformFactory(parentPlatformFactory,name,providers){if(providers===void 0){providers=[];}var desc="Platform: "+name;var marker=new InjectionToken(desc);return function(extraProviders){if(extraProviders===void 0){extraProviders=[];}var platform=getPlatform();if(!platform||platform.injector.get(ALLOW_MUL... | [
"function createPlatform(injector){if(_platform&&!_platform.destroyed&&!_platform.injector.get(ALLOW_MULTIPLE_PLATFORMS,false)){throw new Error('There can be only one platform. Destroy the previous one to create a new one.');}_platform=injector.get(PlatformRef);var inits=injector.get(PLATFORM_INITIALIZER,null);if(i... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
hide delete marks on each li element | function hideDeleteButtons(){
$('li').find('.delmark').hide();
} | [
"function hideMarked() {\n const inputs = document.querySelectorAll('input[type=\"checkbox\"]');\n const scope = document.getElementById('todo_list');\n let listItems = scope.getElementsByTagName('li');\n\n for (let i = inputs.length - 1; i >= 0; i--) {\n if (inputs[i].checked) {\n lis... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get all the words from the database | getWords() {
return new Promise((resolve, reject) => {
result = undefined;
db.transaction(tx => {
tx.executeSql(
Word.Query.SELECT_ALL_WORD_QUERY_ORDERBY_LATEST,
[],
(_, {rows: { _array } }) => result = _array
... | [
"function getAllWords(){\n return foodWords.find({});\n}",
"function getAllWords(documents){\n var allWords = new Set()\n documents.forEach(obj => {\n obj.content.toLowerCase().split(' ').forEach(contentWord => {\n if(!stopWords.includes(contentWord)){\n allWords.add(cont... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Empties the transition queue but carries on with the current transition. | clearQueue() {
if (this.isAnimating) {
this._queue = [this._queueFirst];
return;
}
this._queue = [];
} | [
"clear() {\n this.queue = null;\n }",
"function clearQueue() {\n\n\tif (!currentUnit)\n\t\treturn;\n\n\tdeleteActions(currentUnit, function(data) {});\n\t$(\"#command-list\").html(\"\");\n\n}",
"clear () {\n this._queue = []\n }",
"clear() {\n this._incomingTransitions.forEach((incomingTransi... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |