query stringlengths 9 34k | document stringlengths 8 5.39M | negatives listlengths 19 20 | metadata dict |
|---|---|---|---|
Combine the baseUrl, genre, and year together to create a complete url with the right query parameters. Then return the url. Check out examples query params at | function buildQueryString(genre, language, year){
return `${baseAPIUrl}&with_genres=${genre}&primary_release_year=${year}&with_original_language=${language}&sort_by=revenue.desc`;
} | [
"function buildQueryString(baseUrl, genre, year){\n var completedUrl = baseUrl + '&' + \"with_genres\" + \"=\" + genre + \"&\" + \"primary_release_year\" + \"=\" + year;\n return completedUrl;\n}",
"function buildQueryString(baseUrl, genre, year, certification) {\n return `${baseUrl}&with_genres=${genre}&prima... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Open some folders for initial layout, if necessary | function setInitialLayout() {
if (browserVersion > 0 && !STARTALLOPEN)
clickOnNodeObj(foldersTree);
if (!STARTALLOPEN && (browserVersion > 0) && PRESERVESTATE)
PersistentFolderOpening();
} | [
"function setInitialLayout() {\n if (browserVersion > 0 && !STARTALLOPEN)\n clickOnNodeObj(foldersTree);\n \n if (!STARTALLOPEN && (browserVersion > 0) && PERSERVESTATE)\n\t\tPersistentFolderOpening();\n}",
"function setupAllFolders(){\n setupMainFolder();\n createFolder('FormsFolder','Forms');\n }",... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
function that clears interval | function clear() {
clearInterval(int);
} | [
"function intervalClear() {\r\n if (interval) {\r\n clearInterval(interval);\r\n }\r\n}",
"clear() {\n clearInterval(this.interval);\n this.reset();\n }",
"function clearIntervals() {\n intervals.forEach(i => clearInterval(i));\n //resets intervals variable by removing all contents o... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
========= MUPM_get_selected_depbases ============= PR20201007 | function MUPM_get_selected_depbases(){
//console.log( " --- MUPM_get_selected_depbases --- ")
const tblBody_select = document.getElementById("id_MUPM_tbody_select");
let dep_list_arr = [];
for (let i = 0, row; row = tblBody_select.rows[i]; i++) {
let row_pk = get_attr_from... | [
"function MSTUD_get_selected_depbases(){\n //console.log( \" --- MSTUD_get_selected_depbases --- \")\n const tblBody_select = document.getElementById(\"id_MSTUD_tblBody_department\");\n let dep_list = [];\n // TODO depbase cannot be changed\n /*\n for (let i = 0, row; ro... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Insert props ears in state | componentWillReceiveProps(props) {
this.setState(...this.state, {
ears: props.ears
});
} | [
"handleAddAdditionalProperties() {\n this.setState((cState) => ({\n additionalProperties: [\n ...cState.additionalProperties,\n {\n key: '',\n value: '',\n },\n ],\n }));\n }",
"static React(s... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Type guard for any key, `k`. Marks `k` as a key of `T` if `k` is in `obj`. | function isKeyOf(obj, k) {
return k in obj;
} | [
"function keyInObj(value, key, obj) {\n return key in obj;\n }",
"function doesItContain(key, obj) {\n if (obj.hasOwnProperty(key)) {\n return true;\n }\n else\n return false;\n}",
"function hasKey(obj, key) {\n\t return (Object.keys(obj).includes(key))\n\t//Easy\n}",
"keyValueExist... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
returns value of dealers hand | function getDealerValue(){
var DealerValue = 0;
var amountAce = 0;
for (var i = 0; i < dealerHand.length; i++){
if (amountAce == 0){
if (dealerHand[i].number == 'ace'){
amountAce = 1;
}
else{
DealerValue = DealerValue + dealerHand[i].value;
}
}
else{
DealerValue = DealerValue + dealerHan... | [
"function dealerHand() {\n if (hold === true)\n return \"Dealer's Cards: \" + dealer.toString();\n else\n return \"Dealer's Cards: __,\" + dealer[1];\n}",
"dealerCard () {\n return dealerCards[0];\n }",
"function dealerResult() {\n var nums = total(dealer);\n if (nums[0] === nums[1] ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
reads the file provided and outputs it as an array buffer file => the file to read, needs to be a blob or file object onSuccess => function to run if the read operation completes onFail => function to run if the read operation fails | function readFile(file,onSuccess,onFail){
//what type of file is being read
var fileType = file.name.substr(file.name.indexOf("."));
//an array of common video extentions to check against
var videoExtentions = [".mp4",".avi", ".mov", ".wmv"];
//the size of the file being read in mb
var fileSize = (file.size... | [
"function getFileBuffer() {\n var deferred = jQuery.Deferred();\n var reader = new FileReader();\n reader.onloadend = function (e) {\n deferred.resolve(e.target.result);\n }\n reader.onerror = function (e) {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns true if the given object has a nonnull value in all properties. | hasProps(obj) {
const size = this.size;
for (let i = 0; i < size; ++i) {
const prop = this.getProp(obj, i);
if (prop === null || prop === undefined) {
return false;
}
}
return true;
} | [
"function checkPropsAreNull(obj) {\n for(var key in obj) {\n if (obj[key]) return false;\n }\n return true;\n}",
"static isObjectPropertyAllHasEmptyValue(object) {\n if (lodash.isObject(object)) {\n for (var key in object) {\n if (\n object[key] !== \"\" &&\n !this... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
get all state match the pattern | function getMatchStates(stateman, pattern){
var current = stateman;
var allStates = [];
var currentStates = current._states;
for(var i in currentStates){
var state = currentStates[i];
if(pattern.test(state.stateName)) allStates.push( state );
if(state._states) allStates = allS... | [
"function getMatchStates(stateman, pattern) {\n var current = stateman;\n var allStates = [];\n\n var currentStates = current._states;\n\n for (var i in currentStates) {\n var state = currentStates[i];\n if (pattern.test(state.stateName)) allStates.push(state);\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This middleware check if the user is connected and refreshes the access token and configure a `res.spotifyApi` with the token of the connected user | function setSpotifyApi(req, res, next) {
if (!req.user) {
res.redirect("/");
return;
}
res.spotifyApi = spotifyApi;
res.spotifyApi.setRefreshToken(req.user.refreshToken);
res.spotifyApi
.refreshAccessToken()
.then(data =>{
User.findByIdAndUpdate(
req.user._id,
{
... | [
"async function spotifyTokenMiddleware(req, res, next) {\n try {\n req.locals.user_spotify_refresh_token = await db\n .collection('user_metadata')\n .doc(req.locals.user.email)\n .get()\n .then((doc) => doc.data().spotify_refresh_token);\n if (!req.locals.user_spotify_refresh_token) {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Lee tonos DTMF desde el gamepad conectado a MT8870 | function Poll_Pad_DTMF()
{
try
{
if (gb_use_gamepad_dtmf === false)
{
return;
}
let pads = navigator.getGamepads();
let pad0 = pads[0];
let i=0;
if (pad0)
{
gb_cad_botones='';
for (i=0;i<pad0.buttons.length;i++)
{
if (pad0.buttons[i].value === 1)
{
gb_cad_b... | [
"function getDTMFinfoCX(parameters)\n{\n console.log(\"getDTMFinfo\");\n\n\n var dtmfInfo = {\n isDTMF : false ,\n stopDigit : \"\" ,\n totalDigits : null ,\n timeout : 5 ,\n noDTMF : false\n };\n\n if(! parameters || ! parameters.fields) {\n return dtmfInfo;\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Determine if the keyboard is visible or not. | get _visible() {
try {
return (
_WinRT.Windows.UI.ViewManagement.InputPane &&
_WinRT.Windows.UI.ViewManagement.InputPane.getForCurrentView().occludedRect.height > 0
);
... | [
"function isVisible() {\n if (!cordovaProxy.isAvailable())\n return;\n return cordova.plugins.Keyboard.isVisible;\n}",
"isVisible() {\n return this.window.isFocused();\n }",
"function getFocusVisible() {\n return focusVisible;\n}",
"function visibilityChanged() {\n if (keyboard)\n chro... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Create a mesh like this one, scaled by the given amount | scaled(scale) {
let vertices = this.vertices.map(
([x, y, z]) => [x * scale, y * scale, z * scale]);
return new Mesh(vertices, this.faces, this.faceNormals, this.vertexNormals, false);
} | [
"scale() {\n this._mesh.scaling.x = 1.1;\n this._mesh.scaling.z = 1.1;\n this._mesh.scaling.y = 5.5;\n }",
"scale(scaleAmount) {\n\n this.w *= scaleAmount;\n this.h *= scaleAmount;\n this.x = this.center.x - this.w / 2;\n this.y = this.center.y - this.h / 2;\n\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
renders the player's current health | function renderHealth () {
OasisCanvasContext.fillStyle = 'black';
OasisCanvasContext.font = "30px Arial";
OasisCanvasContext.fillText(
'' + OasisPlayer.health + ' / 100',
50,
50
);
} | [
"displayPlayerHealth() {\n if (this.healthLevel <= 0) {\n statusArea.innerText = 'You couldn\\'t escape in time!\\nYou\\'ve succumbed to your wounds and will lie in this house forever!';\n }\n else if (this.healthLevel > 0 &&\n this.healthLevel < 100 &&\n this.i... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Approaches hero. If it's lined up, it will lunge. | function act(){
if(!lunging){
turnToHero(.8);
if(distanceToHero() < 4){
moveFromHero(1.5);
if(angleToHero() < 2 || angleToHero() > 358) lunge(.5, .3, .8, 6, .5, .3);
}else{
move(2);
}
}
} | [
"function heroAttack(hero) {\n var atkDamage = hero.atk;\n if (critRoll()) {\n playCharAudio(chosenOne.critSound);\n atkDamage = (((atkDamage * 2) - chosenFoe.def) * hero.atkBonus);\n combatText(hero, chosenFoe, atkDamage, \" critically\");\n } else {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Actions Delete selected tickets | function deleteSelectedTickets() {
if( confirm('You really want to delete selected tickets?') ) {
var selected = $('li.ticket.ui-selected');
$.post(
'/projects/' + projectId + '/tickets/bulk_delete',
serializeObjects(selected),
null,
'json'
);
selected.remove... | [
"deleteTicket(id) {\n return axios.delete(`/api/tickets/${id}`);\n }",
"delete()\n\t{\n\t\tdatabase.ref('Tickets/' + this.getId()).remove();\n\t\tthis.#conversation.delete();\n\t}",
"delete () {\n this.app.delete('/ticketing/destroy/:id', this.jwt.verifyOrganizerToken(), (req, res) => {\n try {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Fonction qui filtre la liste des livres | function filtresLiv(searchFilter) {
return listLiv.filter(l => l.titre.includes(searchFilter)||l.auteur.nom.includes(searchFilter)||l.auteur.prenom.includes(searchFilter));
} | [
"function FilterListUtil() {}",
"function filterList() {\n let list = document.getElementById(\"list\").children;\n let searchValue = document.getElementById(\"search\").value.toLowerCase();\n for (let i = 0; i < list.length; i++) {\n if (!list[i].innerText.toLowerCase().includes(searchValue)) {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
POST un cliente fisico | function postClienteFisico() {
console.log('postCliente');
$.ajax({
type: 'POST',
contentType: 'application/json',
url: rootURL + "/cuentaAhorroAutomatico/crearCuentaAhorroAutomatico",
dataType: "json",
data: clienteFisicoToJSON(),
success: function(data) {
... | [
"function postClient(req, res){\n console.log(\"test post :\");\n let client = new Client();\n console.log(req.body.nom)\n\n client.id=req.body.id;\n client.nom=req.body.nom;\n client.prenom=req.body.prenom;\n client.dateNaissance=req.body.dateNaissance;\n client.abonnement=req.body.abonneme... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
get all the distinct category names across all media items passed in. | transform(mediaItems) {
var categories = [];
for (var i in mediaItems) {
{
if (categories.indexOf(mediaItems[i].category) <= -1) {
// 如果item.category 不在 categories数组当中,则将该category存入数组
categories.push(mediaItems[i].category);
... | [
"extractCategoriesFromItems(allItems) {\n let categories = [];\n let unique = {};\n\n for (let prop in allItems) {\n // The properties used as categories are \"type\" and \"specialType\".\n\n // Check the \"type\" first.\n if (typeof(unique[allItems[prop].type]) == \"undefined\" && allItems[... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Configure Ideogram taxids when 'organism' is not in ideo.config | function getTaxidsForOrganismsNotInConfig(taxidInit, callback, ideo) {
var taxids;
if (ideo.config.multiorganism) {
if (taxidInit) {
taxids = ideo.config.taxid;
}
} else {
if (taxidInit) {
taxids = [ideo.config.taxid];
}
ideo.config.taxids = taxids;
}
callback(taxids);
} | [
"function sortTaxidsByOriginalOrganismOption(ideo) {\n var configOrganisms, sortedTaxids, i;\n configOrganisms = ideo.config.organism;\n sortedTaxids = [];\n if (Array.isArray(configOrganisms)) {\n // Handling multi-organism ideogram\n for (i = 0; i < configOrganisms.length; i++) {\n sortedTaxids.pus... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Computes the distance the mouse was moved on canvas between the last two mouse updates. | function getMouseDeltaOnCanvas(){
var mousePosCurr = getPositionOnCanvas();
var mousePosLast = getPositionOnCanvas(mouseLast);
var delta = new THREE.Vector3(
mousePosCurr.x - mousePosLast.x,
mousePosCurr.y - mousePosLast.y,
mousePosCurr.z - mousePosLast.z
);
return delta;
} | [
"getMouseDelta(){\n var delta = new THREE.Vector3();\n delta.x = this.mousePos.x - this.mouseLast.x;\n delta.y = this.mousePos.y - this.mouseLast.y;\n\n return delta;\n }",
"function getMouseDelta(){\n var delta = new THREE.Vector3();\n delta.x = mouse.x - mouseLast.x;\n de... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Adds a point button in the point navigation bar | _addPointBtn() {
this.$points
.find('.addpoint')
.before('<a href="#" class="point" aria-label="point"> </a>');
} | [
"_addPointBtn() {\n\t this.$points.find( '.addpoint' ).before( '<a href=\"#\" class=\"point\" aria-label=\"point\"> </a>' );\n\t }",
"_addPointBtn(){this.$points.find('.addpoint').before('<a href=\"#\" class=\"point\" aria-label=\"point\"> </a>');}",
"function addLocateButton()\n{\n\tif(!navigator.geo... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Handle any cleanup tasks. | handleCleanup () {
// Execute each of the specified cleanup functions.
this._cleanups.forEach(function (cleanup) {
cleanup();
});
} | [
"function cleanup () {\n console.log( 'Cleaning Up ...' );\n if(app) {\n app.locals.shutting_down = true;\n } else {\n\n require('express')().locals.shutting_down = true;\n }\n \n disconnectServers().done(function( res ){\n console.log( \"Closed out remaining conne... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
function for displaying sliders when advanced button clicked | function displaySliders() {
sliders = document.getElementsByClassName('sliders')[0];
advanced_button = document.getElementsByClassName('advanced')[0];
reset = document.getElementsByClassName('reset_default')[0];
save_effect = document.getElementsByClassName('save_effect')[0];
sliders.classList.toggle('sho... | [
"function switchOnSliders() {\n $(\".rgb-slider\").slider({\n min: 0,\n max: 255,\n step: 1,\n slide: function (event, ui) {\n var value = ui.value;\n $(this).siblings('.value').text(value);\n movedRGBSlider(this, value)... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Dispatch events & callbacks making sure it does it on the right format, depending on whether v2compatible is being used or not. | function fireCallback(eventName, v) {
var eventData = getEventData(eventName, v);
if (!options.v2compatible) {
trigger(container, eventName, eventData);
if (options[eventName].apply(eventData[Object.keys(eventData)[0]], toArray(eventData)) === false) {
return false;
}
... | [
"function fireCallback(eventName, v){\r\n var eventData = getEventData(eventName, v);\r\n\r\n if(!options.v2compatible){\r\n trigger(container, eventName, eventData);\r\n\r\n if(options[eventName].apply(eventData[Object.keys(eventData)[0]], toArray(eventData)) ===... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
checks for diagonal win | function diagonalWin() {
//if one diagonal win returns true
if(board[0][0] == board[1][1] && board[1][1] == board[2][2] && board[0][0] != ' ' ){
return true;
}
//if other diagonal win returns true
else if( board[2][0] == board[1][1] && board[1][1] == board[0][2] && board[2][0] != ' '){
return true;
... | [
"function checkDiagonalWin() {\n\tfor (var col = 0; col <5; col++) {\n\t\tfor (var row = 0; row < 7; row++) {\n\t\t\tif (colorMatchCheck(getColor(row,col), getColor(row+1,col+1), getColor(row+2,col+2), getColor(row+3,col+3))) {\n\t\t\t\tconsole.log('diag');\n\t\t\t\treportWin(row,col);\n\t\t\t\treturn true;\n\t\t\t... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Converts a given item into columns. | columnify(item) {
let values = [];
for (let i = 0; i < item.args.length; i++) {
values.push(item.args[i].value);
}
return [timeToString(item.time), "0x" + item.id.toString(16), item.template.full_name, values];
} | [
"function getItemCol(item, items) {\r\n\tvar itemCol = \"\";\r\n\tfor (let x = 0; x < items.length; x++) {\r\n\t\tif (items[x] === item) {\r\n\t\t\titemCol = items.indexOf(items[x]);\r\n\t\t\treturn itemCol;\r\n\t\t}\r\n\t}\r\n}",
"function itemItemToRow(item) {\n var row =\n \"<tr><td><label>Item N... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Creates the right clickable extension. | function RightClickableExtension() {
_super.call(this);
} | [
"createButton () {\n\n this.button = document.createElement('button')\n\n this.button.title = 'Manage extensions'\n\n this.button.className = 'extension-manager btn'\n\n this.button.onclick = () => {\n this.showPanel(!this.panelActive)\n }\n\n const span = document.createElement('span')\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Define a function maxOfThree() that takes three numbers as arguments and returns the largest of them. | function maxOfThree(num1, num2, num3){
return Math.max(num1, num2, num3);
} | [
"function maxOfThreeNumbers(a, b, c) {\n // returns biggest of 3 numbers\n return Math.max(a, b, c);\n}",
"function maxOfThree (num1, num2, num3){\r\n return Math.max (num1, num2, num3);\r\n}",
"function maxOfThree(a,b,c){\n return max(max(a,b),c);\n}",
"function highest_of_three(num1, num2, num3)\r\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Set back panel colors to default | function resetPanelColors () {
// Retrieve the CSS rules to modify
let a_ss = document.styleSheets;
let ss = a_ss[0];
let cssRules = ss.cssRules;
setBackgroundColors(cssRules, undefined);
setTextColors(cssRules, undefined);
} | [
"restoreDefaults() {\n this.selectedColor = 0;\n this.colors = [new Color(0.5176, 0.7843, 0.0902)];\n }",
"setToDefault() {\n this.coloursCurrent = { ...this.coloursDefault }\n }",
"function resetPanelColors () {\r\n // Retrieve the CSS rules to modify\r\n let a_ss = document.styleSheets;\r\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Reset Current & Next page | function _resetPage($el) {
var id = $el.data('page');
$currPage = $el.data('currPage');
$nextPage = $(id);
} | [
"function pageReset(){\n setPage({\n currPage:1,\n pageLoaded:[1]\n })\n }",
"resetPage()\n {\n this._currentDirectoryPage = 1;\n }",
"function resetPage() {\n resultsPage = 1; //reset page\n $('#initialPage').val(1);\n }",
"function resetPages(done) ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
single point of entry for editing worksheets of user series and user and public sets | function editData(setOrGraph){//either a MD.Set or a MD.Graph (not defined for new series)
if(!account.loggedIn()) {
dialogShow("account required", dialogues.signInRequired);
return;
}
if($('#outer-show-graph-div').is(':visible')) quickViewClose();
var seriesSetToEdit, seriesSetsToEdit, ... | [
"function updateSettings() {\n let userMeta = getUserMetadata();\n let fields = Object.keys(userMeta)\n .filter(k => k !== WORKBOOK_KEY)\n .map(k => userMetaKeyValuePairView(k, userMeta[k]));\n\n // Set the table values\n $('#settings-table-body').html(fields.join(''));\n\n $('#deployme... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns the Slate's required environment variables with empty values | function getEmptySlateEnv() {
const env = {};
SLATE_ENV_VARS.forEach(key => {
env[key] = '';
});
return env;
} | [
"function getEmptySlateEnv() {\n const env = {};\n\n SLATE_ENV_VARS.forEach((key) => {\n env[key] = '';\n });\n\n return env;\n}",
"function requireEnvironmentVariables() {\n var environmentVariables = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n environmentVariables[_i] = arguments... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
add a bunch restaurants to restaurants list | addRestaurants(newRestaurants) {
const restaurants = this.state.restaurants;
this.setState({ restaurants: restaurants.concat(newRestaurants) });
} | [
"function addRestaurant(name){\n const newRestaurant = {id:'restaurant-'+nanoid(), name: name, category:[]};\n setRestaurants([...restaurantList,newRestaurant]);\n }",
"function copyRestaurants() {\n for (var i = 0; i < restaurants.length; i++) {\n var restaurant = {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Clear out the outputdata area. | function clearOutputData() {
console.log('clearOutputData');
gaOutputData = [];
updateOutputDataDisplay();
} | [
"function clearOutput() {\n outputDiv.hide().children().remove();\n outputDivOpen = false;\n }",
"function clearOutput () {\n mainView.send('output-clear');\n}",
"function clearOutput() {\n // Ensure clear button is disabled\n $('#clearOutput').prop('disabled', true);\n $('#output-con... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Renders the AWS CloudFormation properties of an `AWS::CloudFront::CloudFrontOriginAccessIdentity` resource | function cfnCloudFrontOriginAccessIdentityPropsToCloudFormation(properties) {
if (!cdk.canInspect(properties)) {
return properties;
}
CfnCloudFrontOriginAccessIdentityPropsValidator(properties).assertSuccess();
return {
CloudFrontOriginAccessIdentityConfig: cfnCloudFrontOriginAccessIdent... | [
"function cfnCloudFrontOriginAccessIdentityCloudFrontOriginAccessIdentityConfigPropertyToCloudFormation(properties) {\n if (!cdk.canInspect(properties)) {\n return properties;\n }\n CfnCloudFrontOriginAccessIdentity_CloudFrontOriginAccessIdentityConfigPropertyValidator(properties).assertSuccess();\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get the cards associated with the directory. This will return the cards associated with the mailing lists too. readonly attribute nsISimpleEnumerator childCards; | get childCards()
{
exchWebService.commonAbFunctions.logInfo("exchangeAbFolderDirectory: get childCards:"+ this.dirName+", uri:"+this.URI);
return exchWebService.commonFunctions.CreateSimpleObjectEnumerator(this.contacts);
} | [
"function _getAllCards(elem){\n return xtag.queryChildren(elem, \"x-card\");\n }",
"function getAllCards() {\n return mtgMarket.methods.getAllCards().call()\n }",
"cards() {\n const list = ReactiveCache.getList(this.selectedListId.get());\n let ret = [];\n if (list) {\n ret = list.... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Post a new comment on a link | function postComment(link_id, content, callback) {
var data = {
link_id: link_id,
content: content
}
$.post('./api/comments/create', data, function(comment) {
callback(comment)
})
} | [
"function sendComment(newComment) {\n console.log('send comment clicked');\n\t\t\t\tvar linkId = $scope.link._id;\n var theComment = {\n text: newComment,\n\t\t\t\t\tuser: UserService.getUserName()\n };\n\t\t\t\tconsole.log('comment to add:' + theComme... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
end ParticleFunc ParticleVar node base module for retrieving Particle device variables | function ParticleVar(n) {
// note: code in here runs whenever flow is re-deployed.
// the node-RED 'n' object refers to a node's instance configuration and so is unique between ParticleVar nodes
var that = this;
RED.nodes.createNode(this, n);
// Get all properties
this.pcloud = RED.nodes.getNode(n.pcloud... | [
"static GetParticleParameterValue() {\n // Enable display of particle type selection arrows.\n Test.fullscreenUI.SetParticleParameterSelectionEnabled(true);\n return Test.particleParameter.GetValue();\n }",
"function ParticleUtils() {}",
"function pollTemperature(arg) {\n part... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Determine whether the given properties match those of a `AcknowledgeFlowProperty` | function CfnAlarmModel_AcknowledgeFlowPropertyValidator(properties) {
if (!cdk.canInspect(properties)) {
return cdk.VALIDATION_SUCCESS;
}
const errors = new cdk.ValidationResults();
if (typeof properties !== 'object') {
errors.collect(new cdk.ValidationResult('Expected an object, but rec... | [
"function matchTransitionProperty(subject, property) {\n if (property === \"all\") {\n return true;\n }\n var sub = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__removeVendorPrefix__[\"a\" /* default */])(subject);\n var prop = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__removeVendorP... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
nest helper used to group by the array. can specified the keys and sort the keys. | function nest(){var keysFunction=[];var sortKeysFunction=[]; /**
* map an Array into the mapObject.
* @param {Array} array
* @param {number} depth
*/function map(array,depth){if(depth >= keysFunction.length){return array;}var i=-1;var n=array.length;var keyFunction=keysFu... | [
"function nest(){/**\n\t * map an Array into the mapObject.\n\t * @param {Array} array\n\t * @param {number} depth\n\t */\nfunction map(array,depth){if(depth>=keysFunction.length)return array;for(var i=-1,n=array.length,keyFunction=keysFunction[depth++],mapObject={},valuesByKey={};++... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
function : addClient event : click addclientbutton Takes no parameters. Use the information entered in the client name and abbreviation inputs to create a new client. Before creating a new client, checks the abbrevation and the name are unique | function addClient() {
var clients = [],
nameUnique = true,
abbreviationUnique = true,
dynamicData = {};
clients = DOM.$clienttablebody.find("tr");
dynamicData["name"] = DOM.$clientnameinput.val();
dynamicData[
"abbreviation"
] = DOM.$clientabbreviationinput.val().toUpperCa... | [
"function addClient(client){\n\t//new_client = document.getElementById('template_client_infobox').cloneNode(true)\n\tnew_client =$(\"#template_client_infobox\")\n\tnew_client = new_client.html()\n\t//Replacing IDs\n\twhile (new_client.search(\"XXXX\") != -1){\n\t\tnew_client = new_client.replace(\"XXXX\",client.mac... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Creates a new bag. | createNewBag() {
this.shuffleTetrominoes()
for (let i = 0; i < this.tetrominoArray.length; i++) {
this.bag[i] = this.tetrominoArray[i]
}
} | [
"function Bag(name, bags = []) {\n this.name = name;\n this.bags = bags && Array.from(bags).map(b => {return {amount: b[1], name: b[2]}});\n this.visited = undefined;\n}",
"function Bag(){\n // attributes\n this.items = [];\n // messages\n}",
"function generateNewBag() {\n bag = [];\n var insi... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
create separate p tag for number of days | function crP(){
daysP.id = 'daysPid';
document.getElementById('daysDiv').appendChild(daysP);
daysP.innerHTML = `<span style='color:white;font-size:3.5em;'>${days}</span><span style='color:green;font-size:2.5em;'><br>DAYS</span>`;
} | [
"function addDayNumbers()\t{\r\n\tvar i = 1;\r\n\tvar paragraphs = \"\";\r\n\tdo\t{\r\n\t\tvar tableCell = document.getElementById(\"1-\" + i);\r\n\t\tparagraphs = tableCell.getElementsByTagName(\"p\");\r\n\t\tparagraphs[0].innerHTML = i;\r\n\t\ti++;\r\n\t}\r\n\twhile (i <= 28);\r\n}",
"function createP(obj) {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
function winningcolor definition i.e. after user selected correct color , converting all div squares to that color. | function winningcolor(correctcolor) {
for ( var i=0; i < modeselect ; i++) {
sqlist[i].style.backgroundColor = correctcolor;
}
} | [
"function winningColors(color){\n //loop through all the squares\n for(let i=0;i<squares.length;i++){\n //change all colors to match the picked color\n squares[i].style.backgroundColor = color; \n } \n}",
"function changeColors(color){\n //loop through all squares\n for(var i=0; i<squ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Convert a string to a sequence of 16word blocks, stored as an array. Append padding bits and the length, as described in the MD5 standard. | function str2blks_MD5(str) {
nblk = ((str.length + 8) >> 6) + 1 ;
blks = new Array(nblk * 16) ;
for (i = 0; i < nblk * 16; i++)
blks[i] = 0 ;
for (i = 0; i < str.length; i++)
blks[i >> 2] |= str.charCodeAt(i) << ((i % 4) * 8) ;
blks[i >> 2] |= 0x80 << ((i % 4) * 8) ;
... | [
"function str2blks_MD5(str) {\n var nblk = ((str.length + 8) >> 6) + 1;\n var blks = new Array(nblk * 16);\n var i = 0;\n for (i = 0; i < nblk * 16; i++) {\n blks[i] = 0;\n }\n for (i = 0; i < str.length; i++) {\n blks[i... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
generate hint and add visual effects to the cards. | function generateHint(){
let matchingCardsIndex = getMatchingCardsIndex(model.getDisplayedCardArr());
if(matchingCardsIndex.length > 0){
$($(".card-container")[matchingCardsIndex[0]]).addClass("hint")
$($(".card-container")[matchingCardsIndex[1]]).addClass("hint")
$($... | [
"addHintToDisplay () {\n this.createSection([\"div\", \"p\", \"button\"], [\"id\", undefined, \"id\"],\n [\"hint\", \"hint\", \"get-hint\"], 'scoreboard');\n document.querySelector('#hint p')\n .textContent = \"click the button below to trade a... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
takes the json from cardtext.js as a parameter and returns an array of black cards | getBlackCards(json){
var blackCardsRaw = json.blackCards;
var blackCardsRefined = [];
for(var card of blackCardsRaw){
if(card.pick == 1){
blackCardsRefined.push(card.text);
}
}
return blackCardsRefined;
} | [
"getWhiteCards(json){\n return json.whiteCards;\n }",
"function extractCardsFromContent(myCards) {\n let items = [];\n // reset card numbering\n CARD_LABEL_NUMBERING = {};\n\n // Loop through each card and construct the items array with card data\n myCards.each(function (idx) {\n // jQuery(this) -... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
ProduitService est la fabrique des services | function ProduitFontion(ProduitService) {
var vm = this;
vm.loadAll = loadAll;
loadAll();
function loadAll() {//Fontion qui affiche la liste des produits
ProduitService.query(null, onSuccess, onError);
function onSuccess(data, headers) {
vm.pro... | [
"createService() {\r\n this._service = new CurrencyService();\r\n }",
"function DifarmaService() {\n var PrescriptionServiceDefinition = require(\"*/cartridge/scripts/services/PrescriptionServiceDefinition\");\n\n /**\n * Upload prescription file\n * @return {Object} result of prescription uplo... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
wordsReplace :: [Object] > String > String | function wordsReplace(dict, txt){
var result = "";
var txtbreaks = breaks(txt, isAlphabet);
for (i in txtbreaks){
var wo = txtbreaks[i];
for (j in dict)
if (dict[j].m == wo.toLowerCase())
wo = copyCase(wo, dict[j].r);
result += wo;
}
return result;... | [
"function mapString(wordObjectArray){\n for(let wordObj of wordObjectArray){\n wordObj.piglatinword = wordFilter(wordObj.wordTidied)\n}\nreturn wordObjectArray\n}",
"function replace_words(str, word1, word2) {\n\n return str.replace(word1, word2);\n \n}",
"function replaceWords(input){\n\t\n\tvar word... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
MakeGeomSolCurve: make the three.js geometry for the solution curve. Note that its contents will be updated during the animation. | function MakeGeomSolCurve ()
{
var positions = new Float32Array (3 * _nMaxPoints);
var geometry = new THREE.BufferGeometry();
geometry.setAttribute ('position', new THREE.BufferAttribute (positions, 3));
geometry.setDrawRange (0, 0);
const material = new THREE.LineBasicMaterial( { color: _CurveCol... | [
"function ComputeCurve ()\n {\n // only if we have at least three points... otherwise the solution is total garbage\n if (pointList.length > numDegrees)\n {\n var X = [];\n var Y = [];\n\n for (var i = 0; i < pointList.length; i++)\n {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Creates a TelemetryPolicy object. | create(nextPolicy, options) {
return new TelemetryPolicy(nextPolicy, options, this.telemetryString);
} | [
"function TelemetryPolicy(nextPolicy, options, telemetry) {\n var _this = _super.call(this, nextPolicy, options) || this;\n _this.telemetry = telemetry;\n return _this;\n }",
"function TelemetryPolicyFactory(telemetry) {\n var userAgentInfo = [];\n {\n if (telemetr... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
| intersectSphere:boolean returns if intersecting or not | | a:object sphere 1 with radius, x, y, and z | b:object sphere 2 with radius, x, y, and z | | Check if two sphere are intersecting | in 3D space. | static intersectSphere(a, b) {
let distance = Math.sqrt(
(a.x - b.x) * (a.x - b.x) +
(a.y - b.y) * (a.y - b.y) +
(a.z - b.z) * (a.z - b.z)
);
return distance < (a.radius + b.radius);
} | [
"function intersect_Sphere_Sphere (pSphereA, pSphereB) {\n var rx = pSphereA.v3fCenter.X - pSphereB.v3fCenter.X;\n var ry = pSphereA.v3fCenter.Y - pSphereB.v3fCenter.Y;\n var rz = pSphereA.v3fCenter.Z - pSphereB.v3fCenter.Z;\n return (rx * rx + ry * ry + rz * rz) < (pSphereA.fRadius + pSphereB.fRadius);... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Selector Switch 3 Position 2 Extends mxShape. | function mxShapeElectricalSelectorSwitch3Position2(bounds, fill, stroke, strokewidth)
{
mxShape.call(this);
this.bounds = bounds;
this.fill = fill;
this.stroke = stroke;
this.strokewidth = (strokewidth != null) ? strokewidth : 1;
} | [
"function mxShapeElectricalThreePositionSwitch2(bounds, fill, stroke, strokewidth)\n{\n\tmxShape.call(this);\n\tthis.bounds = bounds;\n\tthis.fill = fill;\n\tthis.stroke = stroke;\n\tthis.strokewidth = (strokewidth != null) ? strokewidth : 1;\n}",
"function mxShapeElectricalSelectorSwitch4Position2(bounds, fill, ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
oBar (Bar) contentLeft [oVisibleLeftButton, oInvisibleLeftButton] | function givenBarWithButtons() {
this.oVisibleLeftButton = new Button({id: "VisibleLeftButton", visible: true, text: "VisibleLeft"});
this.oInvisibleLeftButton = new Button({id: "InvisibleLeftButton", visible: false, text: "InvisibleLeft"});
this.oBar = new Bar({
id: "bar",
contentLeft: [this.oVisibleLeftBu... | [
"toggleLeftBar() {\n this.openBar = !this.openBar;\n }",
"addLeftBar() {\n \n this.page.addBar(\"fixed\", 40, \"leftbar-menu\");\n this.page.addBar(\"splitter\", 300, \"leftbar\");\n }",
"get buttonsLeft() {\n return this.buttons.filter((button) => {\n return (\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
createMaturitySheet() function end The function below consolidates the average results into an array, and creates an html column chart displaying those average values | function createAveragesChart() {
//collect data
var activeSpreadsheet = SpreadsheetApp.getActive();
var resultsSheetName = 'theResults';
var theResultsSheet = activeSpreadsheet.getSheetByName(resultsSheetName);
var inputMarker = activeSpreadsheet.getRangeByName('templateInputs'); //a range has been named on t... | [
"function PopulateExcelSpreadsheet( Sheet )\n{\n // Assume failure\n var RC = false;\n\n Sheet.Cells( 1, 1 ).Value = \"Total Samples\";\n Sheet.Cells( 1, 1 ).Font.Bold = true;\n Sheet.Cells( 1, 1 ).ColumnWidth = 14;\n Sheet.Cells( 1, 2 ).Value = gSamples;\n\n Sheet.Cells( 2, 1 ).Value = \"Power (dBm)\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
(void)transformM11:(float)m11 m12:(float)m12 m21:(float)m21 m22:(float)m2 dx:(float)dx dy:(float)dy; | transform(m11, m12, m21, m22, dx, dy) {
CanvasManager.transform(findNodeHandle(this), m11, m12, m21, m22, dx, dy)
} | [
"function matrix2DTransform(m11, m12, m21, m22, dx, dy) {\n return [m11, m12, 0,\n m21, m22, 0,\n dx, dy, 1];\n}",
"setTransform(m11, m12, m21, m22, dx, dy) {\n CanvasManager.setTransform(findNodeHandle(this), m11, m12, m21, m22, dx, dy)\n }",
"transform(m) {\n const x = m[0]... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Add a talent to saved talents | function addSavedTalent(talent) {
savedTalents.push(talent);
} | [
"async postTalent(talent) {\n return await db.execQuery(_query_strings.QUERY_STRINGS.INSERT_TALENT, [talent.first_name, talent.last_name]);\n }",
"function saveTalent(talent, username) {\n return $http.post('/talent/save', {\n username: username,\n name: talent.name,\n classId: talent.classI... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Extracts an archive from the provided archive and stores it under the path specified. The wwwRoot parameter should be set to help this library find its resources. The result callback only contains any possible error that happend during the operation. | function extractToDirectory(folder, archive, wwwRoot, callback) {
var fn = loadFunction(wwwRoot, 'ExtractToDirectory');
fn({
folder: folder,
archive: archive
}, function (error, errorMessage) {
callback(error || errorMessage ? new Error(errorMessage) : n... | [
"function createFromDirectory(folder, archive, wwwRoot, callback) {\r\n var fn = loadFunction(wwwRoot, 'CreateFromDirectory');\r\n fn({\r\n folder: folder,\r\n archive: archive\r\n }, function (error, errorMessage) {\r\n callback(error || errorMessage ? new Erro... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
copy a symbol and apply colors | function copyAndColor(symbol, strokeColor, fillColor) {
if (symbol.type == 'cim') {
// clone symbol
var newSymbol = symbol.clone();
cimSymbolUtils.applyCIMSymbolColor(newSymbol, fillColor);
newSymbol.data.symbol.symbolLayers[0].markerGraphics[0].symbol.symbolLayers[0].color = strokeColor;
... | [
"function copy_color(){\r\n // I maeke all these because i can't \r\n // copy thext from span \r\n // so I create a input and make value = color hexa code\r\n // than copy it form the input \r\n // last think I remove the input from the window\r\n let text_created = document.createElement(\"textar... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Applies filter on comment array and sorts it based on existing sort settings. If a filter is already applied, the comment list is rebuilt based on the caches and the filter is reapplied on the entire new comments. | setCommentFilter(commentFilter) {
if (this.state.commentFilter.filterName === null) {
// no filter on, store cached comments so when filter is off again original comments can be restored
const cachedComments = Immutable.List(this.state.comments);
this.setState({
... | [
"async sortAndRebuild(){\n try{\n this._comments = await this._getComments();\n if(this._comments && this._comments.length > 0){\n this._comments.sort((comment1, comment2) => {return comment2.getLikes() - comment1.getLikes()});\n }\n this._build(this... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
So this here might seem complicated at first glace but it's simple when you know what is written here This function checks if the user as scrolled under a specific height of the page. In this case the funtion checks if the user has scrolled over the content 01 which is the first bit of text in the page. Then if the use... | function check_page_title_status() {
/*
First we check if the user scroll from top
is the same as the offset from the first
content which in our case is the same as
the window height and then if it's higher
we make the title fixed to the window.
*/
if (window_scroll <= window_height) {
titl... | [
"function titleScroll() {\n\t\tvar scrolled = $(window).scrollTop();\n\t\t$('#title-head').css('top', (scrolled/3) +'px');\n\t}",
"function scrollDetection(animatedTitle,lastTitle,nextTitle,currentScroll){\n\n var paraScrollDistance = animatedTitle.paraScrollDistance;\n // console.log(currentScroll);\n v... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
course object for want to take courses | function wantTakeCourse(id, sid, cid) {
this.id = id;
this.sid = sid;
this.cid = cid;
} | [
"function Course() {\n // Name of the course\n this.title = null;\n\n // Preferences for the course, in terms of removed tabs\n this.removedTabs = new Array();\n \n // Preferences for the course, in terms of tab order\n this.tabOrder = new Array();\n\n // Key under which this course can be found i... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
method to delete a reaction. Callback function for the route DELETE /api/thoughts/:thoughtId/reactions/:reactionID | deleteReaction({params}, res){
// Mongoose .findONeAndUpdate() method to find thought by id and delete reaction by id. It will delete data from an array using the $pull operation. The result will retrieve the first thought with the reaction's document not displayed based on reactionId
Thought.findOneAnd... | [
"deleteReaction({ params }, res) {\n Thought.findOneAndUpdate(\n { _id: params.thoughtId },\n { $pull: { reactions: { reactionId: params.reactionId } } },\n { new: true }\n )\n .then(thoughtData => {\n if (!thoughtData) {\n res.status(404).json({ message: 'No thought found with t... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
function called on success call back of fetch view config | function onFetchViewConfigAllComplete(viewConfig) {
var functionName = "onFetchViewConfigAllComplete";
var viewJsonobj = new Object();
try {
if (viewConfig.length > 0) {
for (var record = 0; record < viewConfig.length; record++) {
if (_isSubGrid || _isWebResource) {
... | [
"function fillResultView(config, callback)\n {\n //Get and set the display format\n $.PercPathService.getDisplayFormat(function(status, displayFormat)\n {\n config.displayFormat = displayFormat;\n config.searchCriteria.SearchCriteria.formatId = d... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
TESTING PAYLOAD SIZE Calculating a PubNub Message Payload Size. | function calculate_payload_size( channel, message ) {
return encodeURIComponent(
channel + JSON.stringify(message)
).length + 100;
} | [
"calculatePayloadSize (channel, message) {\n return encodeURIComponent(\n channel + JSON.stringify(message)\n ).length + 100\n }",
"function getLen(messageType) {\n\tlet length = 6;\n\tif (messageType === 1) length = 14;\n\tif (messageType === 2) length = 19;\n\tif (messageType === 3) length = 115;\n\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PART 5 Write a function called pipeline(). it should take three inputs: (1) a starting value, (2) a function, and (3) another function. it should use functions (2) and (3) on the starting value, one after the other, and return a new value tha... | function pipeline (input, fun1, fun2) {
return fun2(fun1(input))
} | [
"function pipeline(value, function1, function2){\n return function2(function1(value));\n }",
"function pipeline (num, function1, function2) {\n var newVal = function2(function1(num))\n return newVal\n}",
"function pipeline (val, func1, func2) {\n var result = func1(val)\n var secondResult = func2(result... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Draw a line between two elements with two dots at the ends | function drawLine(_1, _2, jq) {
var el1 = getElement(_1, jq),
el2 = getElement(_2, jq),
x1 = el1.offset().left + el1.width() + 20 + 1, // + left padding + border width
x2 = el2.offset().left,
y1 = el1.offset().top + 20, // top padding + half of the height
... | [
"static DrawDottedLines() {}",
"function drawLine(_1, _2, jq){\n var el1 = getElement(_1, jq),\n el2 = getElement(_2, jq),\n x1 = el1.offset().left + el1.width() + 20 + 1, // + left padding + border width\n x2 = el2.offset().left,\n y1 = el1.offset().top + 20, // top padding + half ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Callback when the taskList changes | function updateTaskList(key, ref, old, nw, page) {
const tasks = page.getViewById("tasks");
tasks.items = db.tasks();
} | [
"updateTaskList() {\n if (this.taskList.selectedTask) {\n this.taskList.updateSelectedTaskSessionCount();\n this.taskList.updateStorage();\n }\n }",
"onListContentsChanged() {\n this.generateListContents();\n this.saveTasksData();\n }",
"handleTaskListChange(tasks) {\n this.saveTasks(... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Method used to initialize item, by populating all empty or undefined fields with default values | initItem(item) {
item = super.initItem(item);
if (!item.company) item.company = '';
if (!item.date) item.date = moment().unix();
if (!item.period) item.period = moment().unix();
if (!item.type) item.type = 'kudir';
if (!item.email) item.email = "";
return item;
... | [
"initItem(item) {\n item = super.initItem(item);\n if (!item.date) item.date = moment().unix();\n if (!item.place) item.place = {};\n if (!item.user) item.user = {};\n if (!item.images) item.images = [];\n if (!item.products) item.products = [];\n if (!item.purchaseD... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Look up the field by its ID attribute and change the class property to "mandatoryLabel". | function makeFieldsMandatory(arrayOfFields)
{
for (var i=0; i<arrayOfFields.length; i++)
{
obj = getObj(arrayOfFields[i]);
obj.className="mandatoryLabel"
}
} | [
"function makeFieldNonMandatory(fieldIDAttribute) \n\t{\n\t obj = getObj(fieldIDAttribute);\n\t obj.className=\"\"\n\t}",
"function makeFieldMandatory(_fieldPath){\n\n var _row = $(_fieldPath + \"-row\");\n\n //add asterisk to the label\n if(exist(_row)){\n _row.select('div.label').each(function(_lbl){\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Removes the bitcoind chain if full is true and optionally resync it from Casa's aws server. | async function resyncChain(full, syncFromAWS) {
try {
resetSystemStatus();
systemStatus.full = !!full;
systemStatus.resync = true;
systemStatus.error = false;
systemStatus.details = 'stopping lnd...';
await dockerComposeLogic.dockerComposeStop({service: constants.SERVICES.LND});
systemS... | [
"clearBlockchainTransactions({ chain }) {\n // start at 1 to avoid the genesis block\n for (let i = 1; i < chain.length; i++) {\n const block = chain[i]\n\n for (let transaction of block.data) {\n if (this.transactionMap[transaction.id]) {\n delete this.transactionMap[transaction.id]... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Determine whether the given properties match those of a `DynamoDBEventProperty` | function CfnFunction_DynamoDBEventPropertyValidator(properties) {
if (!cdk.canInspect(properties)) {
return cdk.VALIDATION_SUCCESS;
}
const errors = new cdk.ValidationResults();
errors.collect(cdk.propertyValidator('batchSize', cdk.validateNumber)(properties.batchSize));
errors.collect(cdk.p... | [
"function CfnFunction_SQSEventPropertyValidator(properties) {\n if (!cdk.canInspect(properties)) {\n return cdk.VALIDATION_SUCCESS;\n }\n const errors = new cdk.ValidationResults();\n if (typeof properties !== 'object') {\n errors.collect(new cdk.ValidationResult('Expected an object, but r... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
set laptop values to selected laptop | function setLaptopValues(selectedLaptop) {
priceElement.innerText = selectedLaptop.price + " KR";
nameElement.innerText = selectedLaptop.title;
descriptionElement.innerText = selectedLaptop.description;
imageElement.src = `https://noroff-komputer-store-api.herokuapp.com/${selectedLaptop.image}`;
} | [
"function updateSelected() {\n selected = Number.parseInt(elements.laptopSelect.value, 10);\n updateUI();\n }",
"setPlatformOptionValues() {\n this.$platformSelector.find('option').each((index, el) => {\n $(el).prop('value', this.isPageviews() ? $(el).data('value') : $(el).data('ud-value'));\n }... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Function to mark Sanity Check Process as Complete | function markSanityCheckProcessAsCompleted() {
$('#sanityStatus').text('Completed');
$('.progress .circle:nth-of-type(' + (1) + ')').removeClass('pending').addClass('done');
$('.progress .circle:nth-of-type(' + (1) + ') .label').html('✔');
} | [
"function markValidationProcessAsCompleted() {\r\n\r\n $('#validationStatus').text('Completed');\r\n $('.progress .circle:nth-of-type(' + (2) + ')').removeClass('pending').addClass('done');\r\n $('.progress .circle:nth-of-type(' + (2) + ') .label').html('✔');\r\n\r\n}",
"function checkCompleteStat... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
================== ControlType property ================== | function GetControlType()
{
return m_type;
} | [
"get controlType() {\n\t\treturn this.nativeElement ? this.nativeElement.controlType : undefined;\n\t}",
"function GetControlType(sControl) {\n var eControlType = g_eControlType.UNDEFINED;\n var sControlType = sControl.type;\n var sControlTagName = sControl.tagName;\n if (sControlTagName === 'INPUT') ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Loads Browserscope's cumulative results table. | function load() {
var me = ui.browserscope,
cont = me.container,
timers = cache.timers;
function onComplete(response) {
clearTimeout(timers.load);
me.render(response);
}
cache.lastAction = 'load';
clearTimeout(timers.load);
timers.load = setTimeout(onComplete, me.RE... | [
"function showResults(){\n var script = document.createElement('script')\n script.src = \"http://www.browserscope.org/user/tests/table/\" + ct_test_id + \"?o=js&v=top-d&highlight=1&w=\" + ( $(window).width() - 50 );\n\n document.body.appendChild(script)\n }",
"function showResults() {\n\tv... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
get our rectangle data with color index 'c' for colorList | function getRectangleData(c) {
var points = [];
var colors = [];
var normals = [];
var j = c;
// Push the vertices into points
// points are conceived as if we were directly facing that side
// e.g. for the front face, we are facing -z
// for the back face, we are facing z
// Right fac... | [
"function getColor(data, index){\n return data.color;\n }",
"function coloursList() {\n\n //the pointer.colIndex is incremented by 1\n //when the index reaches 3 it is reset back to 0\n pointer.colIndex ++;\n\n if(pointer.colIndex > 3){\n pointer.colIndex = 0... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Pure function. Returns: true if CapsLock key is known to be on false if known not to be on undefined if not known (when no keys have been pressed or the only the key pressed so far is Caps Lock) | function isCapsLockOn() {
return capsLockOn;
} | [
"function keyPress(e) {\n var charCode = getCharCode(e);\n if ( isLowerCaseAlphaKey(charCode) ) {\n capsLockOn = !!e.shiftKey;\n } else if ( isUpperCaseAlphaKey(charCode) ) {\n capsLockOn = !!!e.shiftKey;\n }\n return capsLockOn;\n }",
"function capsLockPressed(e) {\n return getCharCo... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Parse a tag (E.g. ``) with that type (start tag or end tag). | function parseTag(context, type, parent) {
// Tag open.
const start = getCursor(context);
const match = /^<\/?([a-z][^\t\r\n\f />]*)/i.exec(context.source);
const tag = match[1];
const ns = context.options.getNamespace(tag, parent);
advanceBy(context, match[0].length);
advanceSpaces(c... | [
"function parseTag(context, type, parent) {\n\t // Tag open.\n\t const start = getCursor(context);\n\t const match = /^<\\/?([a-z][^\\t\\r\\n\\f />]*)/i.exec(context.source);\n\t const tag = match[1];\n\t const ns = context.options.getNamespace(tag, parent);\n\t advanceBy(context, match[0].length)... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets the default subscriptions configuration from the current tenant. | getDefaultSubscriptionsFromCurrentTenant() {
return __awaiter(this, void 0, void 0, function* () {
return this.getDefaultSubscriptions(DefaultSubscriptionsContext.CURRENT_TENANT);
});
} | [
"getDefaultSubscriptionsFromCurrentTenant() {\n return tslib_1.__awaiter(this, void 0, void 0, function* () {\n return this.getDefaultSubscriptions(DefaultSubscriptionsContextTenant.CURRENT_TENANT);\n });\n }",
"getDefaultSubscriptionsEvaluatedFromParentTenant() {\n return tslib... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
saveForm() Creates a new roomUsage object using the information entered which is then stored to the list. It first checks if the inputs are valid, if so then a new observations will be created and stored. If not, then an error will pop up. | function saveForm()
{
let address = addressRef.value.trim();
let roomNumber = roomNumberRef.value.trim();
let seatsUsed = Number(seatsUsedRef.value);
let seatsTotal = Number(seatsTotalRef.value);
let lightsOn = lightsClassRef.MaterialSwitch.inputElement_.checked;
let heatingCoolingOn =... | [
"function saveText()\r\n{\t\r\n\tif (formIsValid()) // only runs if form is valid - runs formIsValid function which checks if all inputs are valid\r\n\t{\r\n\t\t// create empty roomUsage instance\r\n\t\tlet roomUsage = new RoomUsage(); \r\n\t\t// initialise all properties of the RoomUsage instance\r\n\t\troomUsage.... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Condition with seven paramter | len7(pKey, oKey, cond, obj, param) {
if(validation.validKey(oKey, pKey)) {
var filteredObj = obj.map(function (val) {
if(cond === 'AND') {
if(val[`${pKey[0]}`] === param[`${pKey[0]}`]
&& val[`${pKey[1]}`] === param[`${pKey[1]}`]
... | [
"opcode7() {\n\n this.writeData(\n Number(this.getParameter(1) < this.getParameter(2)),\n this.position + 3);\n\n this.position += 4;\n }",
"function restParams4(...rest) {\n // console.log(rest);\n return rest[0] === \"first\" && rest[1] === \"second\" && rest[2] === \"third\"; // CHANGE M... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
draws all objects that are called on canvas | function drawAll() {
//refreshes canvas everyone to give the animation effect
ctx.clearRect(0, 0, canvas.width, canvas.height);
if (optionScreen) {
clickOption();
return;
}
//calling functions to draw objects
drawNet();
drawRectang... | [
"function draw() {\n\n\tfor (var i=0; i<objects.length; i++) {\n\t\tobjects[i].draw(context);\n\t}\n\tdetectCollisions();\n}",
"drawObjects() {\n for (let i = 0; i < this.objects.length; i++) {\n this.objects[i].draw();\n }\n }",
"draw() {\n for ( let o of this.objects ) {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
returns the array with the loaded images | function getLoadedImages() {
return images;
} | [
"function getImages(){\n return images;\n }",
"function get_img_arr() {\r\n\r\n\tvar w_bee = new Image();\r\n\tw_bee.src = \"/assets/bee.png\";\r\n\t\r\n\tvar w_ant = new Image();\r\n\tw_ant.src = \"/assetsant.png\";\r\n\r\n\tvar w_grasshopper = new Image();\r\n\tw_grasshopper.src = \"/assetsgra... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Called by "InitialLayoutCompleted" DiagramEvent listener, NOT directly by load()! | function loadDiagramProperties(e) {
// set Diagram.initialPosition, not Diagram.position, to handle initialization side-effects
var pos = diagram_array[this_architecture_rang-1].model.modelData.position;
if (pos) diagram_array[this_architecture_rang-1].initialPosition = go.Point.p... | [
"loadLayout(savedLayout) {\n this.setLayout(DockLayout.loadLayoutData(savedLayout, this.props, this._ref.offsetWidth, this._ref.offsetHeight));\n }",
"function loadLayout() {\n\n // reset old data\n label = [];\n backgroundColor = [];\n backgroundSolutionColor... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sort the tiles into ascending order | function sortTiles() {
var sortedTiles = sort(tileHTMLElements);
console.log('after sort:', sortedTiles);
repopulateTiles(sortedTiles);
} | [
"orderedTiles() {\n let domTiles = this.$('md-grid-tile').toArray();\n return this.get('tiles').sort((a, b) => {\n return domTiles.indexOf(a.get('element')) > domTiles.indexOf(b.get('element')) ? 1 : -1;\n });\n }",
"orderedTiles() {\n // Convert NodeList to native javascript array, to... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Stop Form Submission > On Required Attachments | function sjb_is_attachment( event ) {
var error_free = true;
$(".sjb-attachment").each(function () {
var element = $("#" + $(this).attr("id"));
var valid = element.hasClass("valid");
var is_required_class = element.hasClass("sjb-not-required"); ... | [
"preventSubmitIfUploading() {\n }",
"onFormSubmit(e) {\n\t\tif (App.Fields.MultiImage.currentFileUploads) {\n\t\t\te.preventDefault();\n\t\t\te.stopPropagation();\n\t\t\te.stopImmediatePropagation();\n\t\t\tbootbox.alert(app.vtranslate('JS_WAIT_FOR_FILE_UPLOAD'));\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
createTextRenderWindow creates a temporary image window to render text PARAMETERS: none RETURNS: imageWindow with title "temp_render" | function createTextRenderWindow() {
var P = new NewImage;
var width = allDimensions.framedImageWidth;
var height;
if (allDimensions.titleBarHeight > (allDimensions.bottomBarHeight / 3)) {
height = allDimensions.titleBarHeight;
}
else {
height = allDimensions.bottomBarHeight / 3;
}
... | [
"function closeTextRenderWindow(renderWindow) {\n if ((typeof(renderWindow) != \"undefined\") && !renderWindow.isNull)\n renderWindow.forceClose(); //forceClose to avoid dialog on closure\n}",
"function createWindow(){\n win2 = new BrowserWindow()\n win2.loadURL(url.format({\n pathname:path.... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
used for bonus requests during the initial deal, when we can get more than one bonus tile. | checkDealBonus() {
var bonus = this.tiles.map(v => parseInt(v)).filter(t => t >= Constants.PLAYTILES);
if (bonus.length > 0) {
this.bonus = this.bonus.concat(bonus);
this.tiles = this.tiles.map(v => parseInt(v)).filter(t => t < Constants.PLAYTILES);
this.log('requesting compensation for bonus ... | [
"processDealBonusTiles(tiles) {\n this.tiles = this.tiles.concat(tiles);\n this.checkDealBonus();\n }",
"addBonus() {\r\n if (this.bonus.length < 1) {\r\n const y = Math.floor(Math.random() * ((this.canvas.height - 50) + 1));\r\n let newBonus = new Bonus((this.canvas.width - 15... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
sum pair from linked list | function getSumPairs(list, sum) {
var result = [];
var mi=0, Mi = list.length-1;
while(mi<Mi) {
var ts = list[mi] + list[Mi];
if(sum == ts) {
result.push([list[mi], list[Mi]])
mi++; Mi--;
} else if(ts < sum) {
mi++;
} else {
Mi-... | [
"function sumList(node) {\n let current = node\n let total = 0\n while (current != null) {\n total += current.data\n current = current.next\n }\n return total\n}",
"calcSumPair(pair) {\n return Sheet.calcSum(Sheet.expandSumReference(\n pair[0].label,\n pai... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Simple mutation allows one to submit Feedback for a Question. All normal users can use this. | async submitFeedback(parent, args, ctx, info) {
const callingUserData = await checkAuth(ctx, {
type: USER_TYPE_STUDENT,
status: USER_STATUS_NORMAL,
flagExclude: USER_FLAG_DISALLOW_FEEDBACK_SUBMISSION,
action: "submitFeedback",
});
if (args.text && args.text.length > FEEDBACK_MAXIMUM... | [
"function postFeedback() {\n let params = new FormData(id(\"faq-form\"));\n fetch(API_BASE + \"feedback\", {method: \"POST\", body: params})\n .then(checkStatus)\n .then(resp => resp.text())\n .then((resp) => submitSuccessful(resp, \"faq\"))\n .catch(handleError);\n }",
"submitConfused(... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Method used to send file to box conversion | function send_file_to_conversion(info){
conversion.start(info)
.then(
request_resolved_handler,
request_failure_handler
);
} | [
"function sendFileMessage(message) {\n\n}",
"function onSendFileBtnClick() {\n app.external.pickSingleFile(onFilePicked, onFilePickError);\n }",
"function sendFile(id, option) {\n let fileReader = new FileReader();\n let files = document.getElementById(\"sendFile\").files; // Gets an array of our se... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Draws the contents of the given layer at the given coordinates | function draw_layer(layer, x, y) {
// Draw layer
if (layer.width > 0 && layer.height > 0) {
// Save and update alpha
var initial_alpha = context.globalAlpha;
context.globalAlpha *= layer.alpha / 255.0;
// Copy data
... | [
"function draw(){\n const tmpCoordinate = getStartCoordinate(coordinate, size);\n\n ctx.fillStyle = 'blue';\n ctx.fillRect(tmpCoordinate.x, tmpCoordinate.y, size.w, size.h);\n }",
"function draw_coordinates() {\n\n\t\t\t// Draw (x,y) coordinates over each tile.\n\t\t\tfor (var coordinates ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
precondition: both oldPath and newPath exist and are dirs. decreases: |files| Need to move every file/folder currently stored on readable to its new location on writable. | function copyDirContents(files) {
var file = files.shift();
if (!file) {
return cb();
}
var oldFile = path.resolve(oldPath, file);
var newFile = path.resolve(newPath, file);
//... | [
"function copyDirContents(files) {\n\t var file = files.shift();\n\t if (!file) {\n\t return cb();\n\t }\n\t var oldFile = path.resolve(oldPath, file);\n\t var newFile = path.resolve(newPath, file);... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
displays the update on the div for it to one decimal | function updateReport() {
$("#currentTotal").text(Math.floor(data.totalCurrent));
$("#cps").text((data.totalCPS).toFixed(1));
} | [
"updateDisplay () {\n document.querySelector('.calculator-display').innerHTML = this.data.currentValue\n }",
"function updateDisplay() {\n $('#win_Display').text(win)\n $('#lose_Display').text(loose)\n $('#numberToGet_Display').text(numberToGet)\n $('#total_Display').text(total)\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
handles mouse events over the lines | function handleMouseOverLines(lambdaList) {
canvas.addEventListener("mousemove", e => showLineNumberInBox(e, lambdaList));
canvas.addEventListener("mouseleave", unshowLineNumberInBox);
} | [
"function LI_lineSelect(event) {\r\n if (LI_state == \"neutral\") { //Will display the information of said line\r\n LI_currentLine = LI_lineContainer[this.name];\r\n createGraph(LI_graphs, LI_currentLine, LI_boundary_tlx,\r\n LI_boundary_tly);\r\n windowContainer.addChild(LI_gra... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
props > photos, currentPhoto, transform | render() {
const photoList = this.props.photos;
const currentPhoto = this.props.currentPhoto;
const transform = this.props.transform;
const currentPhotoIndex = photoList.indexOf(currentPhoto);
//if currentPhotoIndex is greater than 3, will need extra photos coming into view
if (currentPhotoIndex... | [
"function currentPhotoFunc(photo){\n //////photo is the whole photo object\n self.currentPhoto = photo;\n }",
"isActivePhoto(index) {\n return this.photoIndex === index;\n }",
"applyCurrentTransform () {\n this.tempPosition.set(this.position);\n this.tempOrientation = this.orientation;\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This extracts the original function if available. See `markFunctionWrapped` for more information. | function getOriginalFunction(func) {
return func.__sentry_original__;
} | [
"function getOriginalFunction(func) {\n return func.__sentry_original__;\n }",
"unwrap() {\n if (this.wrapper !== null) {\n this.wrapper = this.originalFunc;\n }\n }",
"function markFunctionWrapped(wrapped, original) {\n\t const proto = original.prototype || {};\n\t wrapped.pro... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |