query stringlengths 9 34k | document stringlengths 8 5.39M | negatives listlengths 19 20 | metadata dict |
|---|---|---|---|
Required options: source: must be a or similar element that canvas2d can use in a drawImage call Optional: size: override size from package.json interval: override avatar capture interval, instead of value from from package.json onAvatar: a callback function which is provided one argument, a Buffer containing image/jpe... | constructor({ source, size = config.avatarSize, interval = config.avatarInterval, tracking = 'tiny', onAvatar }) {
this.source = source
this.size = size
this.interval = Math.round(parseDuration(interval))
this.onAvatar = onAvatar
this.tracking = tracking
this.trackingZoom = 1.0
this.tra... | [
"static BuildGenericAvatar() {}",
"constructor(canvas, path){\n this.canvas = canvas;\n this.ctx = canvas.getContext('2d');\n var img = new Image();\n img.onload = e =>{\n this.renderInitial();\n };\n this.img = img;\n img.src = path;\n }",
"constructor(option) {\r\n\t\tthis.ctx = opt... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
grab the current survey | function getCurrentSurvey() {
return $.get(config.server + "/current-question");
} | [
"function showSurvey(surveyId) {\n const docRef = db.collection(\"surveys\").doc(surveyId);\n docRef.get().then((doc) => {\n if (doc.exists) {\n openSurvey = doc.data();\n openSurvey.id = surveyId;\n openSurvey.answered = answered(doc.data().answeredBy);\n ap... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Flushes all items from the cache. | flush () {
this.cacheStore = {}
} | [
"purge() {\n\t\tthis.clear();\n\t\tthis.stateStorage.update(Watch.constants.WATCH_STORE, []);\n\t\tchannel.appendLocalisedInfo('purged_all_watchers');\n\t}",
"function resetAll() {\n exports.results.forEach((cache) => cache.reset());\n}",
"clearCache() {\n if (!this.dataProvider) {\n return;\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Register a callback that executes when the selection changes. This event will also be raised when an active selection is destroyed the selection parameter in the callback will be null in this case. The underlying event emitter event name is 'selectionchange'. | onSelectionChange(cb) {
this.on('selection-change', cb)
} | [
"onSelectionChange(func){ return this.eventSelectionChange.register(func); }",
"onSelectionEdited(func){ return this.eventSelectionEdited.register(func); }",
"selectionSetDidChange() {}",
"function initSelection() {\n canvas.on({\n \"selection:created\": function __listenersSelectionCreated() {\n glo... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
function is called when remote track (audio or video) is removed | function onRemoteTrackRemove(track) {
console.log(`INFO: Track removed!${track}`);
const participant = track.getParticipantId();
if (participant in changeList) {
var remoteVideo = "#remoteVideo" +changeList[participant];
var remoteAudio = "#remoteAudio" +changeList[participant];
switch (ch... | [
"function onRemoveTrack(data) {\n\tif (\"Error\" in data) {\n\t\tonError(data.Error);\n\t} else {\n\t\tclearError();\n\t}\n}",
"function handleImportTrackRemove() {\n //remove the track from the map\n theInterface.emit('ui:removeTrack');\n }",
"function removeSong(track) {\n socket.emit(... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
insert du lieu vao trong bang task: noi dung task date: ngay lam viec process: phan loai task | insert(task, date, process) {
let sql = `
INSERT INTO tasks(task, date, process)
VALUES (?, ?, ?)
`;
return this.dao.run(sql, [task, date, process]);
} | [
"insert(user,content,completed,callback){\n this.connection.query(\"insert into task (userTask,taskText,completed) values ('\"+user+\"','\"+content+\"','\"+completed+\"')\", function(err,task){\n if(err){\n callback(err);\n }else{\n callback(null,task);\n }\n });\n }",
"async i... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Function: audioPlayerUpdate Initializes the jPlayer audio player Parameters: event The jPlayer time event sent from the audio player Dependencies: ; ; Change Log: 2013.02.22ALP Initial version broke out from initAudioPlayer(). | function audioPlayerUpdate(event) {
var time=event.jPlayer.status.currentTime;
// This if ensures that the update event doesn't fire right after the learner presses the replay button, and so the first item isn't displayed right away again because it thinks it is later than it is.
if (!(shell.caption.currPosition == ... | [
"function initAudioPlayer() {\n\t// Set up the audio player itself\n\t//console.log(\"setting up audio player\");\n\t$(shell.audio.playerDiv).jPlayer({\n\t\tready: function(){\n\t\t\t//console.log(\"audio player ready\");\n\t\t\t// Call this AFTER the audio player is ready\n\t\t\tloadPageAudio();\n\t\t},\n\t\tswfPa... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Decode the modified utf7 representation used to encode mailbox names to lovely unicode. Notes: '&' enters mutf7 mode, '' exits it (and exiting is required!), but '&' encodes a '&' rather than a zerolength string. ',' is used instead of '/' for the base64 encoding Learn all about it at: | function decodeModifiedUtf7(encoded) {
return encoded.replace(
RE_MUTF7,
function replacer(fullMatch, b64data) {
// &- encodes &
if (!b64data.length)
return '&';
// we use a funky base64 where ',' is used instead of '/'...
b64data = b64data.replace(RE_COMMA, '/');
// The ... | [
"function _hexDecode(data) {\n var j\n , hexes = data.match(/.{1,4}/g) || []\n , back = \"\"\n ;\n\n for (j = 0; j < hexes.length; j++) {\n back += String.fromCharCode(parseInt(hexes[j], 16));\n }\n\n return back;\n }",
"function decode(message){\n var normAlph = ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
I reset the timeline to its default CSS configuration. | function resetTimelineView() {
ViewVideo.OverlayTimeline.css('height', '');
ViewVideo.OverlayTimeline.children('.timelineElement').css({
top: '',
right: '',
bottom: '',
height: ''
});
} | [
"function resetTimelines() {\n // clear `currentTimeline`\n if (V.Navigation) {\n V.Navigation.currentTimeline = null;\n }\n\n // get all `V.Timelines` keys\n var keys = Object.keys(V.Timelines);\n\n for (var i = 0, iMax = keys.length; i < iMax; i++) {\n // check that this key represents... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
returns the next task, similar to getNextTask, without removing it from the queue | peekNextTask() {
let highesPriority = this.taskQueues.length - 1;
for (let i = highesPriority; i >= 0; i--) {
let queue = this.taskQueues[i];
if (!queue) {
continue;
}
let taskIndex = lodash_1.findIndex(queue, t => t.isRunnable);
... | [
"getNextTask() {\n let highestPriority = this.taskQueues.length - 1;\n for (let i = highestPriority; i >= 0; i--) {\n // if the queue exists\n let queue = this.taskQueues[i];\n if (!queue) {\n continue;\n }\n // find a runable task\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
http(String method, String url, Array headers (optional), TypedArray data (optional), Function callback (optional)); | function http(method, url) {
const args = Array.prototype.slice.call(arguments, http.length);
const fn = args.pop();
const headers = args.length > 0 && Array.isArray(args[0]) ? args[0] : [];
const data = args.length > 0 && !Array.isArray(args[args.length-1]) ? args[args.length-1] : null;
c... | [
"function httpGet(url, callback) {\n var xmlHttp = new XMLHttpRequest();\n xmlHttp.onreadystatechange = function() {\n if (xmlHttp.readyState == 4 && xmlHttp.status == 200) {\n callback(JSON.parse(xmlHttp.responseText));\n }\n }\n\n xmlHttp.open(\"GET\", url, true); // true for ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets up the add shortlink dialog. | function setupAddDialog() {
const dialog = new MDCDialog(document.getElementById('add-dialog'));
document.getElementById('add-button').addEventListener('click', () => {
dialog.open();
});
const linkTextfield =
new MDCTextField(document.getElementById('shortlink-textfield'));
const resultTextField ... | [
"function onCreateLink() {\n var selection = window.getSelection();\n var inLink = nodeIsInLink(selection.anchorNode);\n if (!isInNode(selection.anchorNode, \"popuptext\") || selection.isCollapsed && !inLink) {\n window.alert(\"To create a link to another page, first select a phrase in the text.\");... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
inserisci i dati nei campi | function inserisci(data){
id.value = data[0]._id
name.value = data[0].regione_sociale
indirizzo.value = data[0].indirizzo
cap.value = data[0].cap
località.value = data[0].località
provincia.value = data[0].provincia
nazionalità.value = data[0].nazionalità
cod_fiscale.value = data[0].cod_... | [
"async criar() {\n this.validar(true);\n const resultado = await TabelaProduto.inserir({\n titulo : this.titulo,\n preco: this.preco,\n estoque : this.estoque,\n fornecedor : this.fornecedor\n });\n this.id = resultado.id;\n this.dataCri... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Adds form elements listeners. | function addFormListeners() {
/**
* Collection of form elements.
*
* @private
* @property forms
* @type Array
* @default null
... | [
"#registerEventListeners() {\n this.#addOnFocusEventListener();\n this.#addOnHelpIconClickEventListener();\n }",
"function addElementListeners() {\n addDarkModeListener();\n addColorSchemeListener();\n addResizeListener();\n addCreateNoteListener();\n addDeleteNoteListener();\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns the update type (minor or major) | get updateType() {
updateType = new elementslib.ID(this._controller.window.document, "updateType");
return updateType.getNode().getAttribute("severity");
} | [
"getServerVersion() {\n if(!_.isUndefined(this.nodeInfo) && !_.isUndefined(this.nodeInfo.server)\n && !_.isUndefined(this.nodeInfo.server.version)) {\n return this.nodeInfo.server.version;\n }\n }",
"get serverVersion() {\n\t\tif (!this._devMode) console.log(\"Implement to override the default se... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Constructs a new CompareCommitsFiles. | constructor() {
CompareCommitsFiles.initialize(this);
} | [
"function CompareCommitsFiles() {\n _classCallCheck(this, CompareCommitsFiles);\n\n CompareCommitsFiles.initialize(this);\n }",
"constructor() { \n \n RepoDiff.initialize(this);\n }",
"function RepoCommit() {\n _classCallCheck(this, RepoCommit);\n\n RepoCommit.initialize(this);\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This function hides the next button, pulls the questions and answers from our object and drops them on the page, creates eventListeners for the buttons, calls the rightAnswer and wrongAnswer functions depending on the answer, and calls gameOver function if the currentQuestionIndex gets too high | function setNextQuestion() {
nextButton.classList.add("hide")
emptyDivEl.innerHTML = ""
if (currentQuestionIndex === 0) {
questionElement.innerText = questions[0].question;
btn1El.innerText = questions[0].answers[0].text;
btn1El.addEventListener("click" , rightAnswer)... | [
"function nextQuestion() {\n // clear out divs (image and win/loss/outoftime)\n console.log(questionIndex + \"entering\");\n\n questionIndex++;\n clearDivs();\n console.log(questionIndex + \"after\");\n asking();\n }",
"function nextQuestion(){\n deleteButton(button... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Initialize local variables and subscribe to transaction events. | function init() {
history = [];
allTransactionsLoaded = false;
account = StellarNetwork.remote.account(session.get('address'));
account.on('transaction', function(data) {
var transaction = {
tx: data.transaction,
meta: data.meta
};
history.unshift(transaction);
... | [
"function initializeSubmitTransactionEventListener() {\n $(classSelectors.transactionWrapper).on('click', classSelectors.submitTransactionButton, async function() {\n const type = simulationView.getTransactionType(this);\n const transactionAmount = simulationView.getTransactionAmount(this);\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
get the photo before anything is rendered | componentDidMount() {
this.getphoto();
} | [
"imageLoaded(){}",
"function ongetImageUrlQuerySucceeded() {\n var serverrelativeurl = this.parentWeb.get_serverRelativeUrl();\n var imagepath = this.targetFile.get_serverRelativeUrl();\n var filename = this.targetFile.get_name();\n if (serverrelativeurl && filename && imagepath) {\n appData.Im... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Function to get all rows on board's X axis | function rowsX (board) {
var rows = []
for (var y = 0; y < 4; y++) {
for (var z = 0; z < 4; z++) {
var row = []
for (var x = 0; x < 4; x++) {
row.push(board[z][x][y])
}
rows.push(row)
}
}
return rows
} | [
"function horizontalChart() {\r\n var row = '';\r\n for (var i = 0; i < arguments.length; i++) {\r\n for (var j = 0; j < arguments[i]; j++) {\r\n row += '*';\r\n }\r\n row += '\\n'\r\n }\r\n return row;\r\n}",
"function makeXOGrid(rows, columns) {\n var grid = [], co... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Exercise 1. d)MapReduce (15 points) Implement a function mapreduce (f, a, seed) which maps all elements of the array a through the function f and then returns a single value computed by adding all mapped array elements together with the provided seed. The seed is an optional parameter, which defaults to the empty strin... | function mapReduce(f, a, seed) {
for (var i=0;i<a.length;i++){
if (typeof a[i] != "string"){
a[i] = a[i].toString()
}
a[i]=f(a[i]);
}
for (var i=1;i<a.length;i++){
if (typeof seed != "undefined"){
for (i=0;i<a.length;i++){
seed = seed + f(a[i]);
}
return seed;
}
else {
if (typeof a[i... | [
"function reducer2(a, e) {\n var summ = 0;\n if (typeof a == \"string\") { // this handles the initial case where the first element is used\n summ = a.length; // as the starting value.\n }\n else {\n summ = a;\n }\n return summ + countLetters(e);\n}",
"function mean_with_red... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Place '' when item doesn't has any value! It will only work on tables which has 'detailstable' class | function placeEmptyPlaceholder() {
$('.details-table td').each(function () {
if ($(this).text() == '' || $(this).text() == null || $(this).text() == 'None' || $(this).text() == 'none') {
$(this).text('-');
}
});
} | [
"function showNoData(tableData, divEle, colspanNo) {\n tableData += '<td align=\"center\" colspan=\"' + colspanNo + '\"> No data to display </td>';\n tableData += '</tbody></table>';\n $('#' + divEle).html(tableData);\n }",
"renderNoStudentsInfo() {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Return a promise for a Cassandra client. Optionally `opts.keyspace` and `opts.table` can be provided to initialize a keyspace and table for testing. The caller should provide neither option, or both. | function makeClient(t, opts) {
const cassOpts = Object.assign({}, defaultOptions, {
keyspace: opts && opts.keyspace,
});
return maybeInitialize(opts).then(() => {
const client = new cassandra.Client(cassOpts);
t.on('end', () => {
client.shutdown();
});
return client;
});
} | [
"function CassandraStore(options) {\n Store.call(this)\n\n options = (options || {})\n\n const clientOptions = Object.assign({\n contactPoints: ['127.0.0.1'],\n authProvider: new PlainTextAuthProvider(\n 'cassandra', 'cassandra'\n ),\n queryOptions: { prepare: true }\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
this option exists in selectCtrl option collections? true yes, false no. | function optionExists(selectCtrl, optionCaption) {
if (selectCtrl == null) {
alert("[optionExists]select control is null");
return false;
}
if (optionCaption == null) {
alert("[optionExists]option text is null");
return false;
}
var ops = selectCtrl.options;
for ( var i = 0; i < ops.length; i++) {
if... | [
"function hasOptions() {\n if (typeof currMsg.opt == 'undefined' || currMsg.opt.length == 0) {\n return false;\n }\n return true;\n}",
"hideOptionSelector(option) {\n if (option && Object.keys(option).length) {\n return this.settings.hide_selector_enable\n ? this.totalOptionVa... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Overwrite the canvas with the current fill color. | function resetCanvas() {
cxt.fillStyle = localStorage.fillColor;
cxt.fillRect(0, 0, canvas.width, canvas.height);
} | [
"fill(colour) {\r\n this.ctx.fillStyle = colour;\r\n this.ctx.fillRect(0, 0, this.width, this.height);\r\n }",
"function changeColor(cord)\n{\n // set fillStyle to Blue\n context2D.fillStyle = \"Blue\";\n // fill clicked cell \n context2D.fillRect(cord[0] * canvas.width / 8, cord[1] * canvas.he... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
// clone the row for duplicate | function copyRow(src) {
return Object.assign({}, src);
} | [
"function duplicateItem(row) {\n var newRow = copyRow(row.itemData);\n var items = getList().option(\"dataSource\"); //getDS; //.push(newcontact);\n var maxId = Math.max.apply(Math, items.map(function (o) { return o.id; }))\n newRow.id = maxId + 1;\n\n store.insert(newRow)\n .done(function () ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
when the page is hidden it stop the enemy spawning and moving | function handleVisibilityChange() {
if (document[hidden]==true) {
if(isHidden==false){
clearInterval(enemySpawningVar);
clearInterval(enemyMovingVar);
//clearInterval(enemyMoveInterval);
if(start==true){
isHidden=true;
}
}
}
//when the playey comes back to the game th... | [
"stopShooting() {\n this.shooting = false;\n this.sentAddShooterPacket = false;\n\n var msg = {\n type: \"RemoveShooter\",\n entityType: \"Player\",\n };\n\n game.getNetwork.sendMessage(JSON.stringify(msg));\n }",
"function enemyMoveHeight() {\n if(... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get target path points | function getTargetPoints(selectedItem) {
var points = [];
if(selectedItem.typename == 'PathItem' || selectedItem.typename == 'TextPath') {
for(i = 0; i < selectedItem.pathPoints.length; i++) {
if(selectedItem.pathPoints[i].selected === PathPointSelection.ANCHORPOINT) {
var reverse = points.length >... | [
"getPointOnPath(path, index, target = []) {\n const {positionSize} = this;\n if (index * positionSize >= path.length) {\n // loop\n index += 1 - path.length / positionSize;\n }\n const i = index * positionSize;\n target[0] = path[i];\n target[1] = path[i + 1];\n target[2] = (positionS... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get the current value of the end cursor on a connection, or `undefined` if the object has never been fetched. If no object by the given ID is known, or the object does not have a connection of the given name, then an error is thrown. Note that `null` is a valid end cursor and is distinct from `undefined`. | _getEndCursor(
objectId: Schema.ObjectId,
fieldname: Schema.Fieldname
): EndCursor | void {
const result: {|
+initialized: 0 | 1,
+endCursor: string | null,
|} | void = this._db
.prepare(
dedent`\
SELECT
last_update IS NOT NULL AS initialized,
... | [
"cursorIndex(){\n if (this.cursorContainer && this.cursorX && this.cursorY && !this.lockPosition){\n return this.cursorContainer.getIndex(this.cursorX,this.cursorY)\n }\n return null\n }",
"cursorContainer(){\n if (this.cursorEl && this.dataObject){\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
function sendAndUpdate(xhr, json) is a function that sends data to a servlet | function sendAndUpdate(xhr, json) {
xhr.setRequestHeader('Content-type', 'application/json; charset=utf-8');
xhr.send(json);
xhr.onreadystatechange = function () {
if(xhr.readyState == 4){
if(xhr.status == 200){
document.getElementById('input_box').innerHTML = "";
... | [
"function sendAndUpdate(xhr, json) {\n xhr.setRequestHeader('Content-type', 'application/json; charset=utf-8');\n xhr.send(json);\n xhr.onreadystatechange = function () {\n if(xhr.readyState == 4){\n if(xhr.status == 200){\n document.getElementById('input_box').innerHTM... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Function folders properties state changed This function handles all of the responses from the ajax queries | function folder_properties_stateChanged(){
if (xmlHttp.readyState==4){
if(xmlHttp.responseText!=""){
document.getElementById('dynamic_area').innerHTML = xmlHttp.responseText;
}
}
} | [
"onUpdateFolder() {\n this.store.query(\"folder\", {})\n .then((results) => {\n // Rebuild the tree\n this.send('buildTree', { folders: results });\n })\n .catch(() => {\n this.growl.error('Error', 'Erro... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
BeamColumnConnectionByPinsAndSteelPlates checkbox event handler | function OnBeamColumnConnectionByPinsAndSteelPlates_Change( e )
{
try
{
var newMeasuresOfEmergencyValue = Alloy.Globals.replaceCharAt( current_structural_elements_id * 13 + 1 , Alloy.Globals.ShedModeDamages["MEASURES_OF_EMERGENCY"] , $.widgetAppCheckBoxShedModeFormsDamagesMeasuresOfEmergencyBeamColu... | [
"function OnBeamColumnConnectionInSteelByCables_Change( e )\r\n{\r\n try\r\n {\r\n var newMeasuresOfEmergencyValue = Alloy.Globals.replaceCharAt( current_structural_elements_id * 13 + 2 , Alloy.Globals.ShedModeDamages[\"MEASURES_OF_EMERGENCY\"] , $.widgetAppCheckBoxShedModeFormsDamagesMeasuresOfEmergen... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns a players object with the values being number of cards held by each player | getPlayersCardNums(state) {
let players = (state || this).players, playerCardNums = {}
for (let i in players) {
if (players[i]) {
playerCardNums[i] = players[i].cards.length
}
else {
playerCardNums[i] = null
}
}
return playerCardNums
} | [
"_countPlayedUsers() {\n let played = 0\n let remaining = 0\n for (let i = 0; i < this.users.length; i++) {\n if (this.users[i].checked) played++\n if (this.users[i].left !== true) remaining++\n }\n\n return { played, remaining }\n }",
"function Player(cards) {\n this.cards = card... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Function to brighten or lighten the colours of the image | function brightenColours()
{
'use strict';
// Get the canvas, context, and image data
var canvas = document.getElementById("canvas");
var context = canvas.getContext("2d");
var imgData = context.getImageData(0, 0, canvas.width, canvas.height);
// Loop to modify the colours in the image data array
for(var i =... | [
"function redHue() {\n for (var pixel of image.values()) {\n var avg =\n (pixel.getRed() + pixel.getGreen() + pixel.getBlue()) /3;\n if (avg < 128){\n pixel.setRed(2 * avg);\n pixel.setGreen(0);\n pixel.setBlue(0);\n } else {\n pixel.setRed(255);\n pixel.setGreen(2 * avg - ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
============================================================================ Functions ============================================================================ handle task errors | function handleError(task) {
return function(err) {
console.error(task, err.message);
this.emit('end');
}
} | [
"onError(error) {\n this.status = WorkerStatusEnum.TERMINATED;\n let activeTasks = TaskQueue.getActive();\n let activeTasksRunningOnWorker = [];\n\n if (activeTasks && activeTasks.length) {\n activeTasksRunningOnWorker = activeTasks.filter(task => task.runningOnWorkerId === this.id);\n }\n\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Data for an instantiated NodeType.PureExpression. Attention: Adding fields to this is performance sensitive! | function PureExpressionData() { } | [
"function createAstNode(type, data){\n\tlet result = data.value;\n\tif(result === undefined){\n\t\tresult = {};\n\t}\n\tresult.type = type;\n\tresult.loc = {\n\t\tstart : data.start,\n\t\tend : data.end,\n\t};\n\treturn result;\n}",
"function Expr() {\n var node = new Node('Expr');\n p.child.push... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
hasDecorators checks a file's metadata for the presence of decorators without evaluating the metadata. | hasDecorators(filePath) {
const metadata = this.getModuleMetadata(filePath);
if (metadata['metadata']) {
return Object.keys(metadata['metadata']).some((metadataKey) => {
const entry = metadata['metadata'][metadataKey];
return entry && entry.__symbolic === 'cla... | [
"function hasProperties(json, properties) {\n return properties.every(property => {\n return json.hasOwnProperty(property);\n });\n}",
"function addCustomDecorators() {\n /**\n * @type {Set<import('@storybook/react').DecoratorFn>}\n */\n const customDecorators = new Set();\n\n if (['react-card... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
COLLEGE OPTION PANEL Called when user clicks on "x" of a selected program Delete selected program div Delete the program from "selectedPrograms" list | function deleteSelectedProgram() {
var $this = $(this)
var $program = $this.closest('.program')
var transferSchoolCode = $this.closest('.transfer-school').attr('data-transfer-school-code')
var programCode = $this.parent().attr('data-id')
var programContainer = $this.parents('.program_container')[0]
$(progra... | [
"function handleAddProgramPanel() {\n let addProgramContainer = $(this).parents('.add_program_container')[0]\n let selectedProgram = $(addProgramContainer).siblings('.selected_program')[0]\n let dataId = $(this).attr('data-id')\n console.log(dataId)\n if (!selectedPrograms.includes(dataId)) {\n addProgramPa... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Build a function splitParagraph which, given a paragraph string, returns an array of paragraph fragments. Think of a good way to represent the fragments. The method indexOf, which searches for a character or substring in a string and returns its position, or 1 if not found, will probably be useful in some way here. Thi... | function splitParagraph(text){
var fragments = [];
while( text != ''){
if (text.charAt(0) == "*"){
fragments.push({type: 'emphasized',
content: text.slice(1,takeUpTo('*',text))});
//modify text so we remove the string we just stored
//we add 1 because we want to remove the string added
//PL... | [
"function paragraphToArray(paragraph) {\n let list = [];\n let tmp = \"\";\n for (let i = 0; i < paragraph.length; i++) {\n if (paragraph[i] != \"\\n\") {\n tmp += paragraph[i];\n }\n else {\n list.push(tmp);\n tmp = \"\";\n }\n }\n\n if (tmp != \"\") {\n list.push(tmp);\n tmp ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
moveRandomDot() moves one randomly selected dot to another randomly selected position. | moveRandomDot(){
//console.log("(moveRandomDot) called:");
let taken_pos = this.getTakenPositions();
let to_remove = taken_pos[Math.floor(Math.random() * taken_pos.length)];
this.addRandomDot();
this.free_pos.push(to_remove);
let pos_to_place_dot = this.getTakenPositions... | [
"addRandomDot(){\n\n // get random position from our list of free positions\n let rand_pos = this.free_pos[Math.floor(Math.random() * this.free_pos.length)];\n this.addDot(rand_pos.x, rand_pos.y);\n\n }",
"function addNewDot() {\n random(dots).setAlive();\n}",
"function setAllDotsToRand... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sorting resutls based on the option that a user choose, options are percentage and index, decrement vs increment order. | function sortResults() {
let perDesc = (a, b) => a[0] - b[0]
let perAsc = (a, b) => b[0] - a[0]
let indDesc = (a, b) => (a[1] + a[2]) - (b[1] + b[2])
let indAsc = (a, b) => (b[1] + b[2]) - (a[1] + a[2])
switch (sortBy.value) {
case "0":
result.sort(perDesc)
break;
... | [
"function sort() {\n var sortBy = sortOptions.value;\n\n if (sortBy === \"lname\") sortByLname();\n else if (sortBy === \"gender\") sortByGender();\n else if (sortBy === \"region\") sortByRegion();\n else sortByFname();\n}",
"function sortResults(username, friends, unheard, searchType, results) {\r... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Uses armorBySkill to get all pieces that match selectedSkills | function getMatchingPieces(){
let ret = {
"head": new Set(),
"chest": new Set(),
"arms": new Set(),
"waist": new Set(),
"legs": new Set()
}
// Add each required skill's pieces to the set by name
// For each armor type (head, chest, ...)
let realSearch = false;
for(let key of Object.ke... | [
"function setABS(){\n // Create a blank version of the skillList\n let newObj = Object.assign({}, skillList);\n for(let key of Object.keys(newObj)){\n newObj[key] = []\n }\n armorsBySkill = {\n \"head\": newObj\n };\n armorsBySkill[\"chest\"] = JSON.parse(JSON.stringify(newObj));\n armorsBySkill[\"arm... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
impelementation of maybe monad do action if item is not null item is passed into action callback | function maybe(item, action) {
if(!item) {
return;
}
return action(item);
} | [
"function maybeNot(item, action) {\n if(item) {\n return;\n }\n return action();\n}",
"static itemAction(item) {\n\t\t// If requirement doesn't exist or if requirement exists and is true\n\t\tif (item.hasOwnProperty(\"requirement\") ? Parser.parseJS(item.requirement) : true)\n\t\t{\n\t\t\tvar item... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
gcd(w1,w2) :: Word > Word > Word fixme negatives are probably wrong here | function h$ghcjsbn_gcd_ww(w1, w2) {
h$ghcjsbn_assertValid_w(w1, "gcd_ww w1");
h$ghcjsbn_assertValid_w(w2, "gcd_ww w2");
var a, b, r;
a = w1 < 0 ? (w1 + 4294967296) : w1;
b = w2 < 0 ? (w2 + 4294967296) : w2;
if(b < a) {
r = a;
a = b;
b = r;
}
while(a !== 0) {
r = b % a;
b = a;
a =... | [
"function coprime(a, b)\n{\n if (__gcd(a, b) === 1)\n console.log(\"1\");\n else\n console.log(\"0\"); \n}",
"function compGCD(firstRank,secondRank){\n let curBoolean = false;\n let firstCDs = ranksMap.get(firstRank);\n let secondCDs = ranksMap.get(secondRank);\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Function Creator returns a function that trims to `decimals` precision. | function trimmerFactory (decimals) {
return (val) => trimDec(val, decimals);
} | [
"function precision_function() {\n var a = 1234567.89876543210;\n document.getElementById(\"precision\").innerHTML = a.toPrecision(10);\n}",
"function cut(value, prec){\n var precision = prec || 100000000;\n return Math.floor(value * precision) / precision;\n}",
"function SysFmtRoundDecimal() {}",
... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Verify Client Registration NOTE: verifyAccessToken and its dependencies should be used upstream. This middleware assumes that if a token is present, it has already been verified. It will invoke the error handler if any of the following are true 1. a token is required, but not present 2. registration contains the "trust... | function verifyClientRegistration (req, res, next) {
// check if we have a token and a token is required
const registration = req.body
const claims = req.claims
const clientRegType = settings.client_registration
const required = (registration.trusted || clientRegType !== 'dynamic')
const trustedRegScope = s... | [
"async function ensureToken(req, res, next) {\n try {\n var bearerHeader = req.headers['authorization']\n if (typeof bearerHeader == 'undefined') {\n console.log('undefined, gak ada token');\n return res.status(403).send({\n 'message': 'token not provided'\n })\n }\n var bearerTok... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
require auth to edit or create products from admin panel if the user is signed in, we can access the req.session.id | requireAuth(req, res, next) {
if (!req.session.userId) {
return res.redirect('/signin');
}
next();
} | [
"function protect(req,res, next) {\n if(req.session.currentUser) next();\n else res.redirect(\"/user/login\");\n}",
"session(req, res) { \n res.json(req.session.user.objectKey)\n}",
"function authAware(req, res, next) {\n if (req.session.oauth2tokens) {\n req.oauth2client = getClient();\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
the function checks if the target number is in the array and returns the corresponding index of this number in the array; if not, returns 1 a) google what linear sorting is and try to do it in this way | function searchLinear(array, target){
for(let i = 0;i<array.length;i++){
if(target == array[i]){
return i;
}
}
return -1
} | [
"function getIndexToIns(arr, num) {\n arr.sort(function(a, b) {\n return a - b;\n });\n for (var i = 0; i < arr.length; i++) {\n if (num <= arr[i]) {\n break;\n }\n }\n return i;\n}",
"function binarySeach(arr, target) {\n\n arr = arr.sort()\n\n left = 0; // index [ 0 ]\n\n right = arr.lengt... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Set data for id! | set(id, data) {
let oldData = this.raw();
oldData[id] = data;
this._write(oldData);
} | [
"function setDatacenter(id) {\n sessionStorage[\"datacen\"] = id;\n sessionStorage[\"changed\"] = true;\n}",
"set id(_id) {\n\t\tthis.canvas.id = _id;\n\t}",
"set id(newId) {\n this._id = newId;\n setValue(`cmi.objectives.${this.index}.id`, newId);\n }",
"function setId(entity){\n entity['id'] =... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
If we want the certain character set, it gets added to the total pool here. | function assembleCharacterPool() {
if (wantUpperCase) {
characterPool += upperCase;
}
if (wantLowerCase) {
characterPool += lowerCase;
}
if (wantNumbers) {
characterPool += numbers;
}
if (wantSpecialCharacters) {
characterPool += specialCharacters;
}
return characterPool;
} | [
"function getUniversalCharString(){\n // Get lowercase options//\nif (lowerCasePref === true)\nuniversalCharacters = universalCharacters+lowerCharacters; \n\n// Get get upperCase char//\nif (upperCasePref === true)\nuniversalCharacters = universalCharacters+upperCharacters;\n\n// Get get numbers char//\nif (number... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
randomize the user list with n elements from main | function randomUserlist (n) {
// abort if not numeric
if (!($.isNumeric(n))) {
return false;
}
clearUserlist();
var mainlength = $('#mainlist > li').length;
var rand = 0;
var memory = [];
var i;
for (i = 0; i < n; i += 1) {
// get random number that is between 1 and length of mainlist
ran... | [
"function addFiveItemsToList(){\n var list = document.getElementById(\"list1\");\n for(var i = 0; i < 6; i++){\n var listItem = document.createElement(\"li\");\n listItem.innerText = parseInt(Math.random() * 100);\n list.appendChild(listItem);\n }\n}",
"function pickRandomFrom(list) {\n return list... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Validate whether the given string is a valid Xaddress for the XRP Ledger. | static isValidXAddress(address) {
return addressCodec.isValidXAddress(address);
} | [
"function isAddress(string) {\n try {\n bitcoin.Address.fromBase58Check(string)\n } catch (e) {\n return false\n }\n\n return true\n}",
"function validateAddress() {\r\n var addressInput = $('#register-address');\r\n var addressInputValue = addressInput.val();\r\n var addressRegex = /^\\d+\\s([... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Copyright (c) 20102011 Turbulenz Limited ResourceLoader | function ResourceLoader() {} | [
"function ADLAuxiliaryResource()\r\n{\r\n}",
"function resources_loaded_callback(){\n\n console.log(\"Resources loaded.\");\n\n show_loader_div(false);\n show_setting_div(true);\n show_canvas_div(true);\n\n // init mesh manager that may be contains some objec... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
SHARED TEXTMARKERS A shared marker spans multiple linked documents. It is implemented as a metamarkerobject controlling multiple normal markers. | function SharedTextMarker(markers, primary) {
var this$1 = this;
this.markers = markers
this.primary = primary
for (var i = 0; i < markers.length; ++i)
{ markers[i].parent = this$1 }
} | [
"function setMarkers (plainText) {\r\n var matchedRtlChars = plainText.match(rtlChar);\r\n var text = plainText;\r\n if (matchedRtlChars || originalDir === \"rtl\") {\r\n text = replaceIndices(text, twttr.txt.extractEntitiesWithIndices, function (itemObj) {\r\n if (itemObj.entityType === \"scre... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Display the signedoutflow container | function signedOutFlow() {
document.querySelector('#signed-out-flow').style.display = 'block'
} | [
"renderSignout () {\n\t\tconst { t } = this.props;\n\t\tif (!this.props.signoutUrl) return null;\n\n\t\treturn (\n\t\t\t<PrimaryNavItem\n\t\t\t\tlabel=\"octicon-sign-out\"\n\t\t\t\thref={this.props.signoutUrl}\n\t\t\t\ttitle={t('signOut')}\n\t\t\t>\n\t\t\t\t<span className=\"octicon octicon-sign-out\" />\n\t\t\t</P... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
renderStockInfo uses the bootstrap 4 'card' functionality to render the stocks information | function renderStockInfo(data) {
var stockDiv = $("<div>").addClass("card-body").
attr("id","stock-info"),
cardh5 = $("<h5>").addClass("card-title"),
cardBody = $("<p>").addClass("card-text ticker-paragraph"),
addToWatchBtn = buildWatchBtn(data["1. symbol"]),
... | [
"function renderStockInfo(data) {\n var stockDiv = $(\"<div>\").addClass(\"card-body\").\n attr(\"id\",\"stock-info\"),\n cardh5 = $(\"<h5>\").addClass(\"card-title\"),\n cardBody = $(\"<p>\").addClass(\"card-text ticker-paragraph\"),\n addToWatchBtn = buildWatch... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Function that prints the date and the voucher number | function printInfoVoucher(tableInfo, report, docNumber, date, totalPages) {
//Title
tableRow = tableInfo.addRow();
tableRow.addCell(getValue(param, "voucher", "chinese"), "heading1 alignCenter", 11);
tableRow = tableInfo.addRow();
tableRow.addCell(getValue(param, "voucher", "english"), "heading2 a... | [
"function renderText_DivAmtDate(stockSymbol, dividendAmount, dividendDate) {\n $('.results-text-title').html('More details:');\n $('.dividend-results-detail').html(`<br>-${stockSymbol.toUpperCase()}'s most recent quarterly dividend amount was: $${dividendAmount}<br>\n -${stockSymbol.toUpperCase()} declared tha... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Add a Google Pay purchase button alongside an existing checkout button | function addGooglePayButton() {
var paymentsClient = getGooglePaymentsClient();
var button = paymentsClient.createButton({
onClick: onGooglePaymentButtonClicked,
buttonColor: "black",
buttonType: "short"
});
document.getElementsByClassName("btn-wrap-gpay")[0].appendChild(button);... | [
"function createCheckoutButton(preference) {\n var script = document.createElement(\"script\");\n\n // The source domain must be completed according to the site for which you are integrating.\n // For example: for Argentina \".com.ar\" or for Brazil \".com.br\".\n script.src = \"https://www.mercadopago.... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Updates router clients and metrics from rawkey val metrics. | function update(routers, metrics) {
// first, check for new clients and add them
var addedClients = [];
_.each(metrics, function(metric, key) {
var match = key.match(clientRE);
if (match) {
var name = match[1], id = match[2],
router = routers[name];
if (router && !ro... | [
"update_drone_stats(){\n this.update_location(new_location);\n this.update_sensor();\n this.update_battery(); // send drone info to remote maybe\n }",
"function updateRoutes(){\n vm.map.cleanRoute();\n var locations = vm.map.markers.filter(function(el){\n return el.hasOwnProperty('loca... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns a new Typed of %%type%% with the %%value%%. | static from(type, value) {
return new Typed(_gaurd, type, value);
} | [
"set type(aValue) {\n this._logger.debug(\"type[set]\");\n this._type = aValue;\n }",
"function factory (type, config, load, typed) {\n // create a new data type\n function MyType (value) {\n this.value = value\n }\n MyType.prototype.isMyType = true\n MyType.prototype.toString = function () {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Ensure that: first are builtin extensions second are user extensions third are extensions under development In each bucket, extensions must be sorted alphabetically by their folder name. | function extensionCmp(a, b) {
const aSortBucket = (a.isBuiltin ? 0 /* Builtin */ : a.isUnderDevelopment ? 2 /* Dev */ : 1 /* User */);
const bSortBucket = (b.isBuiltin ? 0 /* Builtin */ : b.isUnderDevelopment ? 2 /* Dev */ : 1 /* User */);
if (aSortBucket !== bSortBucket) {
return aS... | [
"function sortExtensionsByName(extensions) {\n // reserved the type of sort\n let type = String(arguments[1]).toLowerCase() === 'desc' ? 'desc' : 'asc';\n\n\tif (Array.isArray(extensions)) {\n extensions.sort(function(a, b) {\n let firstLength = Math.max(a.firstName.length, b.firstName.length),\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This function is used to send bookmark save ajax request to servlet. | function saveBookmarks(){
var lRecipeid;
lRecipeid=jQuery("#recipeid").val();
jQuery
.ajax({
type : "POST",
url : "SaveBookmarks",
contentType : "application/x-www-form-urlencoded; charset=UTF-8",
data : {
'recipeid' : lRecipeid,
},
success : function(responseText) {
a... | [
"function bookmarkCB (div) {\n\tupdateBrain (function () {\n\t\tdoXML (\"sendbookmark&\" + div.getElementsByClassName(\"url\")[0].innerHTML, null)\n\t})\n}",
"function saveCB () {\n\tupdateBrain (function () {\n\t\tdoXML (\"getbookmark\", function (responseText) {\n\t\t\t// Parse the returned data\n\t\t\tvar url ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Determine whether the given properties match those of a `PortMappingProperty` | function CfnVirtualRouter_PortMappingPropertyValidator(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 rece... | [
"function CfnVirtualNode_PortMappingPropertyValidator(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,... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
The form handler for password resets. | function passwordResetForm() {
passwordResetFormHandler('account/password/requestpasswordreset', URLUtils.https('Account-PasswordResetForm'));
} | [
"function passwordReset() {\n app.getForm('requestpassword').clear();\n app.getView({\n ContinueURL: URLUtils.https('Account-PasswordResetForm')\n }).render('account/password/requestpasswordreset');\n}",
"function passwordResetFormHandler(templateName, continueURL) {\n var resetPasswordToken, p... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
adds the rating to the necessary candidate and all its parents | function cascadeRating(newRating) {
var candidate = getCandidateWithName(newRating.getActivity());
if (candidate) {
var candidatesToUpdate = findAllSuperCategoriesOf(candidate);
var i, j;
for (i = 0; candidatesToUpdate[i]; i++) {
var currentCandidate = candidatesToUpdat... | [
"function rateCandidate(candidate, when) {\n \n message(\"rating candidate with name: \" + candidate.getName().getName());\n printCandidate(candidate);\n var parents = candidate.getParents();\n var guesses = [];\n var currentDistribution;\n var i;\n var currentPar... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
renderRow(rowNum, borderBottom, mistakesArray) renders each row given a row number, rowNum, and whether the row should have a thicker bottom border, borderBottom. renderRow: Int Bool > Component | renderRow(rowNum, borderBottom, mistakesArray) {
let row = [];
let borders;
let isSelected;
const selectedNumber = this.props.board[this.props.selectedCell];
// making the array of square components.
for (let i = 0; i < 9; i++) {
const currSquareNum = rowNum * 9 + i;
const curr... | [
"renderBoard(mistakesArray) {\n let board = [];\n for (let i = 0; i < 9; i++) {\n if ((i + 1) % 3 === 0 && i !== 9) {\n board.push(this.renderRow(i, true, mistakesArray));\n } else {\n board.push(this.renderRow(i, false, mistakesArray));\n }\n }\n\n return (\n <div clas... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Fetch the current user's watchlists | getWatchlists() {
return new Request({
path: '/_mobile/usercontent/watchlist',
method: 'GET',
headers: {
'X-AuthenticationSession': this.authenticationSession,
'X-SecurityToken': this.securityToken
}
});
} | [
"async getUserList () {\n return await this.Config.userStore.getUserList();\n }",
"function renderUserWatchlist() {\n var dbPath = appUser.getWatchPath();\n\n // empty out stock-ticker content\n $(\"#stock-ticker-content\").empty();\n\n console.log(\"in renderUserWatchList() appUser.getWatchPath: ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
tuple3Of(a, b, c) Sentinel value for when an tuple3 of a particular type is needed: tuple3Of(Number, Number, Number) | function tuple3Of(a, b, c) {
var self = getInstance(this, tuple3Of);
self.types = rest(arguments);
return self;
} | [
"function tuple4Of(a, b, c, d) {\n var self = getInstance(this, tuple4Of);\n self.types = rest(arguments);\n return self;\n}",
"function tuple5Of(a, b, c, d, e) {\n var self = getInstance(this, tuple5Of);\n self.types = rest(arguments);\n return self;\n}",
"function triple(number) {\n retur... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Shows the popup even if the user has seen it before. | _show() {
var popup = this._getPopup();
if (popup) {
popup.classList.remove('cc-invisible');
popup.style.display = '';
}
} | [
"function showPopup () {\n $('#popup').css('z-index', '20000');\n $('#popup .popup-title').text($('#title').val());\n $('#popup .popup-content').text($('#content').val());\n $('.hide-container').show();\n $('#popup').show();\n }",
"function wpbingo_ShowNLPopup() {\n\t\tif($('... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Time signature input component | function MusicTimeSignatureInputComponent() {
this.type = 'timeSignature';
} | [
"function timeInput(id) {\n\tconst input = /** @type {HTMLInputElement} */ ele(id);\n\tif (supportsNumber(input)) return input.valueAsNumber;\n\treturn parseTime(input.value);\n}",
"function eventFocusOnTime(element){\n\tsetInputFormat(element);\n\tvar popup = element.parentNode.querySelector('.popup-time-picker'... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Setter of the component damage. | set damage (damage) {
this._damage = damage
} | [
"set softwareDamage (softwareDamage) {\n this._softwareDamage = softwareDamage\n }",
"set hardwareDamage (hardwareDamage) {\n this._hardwareDamage = hardwareDamage\n }",
"_setDamagePercentage(percentage) {\n this.primaryWeapon.setDamagePercentage(percentage)\n this.secondaryWeapon.setDamag... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Updates quantity of line items in cart and in checkout state | function updateQuantityInCart(lineItemId, quantity, checkoutId) {
const lineItemsToUpdate = [
{ id: lineItemId, quantity: parseInt(quantity, 10) },
]
return async (dispatch) => {
const resp = await client.checkout.updateLineItems(
checkoutId,
lineItemsToUpdate
)
dispatch({
type: UPDATE_QUANTITY_IN_... | [
"function updateCartQuantity() {\n let sum = null;\n for (let i = 0; i < order.length; i++) {\n sum += order[i].quantity;\n }\n cartCount = sum;\n $('#cartCount')\n .text(cartCount);\n orderSubTotal();\n }",
"function updateLineItemQty(actionLink, qty) {\n if (reportMissingAr... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
My Account nav.sections person/project/company | function accountMenu( ){
$(".account .nav-lists nav.sections>ul>li>a").click( function() {
$(this).parents().find('.cat li.active')
.removeClass('active');
$(this).parent('li').addClass('active');
var active = $(this).parent();
if ((active).hasClass("user-profile")) {
unDetails( );
$(".account #main... | [
"function includeNavigation() {\n app.getView().render('account/accountnavigation');\n}",
"function buildNav(){\n for (const section of sections){\n const item=document.createElement(\"li\");\n const link=document.createElement(\"a\");\n link.textContent=section.dataset.nav;\n li... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Saves a debug location information and adds a visual anchor to the breakpoints gutter. This is used by the debugger UI to display the line on which the Debugger is currently paused. | function setDebugLocation(ctx, line) {
let { ed } = ctx;
let meta = dbginfo.get(ed);
clearDebugLocation(ctx);
meta.debugLocation = line;
ed.addMarker(line, "breakpoints", "debugLocation");
ed.addLineClass(line, "debug-line");
} | [
"function clearDebugLocation(ctx) {\n let { ed } = ctx;\n let meta = dbginfo.get(ed);\n\n if (meta.debugLocation != null) {\n ed.removeMarker(meta.debugLocation, \"breakpoints\", \"debugLocation\");\n ed.removeLineClass(meta.debugLocation, \"debug-line\");\n meta.debugLocation = null;\n }\n}",
"funct... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Create a new xhr object. | function xhrFactory() {
return new XMLHttpRequest();
} | [
"constructor() {\n this.xmlhttp = new XMLHttpRequest();\n }",
"function createClient(xhr) {\n const { flag, properties } = xhr;\n const urlObj = new URL(flag.uri);\n const uri = urlObj.href;\n const ucMethod = flag.method.toUpperCase();\n\n const { requestManager } = flag;\n\n if (urlObj.protocol ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Controls if updateState should be called. By default returns true if any prop has changed | shouldUpdateState(params) {
return params.changeFlags.propsOrDataChanged;
} | [
"shouldComponentUpdate(nextProps, nextState) {\n return nextState.tipState !== this.state.tipState\n }",
"shouldComponentUpdate(){\n if(this.props.debug)console.log(\"Parent - shouldComponentUpdate\");\n return false; // this ensures parent render wont render this component\n }",
"com... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Collecting all the serial number to be deleted from the database | function deleteSerial(checkbox){
let takenCareOf = false;
let toBeDeleted = new Object();
for (let index in _requestJSON.deleteSerials) {
// Going to check if the model number has been already added to the deleteSerials array
if (_requestJSON.deleteSerials.hasOwnProperty(index) && _requestJSON.deleteSeri... | [
"static delete_all() {\n this.#users.remove({},{},function(err,num) {\n if (!err) {\n console.log(\"Deleted\",num,\"users\");\n }\n })\n }",
"deleteMultiple() {}",
"function deleteData(datalibrary, doc) {\n for (var i = 0; i < doc.length; i++) {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Add White list URL client and platform wise | function addWhiteListUrl(form){
let clientId=$('#clientId').val();
let platformId=$('#typeId').val();
let url =$('#url').val().trim();
if(clientId === "0"){
alert('Please select a Client ');
}else if(platformId === "0"){
alert('Please select Platform type');
}else if(url === ""){
alert('Please add a URL');
... | [
"function addGrayListUrl(form){\n\tlet clientId=$('#clientId').val();\n\tlet platformId=$('#typeId').val();\n\tlet url =$('#url').val().trim();\n\tif(clientId === \"0\"){\n\t\talert('Please select a Client ');\n\t}else if(platformId === \"0\"){\n\t\talert('Please select Platform type');\n\t}else if(url === \"\"){\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Initialize the Files DataTable and set up an automatic reload | function initFilesDataTable() {
console.log("initFilesDataTable");
var path = window.location.pathname;
path = path.substr(0, path.indexOf("/files/"));
var subdir = window.location.pathname;
subdir = subdir.substr(subdir.indexOf("/files/")+"/files/".length);
var table = $('#files-dataTable').... | [
"function fillFileInfo() {\n /**\n * AJAX for getting the JSON of a calendar, also fills the empty table cells with the info\n */\n $.ajax( {\n type: 'get',\n url: '/fileToJSon',\n success: function(data) {\n var fileTable = document.getE... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Enter a parse tree produced by KotlinParserlambdaParameter. | enterLambdaParameter(ctx) {
} | [
"enterFunctionValueParameter(ctx) {\n\t}",
"enterAnnotatedLambda(ctx) {\n\t}",
"visitLambdef(ctx) {\r\n console.log(\"visitLambdef\");\r\n if (ctx.varargslist() !== null) {\r\n return {\r\n type: \"LambdaDef\",\r\n arguments: this.visit(ctx.varargslist()),\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
ebs_nvme_support computed: true, optional: false, required: false | get ebsNvmeSupport() {
return this.getStringAttribute('ebs_nvme_support');
} | [
"get instanceStorageSupported() {\n return this.getBooleanAttribute('instance_storage_supported');\n }",
"get ebsEncryptionSupport() {\n return this.getStringAttribute('ebs_encryption_support');\n }",
"get defaultVcpus() {\n return this.getNumberAttribute('default_vcpus');\n }",
... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
================================================================================================================ Obtiene el ceco y el anticipo de la solicitud | function obtenAnticipoCeco(tramite, tramiteEdicion){
var param = "anticipoCeco=ok&tramite="+tramite+"&tramiteEdit="+tramiteEdicion;
return obtenJson(param);
} | [
"function getCourier() {\n return courier;\n}",
"static getRequestorOrg(ctx) {\n\t\t//Return requestor MSP value\n\t\treturn ctx.clientIdentity.getMSPID();\n\t}",
"function cargarInfoComidasRepresentacion(){\r\n\t\tvar solicitud = $(\"#solicitud\").val();\r\n\t\tobtenInformacionComidasRepresentacion(solicitu... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
primary function to retrieve cookie by name | static getCookie(name) {
var arg = name + "=";
var alen = arg.length;
var clen = document.cookie.length;
var i = 0;
while (i < clen) {
var j = i + alen;
if (document.cookie.substring(i, j) == arg) {
return CookieUtil.getCookieVal(j);
... | [
"function getCookie(name) {\n var index = document.cookie.indexOf(name + \"=\")\n if (index == -1) { return \"undefined\"}\n index = document.cookie.indexOf(\"=\", index) + 1\n var end_string = document.cookie.indexOf(\";\", index)\n if (end_string == -1) { end_string = document.cookie.length }\n return unesc... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Presents the default login form if the login page is currently viewed. | function presentDefaultLoginForm(){
$("#loginField").empty();
$("#loginField").html("<a id=\"loginButton\" href=\"/login\"><strong>Login</strong></a>");
$("#loginStatus").html("Login:");
$("#loginMessage").html("Fill in the formula and click on the button to log in.");
$("#myform").removeAttr("style");
} | [
"function toggleLogin() {\n var loginForm = document.getElementById(\"loginForm\");\n if (loginForm !== null) {\n if (loginForm.style.display === \"none\") {\n loginForm.style.display = \"inline\";\n } else {\n loginForm.style.display = \"none\";\n }\n } else {\n createLoginForm();\n }\n}"... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
FIND ALL OF THE DOORS ON A GIVEN MAP | function findDoor(map){
for(let r=0;r<map.length;r++){
for(let c=0;c<map[0].length;c++){
if(map[r][c] == '/'){
return [c,r];
}
}
}
} | [
"function findDoors()\n{\n for (i = 1; i <= config.DoorCount; i++)\n {\n for (j = 0; j < config.Plans.length; j++)\n {\n var a = document.getElementById(config.Plans[j].Name);\n if (a == null)\n continue;\n var svgDoc = a.contentDocument;\n var element = svgDoc.getElementById(\"DO... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
move files from userDir to web accessible directory | function moveUserFiles() {
cpr(userDir.toString(), "/Users/ArvindB/Documents/node-slideshow/public/images/", {
overwrite: true, //If the file exists, overwrite it
confirm: true //After the copy, stat all the copied files to make sure they are there
}, function(err, files) {
return console.error(err);
});... | [
"function paste_selected_files() {\n var files = JSON.parse(sessionStorage.getItem(\"selected_file_names\"));\n var source_directory = sessionStorage.getItem(\"source_directory\");\n $.each(files, function(index, value) {\n var url = \"/webhdfs/v1\"\n + encode_path(append_path(source_directory,... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Change the product substitutes This function is called on the top tick of substitutes modal box | function change_product_substitutes(product_id)
{
//Empty the products substitutes for this product
while (order_list[product_id].substitutes.length>0) {order_list[product_id].substitutes.pop();}
//iterate through HTML and find products which are checked
$("#product_view2 input[type=checkbox]").each(function() {
... | [
"function change_product_substitutes(product_id)\n{\n\t//Empty the products substitutes for this product \n\twhile (order_list[product_id].substitutes.length>0) {order_list[product_id].substitutes.pop();}\n\t//iterate through HTML and find products which are checked \n\t$(\"#product_view2 input[type=checkbox]\").ea... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
/ Set the tooltip's text to the specified string. | function SetText(tooltipText : String, position : Vector2)
{
if (text != null && !String.IsNullOrEmpty(tooltipText))
{
mTargetAlpha = 1f;
text.text = tooltipText;
if (tooltipType == TooltipTypeEnum.TOOLTIP_HOVER)
{
mPos = position;
Adjust();
}
}
else
mT... | [
"function showTooltip(content, event) {\n tt.style('opacity', 1.0)\n .style('pointer-events', 'all')\n .html(content);\n\n updatePosition(event);\n }",
"_updateTitle(text, tooltip, limit) {\n // Polymer 2: check for undefined\n if ([text, limit, tooltip].includes(undefined)) {\n return... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Merge meta fields of an array of records | function mergeMetaFields(matched) {
return matched.reduce((meta, record) => assign(meta, record.meta), {});
} | [
"function mergeMetaDataToCustomObject(customMetaDataObjectMap){\n\n $log.info('incoming customMetadataObject', customMetaDataObjectMap);\n\n var mergedCustomObject = {\n name: customMetaDataObjectMap.qualifiedName,\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
function that makes the coral reef importance button | function makeCoralImportanceButton() {
// Create the clickable object
coralImportanceButton = new Clickable();
coralImportanceButton.text = "Why are coral reefs important?";
coralImportanceButton.textColor = "#365673";
coralImportanceButton.textSize = 25;
coralImportanceButton.color = "#8FD9CB";
/... | [
"function makeCoralReefButton() {\n\n // Create the clickable object\n coralReefButton = new Clickable();\n \n coralReefButton.text = \"Click here to see your coral reef!\";\n coralReefButton.textColor = \"#365673\"; \n coralReefButton.textSize = 37; \n\n coralReefButton.color = \"#8FD9CB\";\n\n // set widt... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Init the whole edit form from the given color input field | function initColorEditFormFromField(field){
fieldId = getFieldIdFromCurrentNode(field);
fieldValue = jQuery(field).val();
if (fieldValue=='transparent') fieldValue='#000000';
R = parseInt(fieldValue.substring(1,3), 16);
G = parseInt(fieldValue.substring(3,5), 16);
B = parseInt(fieldValue.substring(5,7), 16);
HS... | [
"function startColorWidgetFromField(field) {\n fieldValue = jQuery(field).val();\n if ( fieldValue ) {\n jQuery(field).val(getHexaColor(fieldValue));\n initColorEditFormFromField(field);\n }\n}",
"function update_from_input() {\n try {\n colorBox('new', cpicker.target.valu... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Retrieves string representation of ALL markup objects currently in the viewer | function getMarkup()
{
return getStoredMarkup().markup;
} | [
"getDOMStrings() {\n return DOMstrings;\n }",
"function getHtmlContent(){\n \n }",
"getHTML() {\n return getHTMLFromFragment(this.state.doc.content, this.schema);\n }",
"toString() {\n let normalisedContent = pureAssign(get(this, CONTENT), {});\n return `changeset:${nor... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
neem een broodje. leg er ham op. sluit het broodje. | function makeHollandsBroodje() {
console.log('neem een broodje. Leg er ham op. sluithet broodje')
} | [
"function verbind(a, b){\n var verbonden = a.isVerbondenMet(b), verbindingen = '';\n \n if(verbonden){\n verbindingen = 'dubbel';\n a.nieuweBrug(b, 2);\n b.nieuweBrug(a, 2);\n } else {\n a.nieuweBrug(b, 1);\n b.nieuweBrug(a, 1);\n }\n \n if(a.pos.x === b.pos.x){\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
RoundRestart Called a few seconds after a round has ended. | function RoundRestart() {
log('RoundRestart');
level.arena.restartTime = 0;
if (level.arena.gametype === GT.ROCKETARENA) {
// Queue losing team in RA.
if (level.arena.lastWinningTeam === TEAM.RED) {
QueueGroup(level.arena.group2);
level.arena.group2 = null;
// Respawn winners.
RespawnTeam(TEAM.RED... | [
"function restart() {\n number = 60;\n start();\n }",
"function restartGame() {\n initAll();\n resetPlayer();\n toggleDice(false);\n}",
"function restart() {\n force.start();\n t = 1;\n }",
"function restartGame(){\r\n\r\n }",
"function quitRound() {\n clearInterval(t... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Notifies extension about stopped scrolling | function notifyExtensionScrollingStopped(){
browser.runtime.sendMessage({'message': 'stopped'});
} | [
"cancelScroll() {\n this._isScrollLocked = false;\n }",
"onScrolledToBottom() {\n callAction(this, 'onScrolledToBottom', ...arguments);\n }",
"handleScroll_() {\n this.resetAutoAdvance_();\n }",
"function __scrollHandler__() {\n\t\tvar topMostDlg = __findTopMostDialog__();\n\t\tif (topMo... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Create filter function for a query string filter based on item.name (case insensitive) | function createFilterFor(query) {
var lowercaseQuery = angular.lowercase(query);
return function filterFn(item) {
var toMatch = angular.lowercase(item.name);
return (toMatch.indexOf(lowercaseQuery) !== -1);
};
} | [
"filter(items) {\n return items.filter( (item) => {\n return item.getName().toLowerCase().includes(this.filterTemplate);\n });\n }",
"function filterToItemFilter(filter) {\n return filter.charAt(0).toUpperCase() + filter.slice(1);\n}",
"function filterItems(query) {\n\treturn fruits.filter(function... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
pluginInstalledIE Returns true is the plugin is installed | function pluginInstalledIE(){
try{
var o = new ActiveXObject("npwidevinemediaoptimizer.WidevineMediaTransformerPlugin");
o = null;
return true;
}catch(e){
return false;
}
} | [
"function checkPlugin()\n{\n\tvar dllVer = getRequestParameter('dllVer');\n\tif (!dllVer || pageData.latestVersion != getRequestParameter('dllVer'))\n\t{\n\t\t$('#newPlugin').show();\n\t}\n}",
"function isPluginEnabled() {\n return cordova && cordova.plugins && cordova.plugins.permissions;\n }",
... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Read SVG nodes and find closest past value to the given x in each data set. | function findValues(graph, x) {
var data_sets = [],
nodes = graph.querySelectorAll('[data-set]');
for (var i = 0, l = nodes.length; l > i; i++) {
var px = -10,
py = -10,
pv = null;
// Find matching X points.
switch (nodes[i].getAttribute('data-set')) {
case 'points':
var test_x = Math... | [
"closestObject( type, x )\n {\n let index = 0, dist = 10 ** 6, objX = undefined;\n\n // find the closest building to guard\n for( index = 0;index < this.objects.length;index++ )\n {\n let o = this.objects[ index ];\n\n const d = Math.abs( o.p.x - x );\n\n if( ( o.oType == type ) && ( d <... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
make a getter to get the authentication status. use computedFrom to avoid dirty checking | @computedFrom('authService.authenticated')
get authenticated() {
return this.authService.authenticated;
} | [
"_checkAuthenticationStatus()\n {\n // First, check if we have the appropriate authentication data. If we do, check it.\n // If we don't, trigger an event to inform of login require.\n if (this._token.value === '')\n {\n Radio.channel('rodan').trigger(RODAN_EVENTS.EVENT__AU... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
meetings is a string ex: "TuTh" or "MWF" used for class/course events (NOT custom ones.. that is below) returns days in an array with the proper format ex: ["TU", "TH"] | function getCourseEventDays(meetings) {
let meet = meetings.split(' ')[0];
let days = [];
for (let i = 0; i < daysOfWeek.length; i++) {
if (meet.includes(daysOfWeek[i])) {
days.push(translateDaysForIcs[daysOfWeek[i]]);
}
}
return days;
} | [
"function getAllMeetingDays(firstDay, daysInMonth, day) {\n let result = [];\n let span = 0;\n let span2 = 0;\n // Read in a config file...?\n // Get the span between the meeting days\n if (day === 0) // Sun\n span = 3;\n else if (day === 3) // Wed\n span = 4;\n else\n t... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |