query stringlengths 9 34k | document stringlengths 8 5.39M | negatives listlengths 19 20 | metadata dict |
|---|---|---|---|
Predicate that returns true if the value lies within the span of the given range. The left and right flags control the use of inclusive (true) or exclusive (false) comparisons. | function inrange(value, range, left, right) {
var r0 = range[0], r1 = range[range.length-1], t;
if (r0 > r1) {
t = r0;
r0 = r1;
r1 = t;
}
left = left === undefined || left;
right = right === undefined || right;
return (left ? r0 <= value : r0 < value) &&
(right ? value <... | [
"function inrange(value, range, left, right) {\n let r0 = range[0], r1 = range[range.length - 1], t;\n if (r0 > r1) {\n t = r0;\n r0 = r1;\n r1 = t;\n }\n left = left === undefined || left;\n right = right === undefined || right;\n return (left ? r0 <= value : r0 < value) && (right ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
To free the lease if it is no longer needed so that another client may immediately acquire a lease against the container or the blob. | async releaseLease(options = {}) {
var _a, _b, _c, _d, _e, _f;
const { span, updatedOptions } = createSpan("BlobLeaseClient-releaseLease", options);
if (this._isContainer &&
((((_a = options.conditions) === null || _a === void 0 ? void 0 : _a.ifMatch) && ((_b = options.conditions) ==... | [
"function releaseLease(container, blob, leaseId, options, _) {\n var blobService = getBlobServiceClient(options);\n __.extend(options, getStorageBlobOperationDefaultOption());\n \n options.container = container;\n options.blob = blob;\n options.leaseId = leaseId;\n options.tips = $('Release... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Create chart SVG layer element | createLayer(width, height) {
let layer = document.createElementNS('http://www.w3.org/2000/svg', 'svg');
layer.setAttribute('xmlns', 'http://www.w3.org/2000/svg');
layer.setAttribute('width', width + '%');
layer.setAttribute('height', height + '%');
layer.setAttribute('viewBox', '... | [
"_createSVG() {\n\t\t\treturn d3.select(this._container)\n\t\t\t\t.append('svg');\n\t\t}",
"drawSvgSymbol() {\n const group = document.createElementNS('http://www.w3.org/2000/svg', 'g');\n group.setAttributeNS(null, 'transform', 'translate(50, 50)');\n\n if (this.type === \"X\") {\n const line1 = do... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Remove a section from a form | function removeSection(form, sectionId) {
// Scan sections
form.sections.forEach(function(section,key) {
if(section.id === sectionId) {
form.sections.splice(key,1);
}
});
return form;
} | [
"function removeSection(form, sectionId) {\n\n // Scan sections\n form.sections.forEach(function (section, key) {\n if (section.id === sectionId) {\n form.sections.splice(key, 1);\n }\n });\n\n return form;\n\n}",
"forgetAddSectionForm() {\n delete this.addSectionForm;\n $('#ca-addsection').r... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Row component takes in title of row , fethUrl of the row ( example netflix originals) , isLargeRow ( only first row is large poster) | function Row({title,fetchUrl,isLargeRow = false}) {
//movies list stores get result of API
const[movies,setMovies] = useState([]);
const posterRow = useRef(null);
// Use Effect to fetch data on change of fetchUrl
useEffect(() => {
async function fetchData() {
const request = a... | [
"function RenderRow() {}",
"renderRow (rowData) {\n if (rowData.link.match(/\\.(jpg\\png\\gif)/g)) {\n return (\n <View>\n <Image\n source={{ uri: rowData.link }}\n style={{width: windowWidth, height: windowWidth}} />\n </View>)\n } else {\n return null... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
handler for removing given workstation from workgroup | removeWorkstation(id){
this.props.actions.removeWorkstationsFromWorkgroup([id]);
} | [
"removeWorkstations(){\n\t\tthis.props.actions.removeWorkstationsFromWorkgroup(this.props.selectedWorkstations);\n\t}",
"removeWorkout(context, workoutId) {\n context.commit('removeWorkout', workoutId);\n context.commit('updateWorkouts');\n }",
"removeFromSchedule()\n\t{\n\t\t//Send POST Request To... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
5. Write a function to find longest substring in a given a string without repeating characters except space character. If there are several, return the last one. Consider that all letters are lowercase. | function longestSubstringWithoutRepeatingCharacters(str) {
let max = '';
for (let i = 0; i < str.length; i++) {
let j = i;
let current = '';
while (current.indexOf(str[j]) == -1 || str[j] == ' ') {
if (j == str.length) break;
current += str[j];
j+... | [
"function longestSubstring(str) {\n longest = '';\n strTemp = '';\n for (i = 0; i < str.length; i++) {\n for (j = 0; j < str.length; j++) {\n if (strTemp.indexOf(str[j]) !== -1) {\n i = str.indexOf(str[j], i) + 1;\n strTemp = '';\n } else {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Here the form can be processed in parallel, most new save actions should be added in this function. | function saveForm() {
return saveCompanySite()
.then(saveInternalNumbers);
} | [
"_saveChangesForFormBuilder() {\n if (self.store && _.isFunction(self.updateForm)) {\n const state = self.store.getState();\n //fetch stores that have pendEdits\n let {formsStore, fieldsStore} = self.getStores(state);\n let appId;\n let tableId;\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Add the event for the changefreq elements | function createChangeFreqField($tr) {
$div = $tr.find('.sitemapitem-changefreq');
$input = $frequencyField.clone();
$input.val($div.data('value'));
$div.html('');
$div.append($input);
$input.change(
function(event) {
... | [
"async function frequencyChanged() {\n config.changeFrequency = {change: false, newTime: 0};\n}",
"function changeFreq(_osc, _freq){\n _osc.freq(_freq);\n}",
"async function getNewFrequency() {\n return config.changeFrequency;\n}",
"function onFreqSub1orPhyTypeChange(inst)\n{\n setPhyIDChannelPage(i... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Add message to database | function addMessageToDb() {
const messageRef = database.ref('messages/');
let messageContent = document.querySelectorAll('input.message-type-area')[0].value;
let Message = {
receiver: ownerKey,
senderKey: currentUser,
senderName: senderName,
... | [
"function addMessage(data) {\n var pool = db.pool; // obtain database login attributes\n pool.getConnection(function (error, connection) {\n connection.query(\n 'INSERT INTO messages(reason, message, email, date) VALUES(?,?,?,?)',\n [data[0], data[1], data[2],data[3]],\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
view muted accounts. Redirects the user to the muted accounts list. | MutedAccounts() {
this.props.navigation.navigate('MutedAccounts');
} | [
"function muteTabs()\n{\n// adapted from https://github.com/danhp/mute-tab-chrome/blob/master/src/background.js\n chrome.windows.getAll({populate: true},\n\t\t\t function(windowList) {\n\t\t\t windowList.forEach(function(window) {\n\t\t\t\t window.tabs.forEach(function(tab) {\n\t\t\t\t\t\tif (tab.audible ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Map Generation Function Handles everything related to map generation options object bool generate, generate the map? default true if !generate: 2D array data, map data to replace the map with sPos spawn, player spawn position else: int w, map width int h, map height object rooms, room options, defaults to no rooms (fal... | generate (options, seed) {
options = typeof options === 'object' ? options : {};
//Are we actually generating a new map or reusing an existing one?
if(options.generate === false) {
this.w = options.data[0].length;
this.h = options.data.length;
}
//Map dimensions
this.w = typeof options.w === 'numbe... | [
"generateMap() {\n const structureChance = 0.025;\n const minFoodChance = 0.01;\n const maxFoodChance = 0.1;\n const minHarvestRate = 30;\n const maxHarvestRate = 150;\n const halfWidth = Math.floor(this.mapWidth / 2);\n const halfHeight = Math.floor(this.mapHeight /... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Disconnects and hangs up the call. Video call is disconnected but anyone can still chat in here. This is because chats are stored in rooms of firebase databases. | async function hangUp(e) {
//close localStream
const tracks = document.querySelector('#localVideo').srcObject.getTracks();
tracks.forEach(track => {
track.stop();
});
// Close Remote Stream
if (remoteStream) {
remoteStream.getTracks().forEach(track => track.stop());
}
/... | [
"function disconnect() {\n chatPlugin.chatDisconnect(function (e, error) {\n console.log(\"disconnect callbak:\", e, error)\n document.querySelector('#status').innerText = \"Status: Disconnected from chat\";\n });\n\n }",
"function endChat() {\n\tconsole.log('Removing self f... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
2. The call back should loop through the response and console.log every berry name | function getAllBerriesCallback(response){
console.log(response.count);
response.results.forEach(function(berry){
console.log(berry.name);
})
} | [
"function getAllBerriesCallback(response){\n\tconsole.log(response.count)\n\tresponse.results.forEach(function(berry){\n\t\tconsole.log(berry.name);\n\t})\n}",
"function ready(response){\n response.data.forEach(function(item){\n console.log(item.name);\n });\n}",
"function gatherHorseNames(cdObject){\n //... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
FUNCTION: fixUpInsertionPoint DESCRIPTION: moves the cursor to a place where a "safe" insertion is possible, note: only call this function if inserting a table, layer, or form into the document in any extension that is not an object. (In the case of objects, the selection is automatically fixed. Other cases don't need ... | function fixUpInsertionPoint() {
moveIPToOutsideOfParagraphToPreventInvalidHTML();
backUpCursorIfAfterNonBreakingSpaceInTableCell();
} | [
"function documentCreateInsertionPoint(top, seed, seedOffset)\n{\t\n\t// a/c for special case of a reference to a text node rather than a reference within it\n\tif((seed.nodeType == Node.ELEMENT_NODE) && (seed.childNodes.length > seedOffset) && (seed.childNodes[seedOffset].nodeType == Node.TEXT_NODE))\n\t{\n\t\tsee... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get the basename of a path. Behaves in a way analogous to Linux's basename command. | function basename(path) {
var SEPARATOR = '/';
path = path.trim();
while (path.endsWith(SEPARATOR)) {
path = path.slice(0, path.length - 1);
}
var items = path.split(SEPARATOR);
return items[items.length - 1];
} | [
"function basename(uri) {\n return posixPath.basename(uri.path);\n }",
"function baseName(path) {\n return path.split('/').reverse()[0];\n}",
"function filename(path) {\n if (path.endsWith(\"\\\\\")) {\n return path.split(\"\\\\\").slice(-2)[0]\n } else {\n return path.split(\"\\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Step 1.5: Run function removeExcessColumns to remove unnecessary columns, you must enter the Columns as numbers and not letters Column A is 1, B is 2 and so on | function removeExcessColumns() {
var ui = SpreadsheetApp.getUi(); // Same variations.
var result = ui.prompt(
'Please enter the columns you would like deleted:',
'(separate your entries with commas and use CAPITAL letters)',
ui.ButtonSet.OK_CANCEL);
var button = result.getSelecte... | [
"function remove_cols(num_cols_retain)\n{\n for(var i=num_cols_retain;i<COLS.length;i++)\n {\n COLS[i].remove();\n }\n COLS = COLS.slice(0,num_cols_retain);\n}",
"function removeInterpreterTableColumns(number) {\r\n\tcurrentK=getSetColumnCount();\r\n\r\n\tcurrentK=currentK-number;\r\n\tif (curr... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
add a equipment object to the blockchain state identifited by the equipmentId | async Registerequipment(stub, equipmentId, companyName) {
let equipment = {
id: equipmentId,
companyName: companyName,
type: 'equipment',
};
await stub.putState(equipmentId, Buffer.from(JSON.stringify(equipment)));
//add equipmentId to 'equipment' ke... | [
"addEquipment() {\n\n this.userData.generationData[dataIndex][\"equipment\"].push(0);\n this.userInterface.showSceneProperties(this);\n }",
"addEquipment(character, equipment) {\n\t\tthis.addItem(character, equipment);\n\t\tthis.equipItem(character, equipment);\n\t}",
"function addEquipment(ite... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
path: path of wiki directory options: parentPaths: array of parent paths that we mustn't recurse into readOnly: true if the tiddler file paths should not be retained | function loadWikiTiddlers(wikiPath,options) {
options = options || {};
options.prefix = options.prefix || '';
const parentPaths = options.parentPaths || [];
const wikiInfoPath = path.resolve(wikiPath,$tw.config.wikiInfo);
let wikiInfo;
let pluginFields;
// Bail if we don't have a wiki info file
if(fs.ex... | [
"async getItemsFromFolder(relativePath) {\n try {\n if (!this.noteTree){\n return [];\n }\n // return a Promise that resolves to a list of UNotes\n const toFolder = (item) => {\n return new UNote(item, vscode.TreeItemCollapsibleState.C... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Determine whether the given properties match those of a `HeaderMatchPatternProperty` | function CfnRuleGroup_HeaderMatchPatternPropertyValidator(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 r... | [
"function CfnWebACL_HeaderMatchPatternPropertyValidator(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 objec... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Launch Ball on click | function launchBall() {
if (oneClick == 1) {
//** trig caclulations for launch only
var changeX = x - paddleX;
changeX = changeX - paddleCenter;
var deltaY = Math.sqrt(Math.pow(paddleCenter, 2) - Math.pow(changeX, 2));
var theta = Math.atan2(deltaY, changeX);
dy = (deltaY * (1 / Math.tan(the... | [
"launchBall(){\r\n if(!this.ballLaunched){\r\n this.ball.setVelocityX(250);\r\n this.ball.setVelocityY(-200);\r\n }\r\n \r\n this.ballLaunched = true;\r\n this.pressToLaunchText.visible = false;\r\n }",
"function doBallClick( evt )\n{\n\t// Remove the cl... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
inArray = [name, employee , base salary, rating] out Array = [name, %STI, base + STI, total Bonus] | function newArray(inArray){
var outArray =[];
outArray.push(inArray[0]);
outArray.push(stiCalc(inArray));
var totalBonus = (parseFloat(outArray[1]) * parseFloat(inArray[2]));
outArray.push(parseFloat(inArray[2]) + parseFloat(totalBonus));
outArray.push(totalBonus);
console.log(outArray);
} | [
"function bonusCalculation(arrEmployees){\n var employeeBonus = [];\n var bonus = 0;\n employeeBonus[0] = arrEmployees.name;\nswitch(arrEmployees.reviewRating) {\n case 1:\n bonus = 0;\n break;\n case 2:\n bonus = 0;\n break;\n case 3:\n bonus = .04;\n break;\n case 4:\n bonus = .06;\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
FILTERING LIST set an unfiltered list if no filtering is done (add resto page) | setFilteredListToAllResto(state) {
state.filteredList = state.restoList;
} | [
"function filterList() {\n let newlist;\n if(houseFilter === false || houseFilter === 'All'){\n newlist = allStudents;\n }\n else{\n newlist = filterByHouse(allStudents, houseFilter);\n }\n displayList(newlist); \n}",
"filterForFrontend() {}",
"applyFilter() {\n this.filterValue = this.filter... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Transforms an array of object paths into a request xml body. Does not do placeholder substitutions. | function writeObjectPathBody(objectPaths) {
const actions = [];
const paths = [];
objectPaths.forEach(op => {
paths.push(op.path);
actions.push(...op.actions);
});
// create our xml payload
return [
`<Request xmlns="http://schemas.microsoft.com/sharepoint/clientq... | [
"function flattenToParams(obj) {\n return Y.Array.map(flattenToTuples(obj), function(x) {\n return encodeURIComponent(x[0]) + '=' + encodeURIComponent(x[1]);\n }).join('&');\n}",
"function chainTransform (obj, path = []) {\n return flatmap(Object.keys(obj), function (key) {\n if (key === 'required') {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Function to get line string for the full star part. | function getLineFullStar(N) {
let lineStr="";
let nbStars=(N*2)+1;
lineStr+=generateNChar(nbStars,'*');
let nbSpaces = (N==1) ? 1:((N-1)*2)-1;
lineStr+=generateNChar(nbSpaces,' ');
lineStr+=generateNChar(nbStars,'*');
return lineStr;
} | [
"function asterLine(count){\n var asterisks = '';\n for(var i = 0; i < count; i++){\n asterisks += '*';\n }\n return asterisks;\n}",
"function multiLineString (f) {\r\n\t//return f.toString().slice(15,-3) // (14,-3) without ! // (15,-3) with !\r\n\treturn f.toString().replace(/^[^\\/]+\\/\\*!?/, '').repl... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Initialize autologout popup timer and logout reset timer listener | function initAutoLogout(resettime,logouttime) {
// Do not run pop-up alert if on the login page and not logged in
if ($('#redcap_login_a38us_09i85').length || $('#redcap_login_openid_Re8D2_8uiMn').length) return false;
// Set ajax call at timed interval that is triggered by typing, clicking, or mouse movement (to... | [
"async resetLogoutTimer() {\n if (this.logoutTimer) clearTimeout(this.logoutTimer);\n const timeLeft = this.sessionInfo.maxAgeSeconds;\n const autoLogout = this.autoLogoutSeconds;\n const timeout = timeLeft < autoLogout ? timeLeft / 2 : timeLeft - autoLogout;\n const dialogSeconds = timeLeft - timeou... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Take one or more parsed BPMN objects and return an array of unique task types. | static async getTaskTypes(processes) {
const processArray = Array.isArray(processes)
? processes
: [processes];
return BpmnParser.mergeDedupeAndSort(await Promise.all(processArray.map(BpmnParser.scanBpmnObjectForTasks)));
} | [
"getServiceTypesFromBpmn(files) {\n if (typeof files === 'string') {\n files = [files];\n }\n return lib_1.BpmnParser.getTaskTypes(lib_1.BpmnParser.parseBpmn(files));\n }",
"async function getOurTypes(KnowledgeBase) {\n\tconst result = [];\n\tKnowledgeBase.forEach(async (element... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Validates if updated shift timings can be saved. Mainly follows below validations: Shift time should be break duration of the shift | handleSave() {
const { employeeAdjacentShifts, startTime, endTime, employeeID, index } = this.state
const currentShift = employeeAdjacentShifts[1];
const previousShiftEndTime = employeeAdjacentShifts[0] ? moment(employeeAdjacentShifts[0].end_time) : null;
const nextShiftStartTime = employeeAdjacentShift... | [
"function check_for_start_time_changed() {\n var start_date_part = NaN;\n if (ui.shift.start_dateBox.value !== \"\") {\n start_date_part = parse_unix_date_part(ui.shift.start_dateBox.value);\n if (isNaN(start_date_part)) {\n alert('\"' + date_text + '\" is not a valid shift start date.');\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Function called when the user selects an option for order by | function selectOrderBy() {
var orderBySel = document.getElementById("order-by-sel");
if (orderBySel.value == "null") {
orderBy = null;
} else {
orderBy = orderBySel.value;
}
checkGroupsSidebar();
getAllGroups();
} | [
"function setUIOrderBy(options, context, params) {\n var orderby = params.orderby;\n $(\".facetview_orderby\", context).val(orderby)\n}",
"function chooseSort()\n{\n var\tselect\t= this;\n var option\t= select.options[select.selectedIndex];\n if (option && option.value != '0')\n {\n\t\tselect.re... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Push a relationship payload for an individual record. This will make the payload available later for both this relationship and its inverse. | push(modelName, id, relationshipName, relationshipData) {
this._pendingPayloads.push([modelName, id, relationshipName, relationshipData]);
} | [
"push(payload) {\n heimdall.increment(push);\n\n let hasData = false;\n let hasLink = false;\n\n if (payload.meta) {\n this.updateMeta(payload.meta);\n }\n\n if (payload.data !== undefined) {\n hasData = true;\n this.updateData(payload.data);\n }\n\n if (payload.links && paylo... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
addition : can dynamically support new tags (add new columns on the fly) Steps are valid as of 2016 November 12th. 0) From Google spreadsheet, Tools > Scriipt Editor... 1) Write your code 2) Save and give a meaningful name 3) Run and make sure "doGet" is selected You can set a method from Run menu 4) When you run for t... | function doGet(e){
Logger.log("--- doGet ---");
var tag = "",
value = "";
try {
// this helps during debuggin
if (e == null){e={}; e.parameters = {code:"cko", tag:"test",value:"-1"};}
code = e.parameters.code;
if (code != "yourCode") return ContentService.createTextOutput("Wrote:\n incor... | [
"function doGet(request) {\n return HtmlService.createTemplateFromFile('Index').evaluate();\n}",
"function doGet() {\n var service = getGitHubService_();\n var template = HtmlService.createTemplateFromFile('Page');\n template.email = Session.getEffectiveUser().getEmail();\n template.isSignedIn = service.ha... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
eslintenable complexity Clear all changeFlags, typically after an update | clearChangeFlags() {
this.internalState.changeFlags = {
// Primary changeFlags, can be strings stating reason for change
dataChanged: false,
propsChanged: false,
updateTriggersChanged: false,
viewportChanged: false,
stateChanged: false,
extensionsChanged: false,
// D... | [
"function resetChangeFlags() {\n waitForChangeEvents();\n firedBeforeChange = firedDelayedChange = false;\n}",
"function resetAllFlags() {\n // Asks the C++ FlagsDOMHandler to reset all flags to default values.\n chrome.send('resetAllFlags');\n showRestartToast(true);\n requestExperimentalFeaturesData();\n}... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Submit the return values of determineRequests to | async submitRequests(requests) {
return Promise.all(
Promise.all(requests.creation.map(x => {
return this.requestCreation(requests.workerType, x);
})),
Promise.all(requests.deletion.map(x => {
return this.requestDeletion(requests.workerType, x);
})),
);
} | [
"runRequests(requests) {\n let params = this.prepareRequests(requests);\n let observable = this.$ajax.post(this.$url.makeApi('Multiple', 'index'), params);\n observable.subscribe((d) => {\n if (typeof (d['Multiple']) === 'undefined') {\n // Call all error callback !\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get all specials based on query string param or the current day | getTodaysSpecialsList() {
const queriedDay = getQueryString('day', window.location.href);
if(queriedDay) {
return Object.keys(this.props.weeklySpecials).filter(key => this.props.weeklySpecials[key].specialDay === toTitleCase(queriedDay));
} else {
return Object.keys(this.props.weeklySpecials).fi... | [
"function extractDate()\n{\n var dateFilter = new URL(window.location.href).searchParams.get(\"date\");\n\n if (dateFilter == null)\n {\n dateFilter = \"\";\n }\n else\n {\n dateFilter = \"?date=\" + dateFilter;\n }\n\n return dateFilter;\n}",
"function getDailySpecial () {\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
UI control function for checking what UI type and setting osc_message | function controlTypeOSCMessage() {
var osc_message = "";
controlType = el.id;
switch (controlType) {
case "cubeControl": // id of UI control
osc_message = ["/material/set", "color", newColor, 0]; // OSC message / action you want to send and the osc-receiver # of the object ... | [
"function controlTypeOSCMessage() {\n var osc_message = \"\";\n controlType = el.id; \n switch (controlType) {\n case \"cubeControl\": // id of UI control\n osc_message = [\"/material/set\", \"color\", newColor, 0]; // OSC message / action you want to send and the osc-receiv... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
this gets the character's Pantheon Purview | function getPantheonPurview() {
var pspPrintBoons = [];
switch (myCharacter.characterPantheon) {
case "Theoi":
myCharacter['pantheonPurview'] = "Arete";
tempOfBoonsPrint.push(areteBoonsForPrint);
pspPrintBoons = areteBoonsForPrint;
break;
case "Yazata":
myCharacter['pantheonPurview'] = "Asha";
tempOfB... | [
"function princeCharming() { /* ... */ }",
"get horseCard_Prize() {return browser.element(\"//android.widget.ScrollView/android.view.ViewGroup/android.view.ViewGroup[1]/android.view.ViewGroup[1]/android.view.ViewGroup[9]/android.widget.TextView[1]\");}",
"function ChordNoteLet(){\n return chordLettersStrip\n}"... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns the mapping of virtual rights to real rights | getVirtualControlRightMappings(){return this.__virtualControlRightMappings} | [
"function rights(es) { return get(Elm.List.filter(isRight)(es)); }",
"function setFileRights(){\n var fileRights = allEnabled();\n //set the Admin rights\n setRight(fileRights,'Admin','New Meeting',false);\n setRight(fileRights,'Admin','Hide',false);\n //set the viewer rights\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
renders the footer (movie info) | _renderFooter() {
const { movie } = this.state
const genres = movie.genres.map(g => g.name)
return (
<Modal.Footer className='trailer-footer'>
<h2>{movie.title}</h2>
{movie.tagline ? <h3 style={{ fontSize: '1em' }}>{movie.tagline}</h3> : null}
<Stars className='stars' count={10... | [
"displayFooter() {\n const { footer } = this.tool.options;\n if (footer) {\n this.out(footer, 1);\n }\n }",
"renderFooter() {\n return null;\n }",
"function renderFooter(gamestate, footer){\r\n\tfooter.innerHTML = \"\";\r\n\tvar gameInfo;\r\n\tswitch(gamestate.phase)... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
searches among the nodes for the endpoint nodes, from there, find the endpoint with the shortest path and return path, null if none are found | searchShortestPathToEnds() {
let shortest = null;
let shortestDistance = Number.MAX_SAFE_INTEGER
for (let i = 0; i < this.graph.nodes.length; i++) {
let node = this.graph.nodes[i]
if (node.id == 2 && node.distance < shortestDistance) {
shortest = node;
... | [
"shortestPath(source, target) {\n for (let node of this.nodes) {\n node.path = [];\n }\n source.path = [source.value];\n\n const toVisitQueue = [source];\n const visited = new Set(toVisitQueue);\n\n while (toVisitQueue.length) {\n const currNode = toVisitQueue.shift();\n if (currNod... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Rerenders viewports that are part of the current layout manager using the matching rules internal to each viewport. If this function is provided the index of a viewport, only the specified viewport is rerendered. | updateViewports(viewportIndex) {
log.trace(
`ProtocolEngine::updateViewports viewportIndex: ${viewportIndex}`
);
// Make sure we have an active protocol with a non-empty array of display sets
if (!this.getNumProtocolStages()) {
return;
}
// Retrieve the current stage
const stag... | [
"updateViewports(viewportsState) {\n OHIF.log.info('LayoutManager updateViewports');\n\n if (!this.viewportData ||\n !this.viewportData.length ||\n this.viewportData.length !== this.getNumberOfViewports()) {\n this.setDefaultViewportData();\n }\n\n // ima... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Updates the data with the subject search input. | function searchSubject() {
search.subjects = $("#subjectsearch").val().split(",");
updateData();
} | [
"function updateCaseSubject() {\n // If there is a patient selected already, then, replace the subject field value with patient name\n if ($scope.patientData && !$scope.formData.subjectInput && $scope.patientData.name) {\n $scope.formData.subjectInput = $filter('name... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Find player's Item descriptions in inventory | function itemsInInventoryByAlias (playerPC, alias) {
var returnDescription;
alias = alias.toLowerCase();
if(playerPC['inventory']){
itemIDsInInventory = Object.keys(playerPC['inventory']);
} else {
return returnDescription;
}
itemsInInventory = [];
for(var i=0; i< itemIDsInInventory.length;i++)... | [
"function findItemInInventory(itemName)\n{\n\t\n\tlet items = [];\n\t\n\tfor(var i = 0; i <= 41; i++)\n\t{\n\t\tlet item = character.items[i];\n\t\t\n\t\tif(item != null)\n\t\t{\n\t\t\titem.slot = i;\n\t\t\tif(item.name == itemName)\n\t\t\t{\n\t\t\t\t\n\t\t\t\titems.push(item);\n\t\t\t}\n\t\t}\n\t}\n\t\n\treturn it... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Query elastic for all brands, query analytics, and if no records found, enqueue the brand for ingestion | function reEnqueueBrandsWithZeroAnalyticDatasets() {
//Get all brands
searchAll('brands', 'brand', function(response) {
var hits = response.hits;
var tetherEmail;
var _isBrandIngestible;
for (var i = 0; i < hits.length; i++) {
_isBrandIngestible = isBrandIngestible(hi... | [
"createBrandResults(brand) {\n if (!_.isEmpty(existing = this.refineBrand(brand))) {\n console.log(`exists: ${existing._id}`)\n return existing._id;\n }\n\n const thread = Math.floor(Math.random() * 100000);\n console.log(`(${thread}) Running brand query`);\n\n const newResult... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
React lifecycle method. This method begins the animation by calling setPosition() on a given interval. | componentDidMount() {
this.mounted = true;
this.animationID = setInterval(() => this.setPosition(), 17); // 17ms interval to approximate a 60fps animation
} | [
"componentDidMount() {\n this.animation.play();\n }",
"initialize() {\n if (this.props.animated) {\n this.setInterval();\n } else {\n this.setState({ value: this.props.value });\n }\n }",
"componentDidMount() {\n this.animate();\n }",
"componentWillM... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
function to query and view order history | function viewOrderHistory(username, callback) {
var queryVar = username;
var queryStr = "SELECT `order`.`order_id`, `order_date`, `order_detail`.`product_id`, `product_name`, `product_quantity`, `product_category`, `product_image_link`,`unit_price` "
+ " FROM `order`, `order_detail`, `product` "
+ " WHERE ... | [
"function getOrdersHistory(req, res) {\n var user = req.user.username;\n var ordersFilter = {customer: user, STATUS: 1};\n\n findOrders(ordersFilter,{dateOut:-1}, function(ordrs){\n if (ordrs) {\n setOrdersTotalPrice(ordrs);\n res.send( {\n screenName:'history', ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Populates grade level map i.e. 0: A 1: A, A 2: 90, 91, ..., 100 | function populateGradeLevelMap() {
let id = 0;
for ([index, assessment] of assessments.entries()) {
assessGradeLevelMap[assessment.trim()] = {};
for ([jndex, grade] of grades.entries()) {
assessGradeLevelMap[assessment.trim()][grade] = 0;
}
}
... | [
"function populateGradeLevelMap() {\n let id = 0;\n for ([index, assessment] of assessments.entries()) {\n assessGradeLevelMap[assessment.trim()] = {};\n for ([jndex, grade] of grades.entries()) {\n assessGradeLevelMap[assessment.trim()][grade] = 0;\n }\n }\n}",
"function ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Opcode 7 is less than: if the first parameter is less than the second parameter, it stores 1 in the position given by the third parameter. Otherwise, it stores 0. | async opcode7() {
this.writeData(
Number(this.getParameter(1) < this.getParameter(2)),
3);
this.position += 4;
} | [
"opcode7() {\n\n this.writeData(\n Number(this.getParameter(1) < this.getParameter(2)),\n this.position + 3);\n\n this.position += 4;\n }",
"async opcode7() {\n this.writeData(\n Number(this.getParameter(1) < this.getParameter(2)),\n 3);\n\n this.position += 4;\n }",
"function ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Default values for styles | function defaultStyles(){
return {
classes: {
'with-3d-shadow': true,
'with-transitions': true,
'gallery': false
},
... | [
"constructor() {\n /**\n * @private\n */\n this._styles = {};\n for (let styleName in Style.defaultValues) {\n this._styles[styleName] = null;\n }\n }",
"static get styles(){return[]}",
"static withDefaultStyle(overrides) {\r\n return Object.assign({ textColor: \"black\", textSi... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
7)Create a function to display the city name if the string begins with "Los" or "New" otherwise return blank. | function sevenEx(cityName) {
let newCity = cityName.slice(0, 3);
// console.log(newCity);
newCity = newCity.toLowerCase();
if (newCity == "los" || newCity == "new") {
console.log(cityName);
} else {
console.log("");
}
} | [
"function Display_city(cityname) {\n if(cityname.startsWith('Los')||cityname.startsWith('New')){\n return cityname;\n }else{\n return ''\n }\n \n}",
"function displayCityName(str) {\n if (str.length >= 3 && ((str.substring(0, 3) == \"Los\") || (str.substring(0, 3) == \"New\"))) {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Dispatch action to cancel the saveEntities request with matching correlation id. | cancelSaveEntities(correlationId, reason, entityNames, tag) {
if (!correlationId) {
throw new Error('Missing correlationId');
}
const action = new SaveEntitiesCancel(correlationId, reason, entityNames, tag);
this.dispatch(action);
} | [
"cancel(){\n\t\t\tthis.sendAction('addColono')\n\t\t}",
"cancel(id) {}",
"@action\n handleCancelSaveField(id) {\n this.setValue(id, this.initialData[id]);\n this.setFieldState(id, 'showSave', false);\n }",
"_cancelPending(id) {\n let old = this._pendingResults.get(id);\n if (old !== unde... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
EFFECTS: returns the hash of an entire block | hash(block) {
return sha256(stringify(block));
} | [
"calculateBlockHash(){\n return SHA256(this.index + this.timestamp + JSON.stringify(this.data) + this.prevHash).toString();\n }",
"get hash() {\n const block_str = JSON.stringify(this);\n const hash = crypto.createHash('SHA256');\n hash.update(block_str).end();\n return hash.digest... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
======================================== | CHECK SEARCH QUERY | On search query input | change, remove disabled if query isn't | empty ========================================= | function checkSearchQuery() {
$inputs.each(function() {
// identify our elements
$input = $(this);
$form = $input.closest('form');
if (($input.val() == '') || ($input.val() == 'Search content, people, units, classes or applications')) {
$input.v... | [
"function checkText() {\n if($(\"query\").value) {\n $(\"go-search\").disabled = false;\n } else {\n $(\"go-search\").disabled = true;\n }\n }",
"function UpdateSearchButton(){\n\tif (QueryField != null && QueryField != undefined){\n\t\tSearchButton.disabled = QueryField.value.leng... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
.exist Asserts that the target is not strictly (`===`) equal to either `null` or `undefined`. However, it's often best to assert that the target is equal to its expected value. expect(1).to.equal(1); // Recommended expect(1).to.exist; // Not recommended expect(0).to.equal(0); // Recommended expect(0).to.exist; // Not r... | function assertExist () {
var val = flag(this, 'object');
this.assert(
val !== null && val !== undefined
, 'expected #{this} to exist'
, 'expected #{this} to not exist'
);
} | [
"function existy(x){\n return x != null \n}",
"function assertWrapperExists() {\n const obj = this._obj\n\n new Assertion(obj).to.be.VueTestAnyWrapper\n\n this.assert(\n obj.exists() === true,\n 'expected #{this} to exist',\n 'expected #{this} not to exist'\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
filter.zone = 0 > local to pzp filter.zone = 1 > local to pzh filter.zone = 2 > remote filter.zone = 1 > no constraint filter.name > match service including this string in displayName | function whhFindServices(serviceType, callbacks, timeout, filter) {
var timedOut = false;
var zone = -1;
var filterName = null;
if(filter) {
if(filter.zone) {
zone = filter.zone;
}
if(filter.name) {
filterName = filter.name;
}
}
//alert('wh... | [
"name(item, filters) {\n return item.name.toLowerCase().includes(filters.name.toLowerCase());\n }",
"function ServicerNameFilter() {}",
"filerPropertyInUse(opt){\n let vm = this;\n \n let oldLabel = opt.old;\n let newLabel = opt.new;\n\n let newFilter =... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Prune to Level is a debugging aid for opjects that are too deep or cause a circular reference error in JSON.stringify | function prune2level(obj, level) {
var top_obj = {};
var t;
for (key in obj) {
t = typeof obj[key];
if (t !== "undefined" && t !== "object" && t !== "function") {
top_obj[key] = obj[key];
}
if (level > 1 && t === "object" && obj[key] !== null) {
top_obj[key] = prune2level(obj[key], level -1);
... | [
"static set strippingLevel(value) {}",
"static get strippingLevel() {}",
"function resetLevel() {\n level.resetLevel();\n }",
"inspect(depth, opts) {\n // We inspect in the simplified version of this object t\n return this.toJSON();\n }",
"printTree() {\n const cloneTree = ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
setDevice() called when an input device is selected from the devices list. | function setDevice(id,label){
audiosourceselection = id;
audiosourcelabel=label;
devicesReady();
} | [
"_setupDeviceChange() {\n\t\tlet $deviceSelection = this.deviceSelection.render();\n\t\tthis.$control.find( 'device-selection' ).replaceWith( $deviceSelection );\n\n\t\tthis.deviceSelection.$inputs.on( 'change', () => {\n\t\t\tconst selectedDevice = this.deviceSelection.getSelectedValue();\n\t\t\tlet settings,\n\t\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Exit a parse tree produced by AgtypeParsertypeAnnotation. | exitTypeAnnotation(ctx) {
} | [
"exitAgType(ctx) {\n }",
"exitProc_decl_in_type(ctx) {\n\t}",
"exitType_declaration(ctx) {\n\t}",
"exitSubprog_decl_in_type(ctx) {\n\t}",
"exitCompile_type_clause(ctx) {\n\t}",
"function flowAfterParseVarHead() {\n if (match(TokenType.colon)) {\n flowParseTypeAnnotation();\n }\n}",
"function flo... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Generates the card and appends to the results | function generateCard(card, title, description, link) {
// Adds card title and description to the card
card.appendChild(title);
card.appendChild(description);
// Add card to link
link.appendChild(card);
// Adds card to the result div tag
appendToResults.appendCh... | [
"function makeCard(result){\n $('section').append(result.html);\n }",
"function generateCards() {\n dubbleCards.forEach((card) => {\n const image = createCard(card.image, card.type);\n container.appendChild(stringToHTML(image));\n })\n}",
"function buildCards(data) {\n // Perform... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Pipe events from EventSource A to EventSource B. If `eventTypes` are provided, bind only those types. Otherwise, pipe any event. | pipe(eventSource, ...eventTypes) {
if (eventTypes.length) {
eventTypes.forEach((type) => eventSource.on(type, (data) => this.emit(data)));
return this;
}
eventSource.any(this);
return this;
} | [
"pipe(eventSource, ...eventTypes) {\n\t if (eventTypes.length) {\n\t eventTypes.forEach((type) => eventSource.on(type, (data) => this.emit(data)));\n\t return this;\n\t }\n\n\t eventSource.any(this);\n\t return this;\n\t }",
"function pipeEvents(source, destination, event) {\n source.on(ev... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Handle Assignmets Convert value, push to symbolize array if is Input assign | function handleAssignmentExp(pred) {
var _convertedValue = convertValueToInputVars(pred.value, true, false);
var _result = parseInt(convertValueToInputVars(pred.value, true, true));
if (isInput(pred.name)) {
pred.value = _result;
symbolize.push(pred);
}
if (isInputArray(pred.name))... | [
"function aa_deser_addBasicValueToArray(cmd, procLog) {\n\t\t var arr = nodesByKey[cmd.ownerKey];\n\t\t \n\t\t arr[cmd.arrayIndex] = cmd.value;\n\t\t aa_deser_log(cmd, procLog);\n\t\t}",
"convertStringExpressions(str) {\n if (str.length === 0) return 0;\n \n let assignmentArray = [];\n assignm... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
compare computed styles at this node and apply the differences directly | function applyStyles(sourceNode, targetNode) {
var sourceStyle = root.getComputedStyle(sourceNode);
var targetStyle = root.getComputedStyle(targetNode);
for (var prop in sourceStyle) {
if (!cssIgnoreDiff[prop] && !isFinite(prop)) {
// note that ch... | [
"function diffStyles(before, after) {\n\treturn diffJSONStyles(toJSON(before), toJSON(after))\n}",
"function apply_styles(original_node, unstyled_node)\n{\n var cssStyles = getComputedStyle(original_node);\n var unstyledStyles = getComputedStyle(unstyled_node);\n var computedStyleStr = unstyled_node.getA... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Handles drop into droppable component and updates application state Create new component based on draggable name and type Create an array of indexes to determine position in state Loop through array of indexes and build out path to update Create ImmutableJS object and update path with new component Save state | onDragDrop(event, containerId) {
const name = event.dataTransfer.getData('id');
const type = event.dataTransfer.getData('type');
const newComponent = this.generateComponent(name, type);
const containerArray = containerId.split('_');
containerArray.shift(); // ignore first param, ... | [
"handleDragEnd({ destination, source, draggableId, type }) {\n if (!destination) {\n return;\n }\n\n if (\n source.droppableId === destination.droppableId &&\n source.index === destination.index\n ) {\n return;\n }\n\n if (type === \"list\") {\n const { listOrder } = this.... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
check local storage (change the color of star) | function checkLocalStorage() {
var flag = false;
var favoriteArray = localStorage.getItem("key");
if (favoriteArray) {
favoriteArray = JSON.parse(favoriteArray);
for (var i = 0; i < favoriteArray.length; i++) {
if (favoriteArray[i] == currSymbol) {
... | [
"function saveColor(color){\n localStorage.setItem(\"themeColor\",JSON.stringify(color));\n}",
"function myMethod( )\n {\n\n var blackWhite = localStorage.getItem(\"blackWhite\");\n\n if(blackWhite == 'black'){\n $('h1.title').css(\"color\",\"#181818\");\n }else if(blackWhite... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Extracts emails from staff attendees | function prepareStaffAttendees() {
var emails = [];
if ($scope.consultation.staffAttendees.length) {
for (var i = $scope.consultation.staffAttendees.length - 1; i >= 0; i--) {
emails.push($scope.consultation.staffAttendees[i].email);
};
}
return emails;
} | [
"function extractAllEmails (feed)\n{\n return feed.match(/([a-zA-Z0-9._-]+@[a-zA-Z0-9._-]+\\.[a-zA-Z0-9._-]+)/gi);\n}",
"function extractEmails(chunk) {\n\t return chunk.match(/\\b[A-Z0-9._%+-]+@[A-Z0-9.-]+\\.[A-Z]{2,6}\\b/ig);\n\t}",
"extractEmails(text){\n return text.match(/([a-zA-Z0-9._-]+@[a-zA-Z0... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Unescapes a JSON pointer. | function unescapeJsonPointerToken(token) {
if (typeof token !== 'string') {
return token;
}
return querystring_browser__WEBPACK_IMPORTED_MODULE_10___default().unescape(token.replace(/~1/g, '/').replace(/~0/g, '~'));
} | [
"function unescapeJsonPointerToken(token) {\n\t if (typeof token !== 'string') {\n\t return token;\n\t }\n\t return token.replace(/~1/g, '/').replace(/~0/g, '~');\n\t}",
"function unescapeJsonPointerToken(token) {\n if (typeof token !== 'string') {\n return token;\n }\n return external_querystring_bro... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
callback to load the waysOfContact | function initWaysOfContact(loadedWaysOfContact) {
// console.log("initWaysOfContact: " + initWaysOfContact);
originalWaysOfContact = loadedWaysOfContact;
} | [
"function loadContacts() {\n\n\t\t/**\n\t\t * retrievePersonalAddressBook(success, failure) Retrieve all entries of\n\t\t * the user's personal address book\n\t\t * \n\t\t * @params <function> success, <function> failure\n\t\t */\n\t\tKandyAPI.Phone\n\t\t\t\t.retrievePersonalAddressBook(\n\t\t\t\t\t\tfunction(resul... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Function Purpose : A helper function to creat a 32 long array of 0s Returns : an array of 32 0s Arguments : NONE Throws : NOTHING Notes : See Also : | function gen32bitZeroArray(){
var bits = [];
for(var i = 0; i < 32; i++){
bits[i] = 0;
}
return bits;
} | [
"function getInitArr(length) {\n var arr = new Float32Array(length);\n for (var i = 0; i < length; i++) {\n arr[i] = 0;\n }\n return arr;\n }",
"function createZeroArray(l) {\n let cza_toreturn = [];\n let czactr = 0;\n for (czactr = 0; czactr < l; czactr += 1) {\n cza_toreturn.p... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This method is called to check whether bonus round is activated or not. | function checkForBonusRound() {
if (isBonusRoundActivated) {
getSlotContainer().classList.add("bonus-round");
setTimeout(function () {
document.getElementsByClassName("start-button")[0].disabled = false;
ativeBonusRound();
}, 3000);
}
... | [
"function checkForBonusRound() {\n\n if (isBonusRoundActivated) {\n getSlotContainer().classList.add('bonus-round');\n setTimeout(() => {\n document.getElementsByClassName('start-button')[0].disabled = false;\n ativeBonusRound();\n }, 3000);\n\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Function to implement the trigram tagging method | function trigram_Tagger(inputArr) {
// Create trigram list for the input array
$.post("Info_retrieval/triGram_Tagger.php", {query:inputArr}, function(data,status) {
//alert("Trigram Tagger: " + data);
retrieveAnswerNGram(data,3);
});
} | [
"function nGram_Tagger(input)\t{\n\n\t// make a call to the regex function to remove all punctuations from the sentence\n\tvar regexInput = regexPunct(input);\n\tvar trimmedRegexInput = $.trim(regexInput);\n\t\n\t/*$.post(\"Info_retrieval/removeStopwords.php\", {inputQuery:trimmedRegexInput}, function(data,status)\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Function to calculate the visibility, which returns visibility triangle points. There are two passes. In the first pass, openSegments array will be populated as the ray from point object hits the starting endpoint, and removed if it hits non starting end point. As the array of open segments is populated, its contents a... | function calculateVisibility(origin, endpoints) {
let openSegments = [];
let outputTrianglePoints = [];
let beginAngle = 0;
// Sort the endpoints in terms of their angles
endpoints.sort(endpointAngleComparison);
for(let pass = 0; pass < 2; pass += 1) {
for (let i = 0; i < endpoints... | [
"function calculateVisisbilityPolygon(sourceX, sourceY)\n {\n visibilityPolygonPoints = []\n for(let edge of edges)\n {\n for(let i = 0; i < 2; i++)\n {\n var delta_x = (i == 0 ? edge.start.x : edge.end.x);\n var delta_y = (i == 1 ? edge.start.y : edge.end.y);\n\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Move a block of the falling tetromino left, right or down | function slide(block, dir) {
var new_x = tetromino.cells[block][0] + move_offsets[dir][0];
var new_y = tetromino.cells[block][1] + move_offsets[dir][1];
return [new_x, new_y];
} | [
"moveBlock(block) {\n block.state.pos.add(block.state.spe);\n }",
"function tetraMove(dx, dy, t) {\n t = { center: { x: t.center.x + dx,\n y: t.center.y + dy },\n blocks: t.blocks };\n bset_1.BSet.blocksMove(dx, dy, t.blocks);\n }",
"function moveRight() {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
A wrapper around `compileDirective` which depends on render2 global analysis data as its input instead of the `R3DirectiveMetadata`. `R3DirectiveMetadata` is computed from `CompileDirectiveMetadata` and other statically reflected information. | function compileDirectiveFromRender2(outputCtx, directive, reflector, bindingParser) {
var name = identifierName(directive.type);
name || error("Cannot resolver the name of ".concat(directive.type));
var definitionField = outputCtx.constantPool.propertyNameOf(1
/* Directive */
);
var... | [
"function compileDirectiveFromRender2(outputCtx, directive, reflector, bindingParser) {\n var name = identifierName(directive.type);\n name || error(\"Cannot resolver the name of \".concat(directive.type));\n var definitionField = outputCtx.constantPool.propertyNameOf(1\n /* Directive */\n );\n var meta = dir... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
It's quite slow to compile WASM and (in Chrome) this happens every time a worker thread attempts to load a WASM module since there is no way to cache the compiled code currently. To mitigate this we can always keep a WASM backend 'ready to go' just waiting to be provided with a trace file. warmupWasmEngineWorker (toget... | function warmupWasmEngine() {
if (warmWorker !== null) {
throw new Error('warmupWasmEngine() already called');
}
warmWorker = createWorker();
} | [
"function warmupWasmEngine() {\n if (warmWorker !== null) {\n throw new Error('warmupWasmEngine() already called');\n }\n warmWorker = createWorker();\n}",
"function createWasm() {\n // prepare imports\n var info = {\n env: wasmImports,\n wasi_snapshot_preview1: wasmImports\n };\n // Loa... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Reads the trie on startup to load all datan eeded | function readTrie() {
var triePath = path.join(__dirname, './trie.json');
if (fs.existsSync(triePath)) {
// Read trie data from file (stored in case server restarts)
const data = fs.readFileSync(triePath);
var fileDataTrie = JSON.parse(data);
trie = Object.setPrototypeOf(fileDataTrie, trieNode.proto... | [
"function trie_setup() {\n\n const trie = new TrieStructure();\n\n for (const name in names) {\n trie.add_word(name, names[name]);\n }\n global.structure = trie;\n}",
"function loadTrie(section, callback) {\n\tsection = section.toLowerCase();\n\tif (tries[section]) {\n\t\t// FIXME: check up-to-date!\n\t\tc... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Updates menu doc for a given day, as needed | function updateMenuByDay(day, menu) {
var cafe_42 = "";
var arr = [];
/* Iterates through array that contains only objects
from the Cantina API that are for the specified day
and separates by whether it's a meal or special item */
for (let i = 0; i < menu.length; i++ ) {
if (menu[i].pla... | [
"function updateMenuDay () {\n var find_query = { 'day': 'Tomorrow' };\n var update = { 'day': 'Today' };\n var options = { new: true };\n\n let promise = Menu.findOneAndUpdate(find_query, update, options);\n \n return promise\n .then (() => {\n console.log(\"Updated tomorrow's m... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This is the method resonsible for retrieving employees from the backend by sorting and paging. The implementation of this method differs from one system to another depending on the backend and the serverside framework and language. The most important point to notice here is the "Paging Calculations" section in the meth... | function GetEmployeesPagedOrderedByAjax(pageSize, pageNumber, orderByPropertyName, sortingDirection) {
var resultToken = null;
var AllEmployees = new Array();
AllEmployees.push({Id:1, Name:"Employee 1"});
AllEmployees.push({Id:2, Name:"Employee 2"});
AllEmployees.push({Id:3, Name:"Employee 3"});
AllEmplo... | [
"function getEmployees() { Model.getAllEmployees(renderPage); }",
"getPaginationEmployees(page){\n return axios.get(EMPLOYEE_REST_API_URL+'/employee/'+page);\n }",
"async function getEmployeeServiceList(req, res) {\n let pageSize =\n +req.query.pageSize || +req.body.pageSize ? req.body.pageSize : ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Retrieves an ISO formed timestamp like "20180310T19:05:49.389Z" If utc is not specified, it will be performed using "perceived" time by the operator rather than UTC time. Please take into account that | function $timestamp(params) {
params = params || {};
var utc = params.utc;
var d = new Date();
var dp = d;
if (!utc) {
dp = new Date(d - d.getTimezoneOffset() * 1000 * 60);
}
var str = dp.toISOString();
return str;
} | [
"function createdAtISO(created_at) {\n function pad(n) {\n return n < 10 ? '0'+n : n;\n }\n\n var d = new Date(Date.parse(created_at));\n\n return d.getUTCFullYear()+'-' +\n pad(d.getUTCMonth()+1)+'-' +\n pad(d.getUTCDate())+'T' +\n pad(d.getUTCHours())+':' +\n pad(d.getUTCMinutes())+':' +\n p... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Fade for successful data submission | function postSubmit() {
$('#successAlert').fadeTo( 400, .75 )
$('#successAlert').delay(2000).fadeTo( 400, 0 );
} | [
"function animateResponseToFormSubmission()\n\t{\n\t\tvar affirmation = document.querySelectorAll(\"div.jumbotron\")[0];\n\n\t\taffirmation.style.transition = 'opacity 2s ease-in 0s';\n\t\taffirmation.style.opacity = '100%';\n\t}",
"function success(result) {\n\t\t$('#trackAddedAlert').animate({opacity: 1}, 300, ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Given the labels in the current context, decides which cards to suggest to users. | function actionMapper(agent) {
var labels = [];
var label_ctx = agent.context.get('labels');
if (label_ctx && label_ctx.parameters && label_ctx.parameters.labels) {
labels = label_ctx.parameters.labels;
}
if (!labels.filter(l => [ME, SOMEONE_ELSE].includes(l)).length) {
console.log('No labels to sug... | [
"function suggest(data,name){\n\n\t\n\t\n\t//fetch a superhero and check if its name matches with the text int he input box\n\t//if yes, then show him in the suggestions\n\n\tif(name!=inputText.value)\n\t\treturn;\n\n\t\tconsole.log(data);\n\tif(data.response==='error'){\n\t\tsuggestions.innerHTML = '<div style=\"m... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Split Deck into 3 decks | function splitDecks(deck){
for(var e = 0; e < easy; e++){
easyDeck[e] = deck[e];
}
for(var m = 0; m < medium; m++){
medDeck[m] = deck[m];
}
} | [
"function splitDeck(arr, numInDecks){\n decks = [];\n while (arr.length) {\n decks.push(arr.splice(0, numInDecks));\n }\n return decks;\n}",
"function splitTheDeck() {\n for (let i = 0; i < deck.length / 2; ++i) { //Gives first half of the main deck to the 1st player.\n player1Deck.push(deck[i]);\n }\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
var subject = new RealSubject() | constructor() {
super()
this.subject = new RealSubject()
//facade.log('Proxy created')
} | [
"function Subject(){\n this.observers = new ObserverList();\n}",
"function Subject() {\n this.observers = new ObserverList();\n}",
"function Subject() {\n this.observers = [];\n}",
"function Subject () {\n this.observers = new ObserversList();\n}",
"function Proxy(realSubject) {\n this.realSu... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Finally, I need to create the function to reset the grid like asked in the project specifiaction for that I use a for loop to erase all colors from each cell I use the index as the increment in the for loop and erase the color with "". Again, I need to prevent the default event from happening. | function resetGrid () {
for (let x = 0; x < tableData.length; x++) {
if (tableData[x].bgColor != chooseColor) {
tableData[x].bgColor = "";
}
event.preventDefault();
}
} | [
"function resetColor() {\n removeListeners();\n for(i=0; i < cells.length; i++) {\n cells[i].style.backgroundColor = \"white\";\n}}",
"function clearGrid() {\n for (c = 1; c <= 81; c++) {\n id(\"cell\" + c).children[0].children[0].value = \"\";\n id(\"cell\" + c).children[0].children[0].... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Check if the up hour button is enabled | upHourEnabled() {
return !this.maxDateTime || this.compareHours(this.stepHour, this.maxDateTime) < 1;
} | [
"isInHourMode() {\n return this.state.mode === 'hour';\n }",
"downHourEnabled() {\r\n return !this.minDateTime || this.compareHours(-this.stepHour, this.minDateTime) > -1;\r\n }",
"isDisabledHour(date) {\n let isDisabled = false\n if (typeof this.disabled === 'undefined' || !this.disable... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
find a routable ip address for the provided host this is v hacky, probably should allow user to specify | async getRoutableIP(host_address) {
const route = await execa('ip', ['route', 'get', host_address]);
const route_elements = route.stdout.split(' ');
const source_ip = route_elements[route_elements.indexOf('src')+1];
return source_ip
} | [
"function getLocalIPFromHost(address, host, user) {\n var execSync = require('child_process').execSync,\n hostInfo = execSync('ssh -oUserKnownHostsFile=/dev/null -oStrictHostKeyChecking=no ' + user + '@' + host + ' getent hosts \"' + address + '\"', {encoding: 'utf8'});\n\n // crude way to only get the IP ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
tells if a "stmt" is a break statement that would break the "path" | function isBreaking(stmt, path) {
if (stmt.isBreakStatement()) {
return _isBreaking(stmt, path);
}
var isBroken = false;
var result = {
break: false,
bail: false
};
stmt.traverse({
BreakStatement: function BreakStatement(breakPath) {
// if we already ... | [
"static isBreakStatement(node) {\r\n return node.getKind() === typescript_1.SyntaxKind.BreakStatement;\r\n }",
"function parseBreakStatement() {\n var label = null, marker = markerCreate();\n \n expectKeyword('break');\n \n // Catch the very common case first: imme... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
The rotation of the elbow servo in degrees | set elbowRotationDegree(value) { this._elbowRotation = (value / 180.0 * Math.PI); } | [
"get elbowRotationDegree() { return this._elbowRotation * 180.0 / Math.PI; }",
"get wristRotationDegree() { return this._wristRotation * 180.0 / Math.PI; }",
"get angle() {\n return this.transform.rotation * RAD_TO_DEG;\n }",
"set wristRotationDegree(value) { this._wristRotation = (value / 180.0 * Math.PI... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This function contains our logic for when we're farming mobs | function farm() {
var lowest_health = lowest_health_partymember();
//If we have a target to heal, heal them. Otherwise attack a target.
if (lowest_health != null && lowest_health.health_ratio < 0.8) {
if (distance_to_point(lowest_health.real_x, lowest_health.real_y) < character.range) {
... | [
"function farm() {\r\n\tvar lowest_health = lowest_health_partymember();\r\n\t// If we have a target to heal, heal them. Otherwise attack a target.\r\n\tif (lowest_health != null && lowest_health.health_ratio < 0.8) {\r\n\t\tif (distance_to_point(lowest_health.real_x, lowest_health.real_y) < character.range) {\r\n\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Predicate that returns true if the value lies within the span of the given range. The left and right flags control the use of inclusive (true) or exclusive (false) comparisons. / harmony default export | function __WEBPACK_DEFAULT_EXPORT__(value, range, left, right) {
var r0 = range[0], r1 = range[range.length-1], t;
if (r0 > r1) {
t = r0;
r0 = r1;
r1 = t;
}
left = left === undefined || left;
right = right === undefined || right;
return (left ? r0 <= value : r0 < value) &&
(right ? value <=... | [
"function inrange(value, range, left, right) {\n let r0 = range[0], r1 = range[range.length - 1], t;\n if (r0 > r1) {\n t = r0;\n r0 = r1;\n r1 = t;\n }\n left = left === undefined || left;\n right = right === undefined || right;\n return (left ? r0 <= value : r0 < value) && (right ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
TODO: Turn the string into linked list | function stringToLinkedList(input_string) {
// ex. assuming input_string = "F+X"
// you should return a linked list where the head is
// at Node('F') and the tail is at Node('X')
var ll = new LinkedList();
ll.head = new Node(input_string.charAt(0));
var currNode = ll.head;
for (var i = 1; i < input_string.lengt... | [
"function bparseList(str) {\r\n var p, list = [];\r\n while(str.charAt(0) != \"e\" && str.length > 0) {\r\n p = bparse(str);\r\n if(null == p)\r\n return null;\r\n list.push(p[0]);\r\n str = p[1];\r\n }\r\n if(str.length <= 0)\r\n return null;\r\n return ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
SVGs / global: save a copy of the SVG sprite inside config.svgs.sprite (used by the scaffold task) | function svgSprite() {
return gulp.src(paths.src.svgs + '**/*')
.pipe($.svgSprite(config.svgs));
} | [
"function createSprite() {\n return gulp.src('./app/assets/images/icons/**/*.svg')\n .pipe(svgSprite(config))\n .pipe(gulp.dest('./app/temp/sprite/'));\n}",
"function sprite() {\n return gulp.src('.temp/icons/**/*.svg',)\n .pipe(svgSprite({\n mode: {\n symbol: {\n // inline: true,\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Paint actual user parcels over the FeatureLayer | function drawOwnerParcels(layer, symbol, graphics, user) {
Ember.debug('Drawing user parcels');
var changed = false;
user.get('parcels').then((parcels) => {
var userParcels = parcels.map((parcel) => parcel.get('parcelId').toUpperCase());
layer.graphics.forEach(function (item) {
let parcelId = item... | [
"addUserParcelsLayer(layerURL) {\n var user = this.get('parcels.user');\n var _this = this;\n\n // Symbol for painting parcels\n var symbol = this.get('userParcelSymbol');\n var querySentence = \"\";\n\n // Common online and offline FeatureLayer creator and injector\n function createAndAddFL(la... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Runs ticks until the window is full (ie. updateTick == syncTick + delay) at frameRate. Can be called concurrently. | function runTicks() {
if (tickLoopRunning)
return;
tickLoopRunning = true;
var diff = function() {
return lastFrameTime - (new Date()).getTime() + 1000.0 / frameRate;
}
var advanceOne = function () {
if (updateTick < syncTick + delay) {
lastFrameTime = (new Date()).getTim... | [
"function tick() {\n var dt = NZJS.getTimeDelta(lastTick);\n lastTick += dt;\n\n schedule(tick, NZJS.Config.TicksPerSecond);\n\n if (screens.length > 0) {\n var screen = screens[screens.length - 1];\n if (screen.isLoaded) {\n screen.tick(dt);\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
FUNCTION RETURNING LIST OF USER IN SAME ROOM | getUserList(room){
var users = this.users.filter((user)=> user.room === room); /* FINDING USER WITH SAME ROOM NAME */
var namesArray = users.map((user)=> user.name); /* SELECTING USER NAMES IN THAT ROOM */
return namesArray;
} | [
"getUserList(room){\n\n //filter all users of the input room\n var users= this.users.filter((user)=>{\n return user.room===room;\n });\n\n //map only the name from the retured users list\n var namesArray= users.map((user)=>{\n return user.name;\n });\n\n return namesArray;\n }",
"g... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Currently the Thread class just makes a list of threadposts with a form underneath it. Joey wants the thread object to do the following: given some identifier, pull in data from the db if the data isn't available, create a table in the database the database probably need a default entry placed into it issue: thread sum... | function Thread(props){
let i;
let threadPosts = [];
for (i = 0; i < props.posts.length; i++){
threadPosts.push(<ThreadPost data={props.posts[i]} />)
}
return (
<>
<h1 className="header"> {props.title} </h1>
{threadPosts}
<ThreadForm threadID={props.threadID} />
</>
);
} | [
"function for_PostList(threadid,threadarchived,threadauthor,threadsolved,elidPosts,elidSubscription,elidReply,elidInsNew,elidAuthor,httpthreads,httpposts,httpbookmark,accesspost,accessreport,accessfilter,accesstrusted,accessmod,accessbookmark) {\n\tthis.threadid=threadid;\n\tthis.threadarchived=threadarchived;\n\tt... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Fired when the battery level changes | function onBatteryLevelChange() {
if (!enabled || !battery) {
return;
}
t.set("bat", battery.level);
} | [
"function onBatteryLevelChange() {\n if (!enabled || !battery) {\n return;\n }\n\n t.set(\"bat\", battery.level);\n }",
"function checkAndUpdateBatteryLevel() {\n _batteryLevel.text = battery.chargeLevel;\n}",
"async refreshBatteryLevel() {\n var batteryLevel = await this.serv... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Function used to append a line's volumes (slicer and 3D) when it is first turned on NOTE: This function is not used to create the HuCCer volume, which is hardcoded in index.html Changes made to this function should be updated to the HuCCer volumes in index.html as well | function appendVolumes(id) {
var type;
// Finding line's type based on ID, used for image URL
if(includes(TRANSGENIC, id)) {
type = 'transgenic';
} else if(includes(GAL4, id)) {
type = 'gal4';
} else if(includes(CRE, id)) {
type = 'cre';
} else {
type = 'misc';
}
// Constructing HTML for... | [
"function updateLines() {\n\t// Getting coordinate of currently selected point in 3D space\n\t// Calculated from slice slider value and total window size \n\tvar lineX = $('#x-input').val() * $('#z-window').width() * window.devicePixelRatio; // window.devicePixelRatio used because many browsers will automatically s... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Define a function that links the device manager to several of the curated device's events. | function linkToCuratedDeviceEvents() {
self.curatedDevice.on(
'DEVICE_DISCONNECTED',
curatedDeviceDisconnected
);
self.curatedDevice.on(
'DEVICE_RECONNECTED',
curatedDeviceReconnected
);
self.curatedDevice.on(
'DEVICE_ER... | [
"registerEvents(uuid) {\n logManagement.log(uuid, 'Start: registerEvents', 'debug');\n usb.on('attach', this.attachDevice.bind(this));\n usb.on('detach', this.detachDevice.bind(this));\n logManagement.log(uuid, 'End: registerEvents', 'debug');\n }",
"_registerListeners() {\n this._foundDevices[thi... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
default toolbar template uses simpletoolbar | get toolbarTemplate() {
return super.toolbarTemplate;
} | [
"get miniTemplate() {\n return html` <div id=\"container\">${super.toolbarTemplate}</div> `;\n }",
"function toolbar() {\n return {\n templateUrl: '/views/components/toolbar/toolbar.tpl.html',\n controller: toolbarController,\n controllerAs: 'toolbar'\n };\n}",
"function DEFAULT$static_(){Too... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
7.4.7 CreateIterResultObject (value, done) | function CreateIterResultObject(value, done) {
console.assert(Type(done) === 'boolean');
var obj = {};
obj["value"] = value;
obj["done"] = done;
return obj;
} | [
"function CreateIterResultObject ( value, done ) {\n if ( Type(done) !== 'boolean' ) {\n throw TypeError();\n }\n return {value: value, done: done};\n }",
"function createIterResultObject(value, done) {\n\t\t// 1. Assert: Type(done) is Boolean.\n\t\tif (typeof done !== 'boolean') {\n\t\t\tthrow new... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets the latency obtained from the input of the page. | function debugUpdateLatency() {
currentLatency = document.getElementById("latency").value;
//console.log("UPDATE LATENCY: " + currentLatency);
} | [
"function onLatencyChanged(value) {\n if (value >= 0) {\n config.latency = value;\n }\n }",
"_setLatencyHint(hint) {\n let lookAheadValue = 0;\n this._latencyHint = hint;\n\n if (Object(_util_TypeCheck__WEBPACK_IMPORTED_MODULE_5__[\"isString\"])(hint)) {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |