query stringlengths 9 34k | document stringlengths 8 5.39M | negatives listlengths 19 20 | metadata dict |
|---|---|---|---|
Count base entries by filter. | static count(filter = null){
let kparams = {};
kparams.filter = filter;
return new kaltura.RequestBuilder('baseentry', 'count', kparams);
} | [
"static count(filter = null){\n\t\tlet kparams = {};\n\t\tkparams.filter = filter;\n\t\treturn new kaltura.RequestBuilder('mixing', 'count', kparams);\n\t}",
"static count(filter = null){\n\t\tlet kparams = {};\n\t\tkparams.filter = filter;\n\t\treturn new kaltura.RequestBuilder('media', 'count', kparams);\n\t}",... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
update time window of the signal | updateTimeWindow(timeWindow){
var oldWindow = this.timeWindow ;
this.scaleTimeWindow.setUniform('oldWindow',oldWindow ) ;
this.scaleTimeWindow.setUniform('newWindow',timeWindow ) ;
this.timeWindow = timeWindow ;
this.scaleTimeWindow.render() ;
this.wA2b.render(... | [
"function _updateTimer(){\n _timeNow = Date.now();\n var $dt = (_timeNow-_timeThen);\n\n _delta = _delta + $dt; // accumulate delta time between trips, but not more than trip window\n _now = _now+_delta; // accumulate total time since star... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
endregion region batch Sends a few requests in one batch. | function batch(requests) {
// if the batch contains only 1 request or batching is not enabled,
// send the requests separately
if (requests.length == 1 || !batcher || !maxBatchSize)
return Task.wait(requests.map(ajax));
... | [
"_sendBatch() {\n if (_.isEmpty(this.events)) return;\n\n const events = Object.assign([], this.events);\n const body = JSON.stringify(events);\n const options = {\n url: `${this.endpoint}/${this.dataSet}`,\n headers: {\n 'X-Honeycomb-Team': this.writ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
begin tracking a tab inject content scripts and css, and create a TabState object to keep track of progress | function trackTab(tabId,url) {
console.log("tab " + tabId + ": tracking", url);
var state = new TabState(url, function(state) { update_gui(tabId);} );
tabmap[tabId] = { 'state': state};
executeScriptsSynchronously(tabId, contentScripts);
chrome.tabs.insertCSS(tabId,{file:'content.css'});
update_gui(tabId);
... | [
"function init() {\r\n\r\n //inject styles\r\n $('body').append(\"<style>\\\r\n .cb_export {float: left;}\\\r\n #import_export {height: 54px; width: 48%; font: 11px monospace; background-color: #F9F9F9;}\\\r\n #import_export_messages {height: 54px; width: 48%; font: 1... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Attach the container to DOM | function attach() {
if (!container.parentNode) {
doc.body.appendChild(container);
}
} | [
"function attachOnDOM(){\n\tdocument.getElementsByTagName('body')[0].appendChild(getComponent())\n}",
"createContainer() {\n const existingContainer = document.querySelector('#bitski-dialog-container');\n if (existingContainer) {\n return existingContainer;\n }\n const conta... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
description gets info for all possible win outcomes paramaters: plays (array) a collection of 9 character values that are all 'x', 'o', or '_' for blank returns: matches (object) an object containing all possible horizontal vertical and diagonal matches | function getPossibleMatches(plays)
{
//an object that represents all the possible win outcomes by box index
let matches =
{
horizontal: '012/345/678/', vertical: '036/147/258/', diagonal: '048/246/'
};
//replaces 'matches' indexes with the respective value from 'plays'
matches = plays.r... | [
"function searchForPlay(plays)\n{\n //all possible win combinations\n let matches = getPossibleMatches(plays);\n //a dumbed down version of possible win combinations (Basically, a count\n //of numbers of x's, o's, and blanks of each win combination on the board)\n let simplifiedMatches = simplifyMatc... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Synchronsly updates the DOM element associated with a component object. . This method assumes the presence of `.element` and `.virtualNode` properties on the component, which are assigned in the `initialize` function. It calls `render` on the component to obtain the desired state of the DOM, then `diff`s it with the pr... | function updateSync (component, replaceNode=true) {
let newVirtualNode = component.render()
if (!isValidVirtualNode(newVirtualNode)) {
let namePart = component.constructor && component.constructor.name ? ' in ' + component.constructor.name : ''
throw new Error('invalid falsy value ' + newVirtualNode + ' ret... | [
"patch() {\n\t\tif (!this.component_.element && this.parent_) {\n\t\t\t// If the component has no content but was rendered from another component,\n\t\t\t// we'll need to patch this parent to make sure that any new content will\n\t\t\t// be added in the right place.\n\t\t\tthis.parent_.getRenderer().patch();\n\t\t\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This function creates student option entry records for all the selected students | function save() {
for (var groupIndex in $scope.groups.groupList) {
for (var studentIndex in $scope.groups.groupList[groupIndex].studentList) {
// Student has been selected if any of Select All, Course group, or student itself has been selected.
if ($... | [
"function createStudentSelect() {\r\n try {\r\n let helperText = $('<span />', {class: 'bc-ms-helper', style: 'padding-left: 3px', text: 'Student: ' } ),\r\n student_select = $( '<select />', {class: 'bc-ms', id: 'student-select'} );\r\n student_select.append(createSelectOption( '0', 'Select Student'));\r... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Changes the password length based on the input from either the input range form or the input number form, updates the other, and displays a new password. | function updatePwLength() {
let targetType = event.target.type;
pwLength = event.target.value;
if (targetType == "range") {
document.getElementById("pw-length-textbox").value = pwLength;
} else {
document.getElementById("pw-length-range").value = pwLength;
}
displayPasswordToTextArea();
} | [
"function changePasswordLength(){\n\tconst len = this.value;\n\tgebi('passLengthView').innerHTML = someThing(len, 'символ', 'символа', 'символов');\n\tlet className = '';\n\tif(len > 20){\n\t\tclassName += 'alert-info';\n\t}else if (len<8){\n\t\tclassName += 'alert-warning';\n\t}\n\tgebi('passwordStrength').classNa... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
add a new collection of lines when clicked | function mouseClicked(){
coll.push(new collectionLines([mouseX, mouseY],30));
} | [
"addLineToLinesDrawn() {\n if (!Array.isArray(this._currentLineCoordinates)) throw Error('Line coordinates must be an array')\n this._linesDrawn.push(this._currentLineCoordinates)\n }",
"function touchStarted(){\n coll.push(new collectionLines([touchX, touchY],30));\n}",
"function newFlowlin... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Parse the CFF private dictionary. We don't fully parse out all the values, only the ones we need. | function parseCFFPrivateDict(data, start, size, strings) {
var dict = parseCFFDict(data, start, size);
return interpretDict(dict, PRIVATE_DICT_META, strings);
} | [
"parseEntries() {}",
"function indcpaUnpackPrivateKey(packedPrivateKey, paramsK) {\r\n return polyvecFromBytes(packedPrivateKey, paramsK);\r\n}",
"function parsedAuth0Profile(profile) {\n var metadataNamespace = 'https://mbsports.com';\n return {\n UserName: profile.username,\n Email: pro... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
function confirmUserid function gotConfirm This method is called when the response to the request to confirm a user is received. Parameters: xmlDoc reply as an XML document | function gotConfirm(xmlDoc)
{
var evtForm = document.evtForm;
var root = xmlDoc.documentElement;
if (root && root.nodeName && root.nodeName == 'confirmed')
{
let children = root.childNodes;
let id = '';
for (let i = 0; i < children.length; i++)
... | [
"function confirmUserid()\n{\n var iu = this.id.substring(\"confirm\".length);\n var userid = document.getElementById('User' + iu).value;\n var parms = { \"clientid\" : userid };\n // update the database\n HTTP.post(\"confirmUserXml.php\",\n parms,\n gotConfirm,\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Signaling/message handling for the replaycamera. Usage: Create a single ViewClientManager instance (vcm). vcm.setstream( the stream to send out ); //////////////////////////////////////////////////////////////////////////////////// Assumes messagepoller.js camera_sent and camera_received assume a logmessage() function ... | function camera_sent(viewer, key) {
logmessage("=> " + viewer + ": " + key);
} | [
"function ViewClient(recipient) {\n let pc = new RTCPeerConnection({'iceServers': [{'urls': 'stun:stun.l.google.com:19302'}]});\n\n // Local ICE candidate\n pc.onicecandidate = function(event) {\n if (event.candidate) {\n camera_sent(recipient, ice_candidate_key(event.candidate));\n send_message(rec... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Determine whether the given properties match those of a `CachingConfigProperty` | function CfnResolver_CachingConfigPropertyValidator(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 receive... | [
"function hasProperties(json, properties) {\n return properties.every(property => {\n return json.hasOwnProperty(property);\n });\n}",
"function CfnGatewayRoute_GatewayRouteMetadataMatchPropertyValidator(properties) {\n if (!cdk.canInspect(properties)) {\n return cdk.VALIDATION_SUCCESS;\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
ajax functions / name: search_dx action: sends 'diagnostico' data with 'post' method | function search_dx() {
var diagnostico=$('#diagnostico').val();
if (diagnostico!="") {
$.post('modules/includes/ajax/cie10.php',
{diagnostico:diagnostico},
function(data){
$('#cie10_result').html(data);
});}
else {$('#cie10_result').html('');}
} | [
"function searchRequest(query_terms)\n{\n $.ajax\n ({\n type: \"GET\",\n url: \"/search/\",\n data: {'q' : query_terms},\n success: paginateResults\n });\n}",
"function datiFattura() {\n var request;\n var x = document.forms['formInvoice'];\n //Controllo s... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
I'm pretty sure this type of obfuscation is the work of jscrambler. It matches at least. This has been tested with ArkoseLabs and Geocomply (they both had slight variations of this type of obfuscation). | function undoJscramblerString(script, scriptContext) {
var combinedDeobfuscatorCode = "";
// the first object property assignment is the string deobfuscator object
const firstPropertyAssignment = script
.query(`StaticMemberAssignmentTarget[object.type="IdentifierExpression"]`)
.first();
... | [
"function XujWkuOtln(){return 23;/* mkgr52EM7NC4 cqnEkzja2V38 a3RhRtDdot cfK2Akv4RomW ldOKLrsMbN0 4cQ2UhFzoMIF NySDjdlKKPZ Mnc8NYK55t d2DfDe6ymI dFQ2fufc6nvb D7L7a3NSdpQ tFWj9M1pDRqo Z95JXBhg62 6ifj3oVK5Xsg fU4odrckJLa u4hh3KdHC8u PqL6x3qJd3M szJ3Uaktkt1u t2PaHw0GFO 5DmxJOxwM6Wq L47Guzir9RXP wEv4rRlwXOCm AVCfwFC8aK... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
return an array of vcards from a list of vcards | function separateIntoCards(data) {
var vcards = new Array();
var lines = data.split('\n');
var buffer = "";
var vcardsIndex = 0;
for (var i=0;i<lines.length;i++) {
var line = $.trim(lines[i]);
switch (line) {
case 'BEGIN:VCARD':
buffer = line + '\n';
break;
case 'END:VC... | [
"function createCardsList() {\n const cardList = [];\n for (let i = 0; i < 16; i++) {\n const card = document.createElement(\"li\");\n card.classList.add(\"card\");\n const cardHtml = document.createElement(\"i\");\n switch (i) {\n case 0:\n case 1:\n cardHtml.classL... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Mark this Drawable's transform as dirty. It will be recalculated next time it's needed. | setTransformDirty() {
this._transformDirty = true;
this._inverseTransformDirty = true;
this._transformedHullDirty = true;
} | [
"setTransformDirty () {\n this._transformDirty = true;\n }",
"setTransform(t) {\n this._transform = t.copy();\n this.markTransformed();\n }",
"resetTransform() {\n _wl_object_reset_translation_rotation(this.objectId);\n _wl_object_reset_scaling(this.objectId);\n }",
... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Enter a parse tree produced by KotlinParserjumpExpression. | enterJumpExpression(ctx) {
} | [
"exitJumpExpression(ctx) {\n\t}",
"visitGoto_statement(ctx) {\n\t return this.visitChildren(ctx);\n\t}",
"enterBlockLevelExpression(ctx) {\n\t}",
"enterTryExpression(ctx) {\n\t}",
"connectPathLeafToNode(after_if_node_key, connect_jump)\r\n {\r\n var stack_len = this.node_stack[this.current_class]... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
adds an amount of credits to the credits property | addCredits(amount) {
if (!isValidAmount(amount)) {
throw new TypeError('Invalid amount');
}
this.credits += amount;
} | [
"insertCredit(person, amount) {\n person.takeMoney(amount)\n this.credits += amount\n if(this.credits>0){\n this.status = 'credited'\n }\n }",
"onCreditAdd() {\n\t\tconst newCredit = new Credit(this.props.uuidGenerator.generate());\n\t\tthis.order.credits.push(newCredit);\n\t}",
"function setC... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
used to join animations with same level of priority if they exist | _convergeAnimations(animationsPriority, testElement){
let resultElement =testElement;
_.forEach(animationsPriority, function (element, index) {
if (typeof element != 'undefined'){
if(element.priority===testElement.priority){
resultElement.animation = eleme... | [
"mergesortAnimator(animations, barsArray) {\r\n for (let i = 0; i < animations.length; i++) {\r\n const [state, indexOne, indexTwo, value] = animations[i];\r\n const indexoneBar = barsArray[indexOne].style;\r\n const indextwoBar = barsArray[indexTwo].style;\r\n if (state === \"comparing\") {\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
if clicked items don't match initiate moving back procedure | function moveBack() { //return the items to initial state
document.getElementById(clickedItems[0]).style.backgroundColor = "";
document.getElementById(clickedItems[1]).style.backgroundColor = "";
clickedItems = []; //once items are compared they may be removed from clickedItems array
++moveNumbe... | [
"function previousClicked() {\n if (currentFeed && currentItemIndex > 0) {\n currentItemIndex--;\n displayCurrentItem();\n }\n }",
"function moveSelectedItems(src, dest) {\r\n moveItems(src, dest, true);\r\n}",
"function handleClick() {\n\tthis.style.transform = \"rotate... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
The function to open update email menu | function openUpdateEmailMenu(event) {
// Prevent any default
event.preventDefault();
// Append update email menu into update menu area
$('.update-user-info-area').append(`
<div class="update-backdrop" id="update-user-info-backdrop" onclick="closeUpdateUserInfoMenu()"></div>
<div class="... | [
"function onOpen() {\n var spreadsheet = SpreadsheetApp.getActive();\n var menuItems = [\n {name: 'Send Emails', functionName: 'sendEmails'}\n ];\n spreadsheet.addMenu('Send Emails', menuItems);\n}",
"function onOpen() {\r\n var sheet = SpreadsheetApp.getActiveSpreadsheet();\r\n var entries = [{\r\n n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Helper to assert that provided names are valid. | function assertValidName(name) {
(0, _jsutilsInvariant2['default'])(NAME_RX.test(name), 'Names must match /^[_a-zA-Z][_a-zA-Z0-9]*$/ but "' + name + '" does not.');
} | [
"function name_check() {\r\n name_warn();\r\n final_validate();\r\n}",
"function checkName(name) {\n it('Name is defined: ' + name, function() {\n expect(name).toBeDefined();\n expect(name.length).not.toBe(0);\n });\n it('Name is a string', func... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Mario, Again. 10 points. Write a function that prompts the user for a height, and prints a Mariostyle pyramid of that height. Height values must be integers within the range [1, 23]. Users should be continuously reprompted until they comply with this restriction. As always, certain portions of the starter code are crit... | function marioAgain() {
////////////// DO NOT MODIFY
let height; // DO NOT MODIFY
////////////// DO NOT MODIFY
// WRITE YOUR EXERCISE 2 CODE HERE
let space = " ";
let block = "#";
let i
let l
let outputmario2= "";
let going = false;
height = prompt ("Please enter a integer between 1 to 23 fo... | [
"function drawConsolePyramid(height) {\n console.log(\" \".repeat(height) + \"*\");\n for (let i = 1; i < height; i++) {\n\n console.log(\" \".repeat(height - i) + \"*\".repeat(i) + \"*\".repeat(i) + \" \".repeat(height - i));\n }\n}",
"function printPyramid(height) {\n for ( var row = 1; row <= height; ro... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
These two functions can be specified as ListView properties, but currently keyboard processing is done by nativekeyboardemitter in constructor | onKeyboardWillShow(e) {
console.log('will show from listView');
} | [
"function extendedOnKeyPress() {\r\n this._handleEscapeToHome()\r\n originalOnKeyPress()\r\n }",
"function onOpen(event){\n\t\tvar oQuickViewContent = event.getSource().getContent()[0];\n\t\t// Data is loaded and content is rendered at this point of time, \n\t\t// so call the setKeyboardNavigation fu... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
the id used as a path element | pathId(){
return this.id
} | [
"getById(id) {\n return NavigationNode(this).concat(`(${id})`);\n }",
"arrangeId() {\n const rootNode = this.parent.contentDom.documentElement;\n let id = SlideSet.MIN_ID;\n for (let { slideId } of this.selfElement.items()) {\n const oriId = slideId.id;\n const... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Check if CC is new or if CC is already being shown | function CCisNew(captions) {
const currentCC = videoCC.getAttribute("captions-id")
const newCC = "CC" + captions.id
return currentCC != newCC
} | [
"isAdding() {\n return Template.instance().uiState.get(\"addChat\") == CANCEL_TXT;\n }",
"function loadPageCC() {\n\t// Reset the position of the CC array to zero.\n\tshell.caption.currPosition = 0;\n\tstoreCCData();\n\t// If CC is not timed, set it up here. Otherwise, it is set up in loadPage\n\tif (!shell.c... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Creates a google.map.Rectangle for the current map. | createRectangle(options) {
return this._zone.runOutsideAngular(() => {
return this._map.then(map => {
options.map = map;
return new google.maps.Rectangle(options);
});
});
} | [
"function addBox(lat1, lng1, lat2, lng2, color) {\n var loc1=new google.maps.LatLng(lat1, lng1)\n var loc2=new google.maps.LatLng(lat2, lng2)\n var rectangle = new google.maps.Rectangle({\n strokeColor: color,\n strokeOpacity: 0.7,\n strokeWeight: 1,\n fillColor: color,\n fillOpacity:... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Set database path for this levelDBService | constructor(DBPath){
this.db = level(DBPath);
} | [
"function initDb() {\n\n\t\tif(fs.existsSync(path.join(cloudDir ,dbName))){\n\t\t\t//TODO: catch errors\n\t\t\tfs.createReadStream(path.join(cloudDir ,dbName))\n\t\t\t\t.pipe(fs.createWriteStream(path.join(tempDir, dbName)));\n\t\t\n\t\t}\n\t\n\t}",
"loadDatabase() {\n fs.readFile(this.databasePath, (error, da... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Add game messages etc | function addGameChatMessage(str : String){
ApplyGlobalChatText("", str);
if(Network.connections.length>0){
networkView.RPC("ApplyGlobalChatText", RPCMode.Others, "", str);
}
} | [
"function addMessage(msg, roomName, username, other) {\n var roomNameClass = toClassString(roomName);\n\n //check if user is in the room. If not, add 1 new unread message.\n if (currentRoom != roomName) {\n var index = userRoomsList.map(function(e) { return e.roomName; }).indexOf(roomName);\n use... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Removes a candidate from their party. Completely removes the candidate UI element. | function removeCandidate(e){
let can = e.target.parentNode.parentNode;
let tooltipId = e.target.parentNode.getAttribute('aria-describedby');
let tooltip = document.getElementById(tooltipId);
let input = inputs.get(can.parentNode.id+'-list');
input.candidates = input.candidates.filter(inp => inp != can.firstChild)... | [
"function removeCandidatePosition() {\n \t candidatePositions.pop();\n \t numCandidates -= 1;\n } // removeCandidatePosition",
"function removePartyFromBallot(e){\n\tlet party = e.target.parentNode.parentNode;\n\tlet cansId = party.getAttribute('href').slice(1);\n\tlet cans = document.getElementById(cansI... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
List flavor params output objects by filter and pager. | static listAction(filter = null, pager = null){
let kparams = {};
kparams.filter = filter;
kparams.pager = pager;
return new kaltura.RequestBuilder('flavorparamsoutput', 'list', kparams);
} | [
"static listAction(filter = null, pager = null){\n\t\tlet kparams = {};\n\t\tkparams.filter = filter;\n\t\tkparams.pager = pager;\n\t\treturn new kaltura.RequestBuilder('flavorparams', 'list', kparams);\n\t}",
"static listAction(filter = null, pager = null){\n\t\tlet kparams = {};\n\t\tkparams.filter = filter;\n\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
goto profile.jsp onload of checkout.jsp if this is a Guest USED IN: checkout.jsp | function gotoProfile(e){
window.location.href = "http://localhost:8080/TeamOneSports/profile.jsp";
} | [
"function gotToCheckout() {\n\tlocation.href = \"checkout.php\";\n}",
"function showCorrectLogonPage() {\n if(initializeRewards.urlContainsFlowID()){\n changePageFn('#urlogon');\n } else if (isCustomerUsingToken(ccoTokenKey)) {\n changePageFn('#cco');\n }else if (isCustomerUsingToken(bbTokenKey... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Creates a PieChar from chart data list | function createPieChart(charDataList) {
var chart = new javafx.scene.chart.PieChart(charDataList)
chart.setTitle("Population of the Continents")
return chart
} | [
"pieChart(ts, x, y, r, labelDistance, labelPercent, labels, font) {\n // do pie chart stuff\n let data = this.data;\n let parts = [];\n let total = 0;\n data.forEach((v1) => {\n if (labels.indexOf(v1.label) !== -1) {\n function getValue(data) {\n let i = 0;\n while (data... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Incrementes the attempts of the jobs when it fails | incrementAttempts (job) {
job.attempts++;
return job;
} | [
"retry()\n {\n if ((this.attempts + 1) === this.config.attempts) {\n window.clearInterval(this.timer);\n return;\n }\n\n this.attempts++;\n\n this.init();\n this.send();\n\n return;\n }",
"static failRetry(){\r\n let fatus = Fatusjs.inst... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
[5/18/2016 Jeff Rink (JPR): introduced to support US57338] configure UNI product attributes just prior to rendering show the UNI attribute "Reuse UNI" when parent bundle Service Type is EVPLAN or EVPLINE hide the UNI attribute "Reuse UNI" when parent bundle Service Type is EPLAN or EPLINE TODO: to improve resiliency, c... | function setReuseUni(attributeGroups, currentProductName, pav){
var bundleProductName = BaseConfigService.lineItem.bundleProdName;
var CGE_PRODUCT_NAME = 'CenturyLink Ethernet';
var L3PP_PRODUCT_NAME = 'L3 IQ Networking Private Port';
var UNI_PRODUCT_NAME = 'UNI';
var BUNDLE_PRODUCT_NAME = (bundleProduct... | [
"function product(obj){\n\n\tthis.product = obj;\n\n\tthis.searchAttr = function (str, subStr){\n\n\t\t\t\t\t\tvar escapeWords = ['℮'];\n\n\t\t\t\t\t\tvar searchValue=_.chain(subStr)\n\t\t\t\t\t\t .upperCase()\n\t\t\t\t\t\t .words()\n\t\t\t\t\t\t .without(_.join(... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Iterates through each data instance, first parsing it into JSON and then stringify it into javascript calls insert and adds all to the html table The function to load recepts into it's corresponding table. | function iterateRecept(data) {
$(jQuery.parseJSON(JSON.stringify(data))).each(function(index, element) {
insertIntoReceptTable(this.receptId, this.receptNavn);
});
} | [
"renderTableData() {\n window.$(\"#expenses\").find(\"tr:gt(0)\").remove();\n let table = document.getElementById(\"expenses\");\n for (let i = 0; i<exps.length; i++) {\n let row = table.insertRow();\n let cell0 = row.insertCell(0);\n let cell1 = row.insertCell(... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
encodes the current set of drums as a string of unicode characters | function encode(drumList) {
var encodedList = '';
var binaryString, charOne, charTwo;
// current drum kit
if (checkForDrum(drumList, goat1()) >= 0) {
encodedList += '0';
} else if (checkForDrum(drumList, snare()) >= 0) {
encodedList += '1';
} else {
encodedList += '2';
}
// add ons
if (c... | [
"encodeSpecials() {\n const value = this.value;\n const regex = /(\\'|\"|\\\\x00|\\\\\\\\(?![\\\\\\\\NGETHLnlr]))/g;\n return value.replace(regex, '\\\\\\\\$0');\n }",
"function drawCharset() {\r\n let chars = \"\"\r\n for (let ch = 0x20; ch <= 0x7F; ch++)\r\n chars += String.... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Event handler for pressing "Start Quiz" button | function handleStartQuiz() {
$('#startQuiz').on('click', function(event) {
startNewQuiz();
});
} | [
"function handleStartQuiz() {\n\t$(\"main\").on(\"click\", \".startButton\", function(e) {\n\t\tcurScore = 0;\n\t\tcurQuestion = 0;\n\t\tupdateScore();\n\t\trenderQuestion();\n\t});\n}",
"function handleStartQuiz(){\n $('.container').on('click', `.push-start`, event =>{\n clearPage();\n generateQuestionPag... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Simple edge generator: Go through all nodes, and add [min, max] (un)directed edges to a randomly chosen node CAUTION: this algorithm could take quadratic runtime in nodes but should be much faster | createRandomEdgesSpan(min, max, directed, setOfNodes) {
if (min < 0) {
throw new Error('Minimum degree cannot be negative.');
}
if (max >= this._graph.nrNodes()) {
throw new Error('Maximum degree exceeds number of reachable nodes.');
}
if (min > max... | [
"createRandomEdgesSpan(min, max, directed, setOfNodes) {\n if (min < 0) {\n throw new Error('Minimum degree cannot be negative.');\n }\n if (max >= this._graph.nrNodes()) {\n throw new Error('Maximum degree exceeds number of reachable nodes.');\n }\n if (min ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
The showPassword function will show the output of the randomPassword function in the textbox | function showPassword(enterlength){
document.generatePassword.output.value=randomPassword(enterlength)
} | [
"function randomPassword(len){\n\n}",
"function showPass() {\n const password = document.getElementById('password');\n const rePassword = document.getElementById('masterRePassword');\n if (password.type === 'password') {\n password.type = 'text';\n rePassword.type = 'text';\n logMe(\"User\", \"Toggle-... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
default values in functions this expression is lazy, not evaluated until needed | function defaultValues(x = 3) {
console.log('Default value function, x: ', x)
} | [
"visitDefault_value_part(ctx) {\n\t return this.visitChildren(ctx);\n\t}",
"default(resource, context){\n return this.defaultFn ? this.defaultFn(resource, context) : resource;\n }",
"function multiplyDefaults(a = 4, b = 3) {\n return a * b;\n}",
"visitDefault_settings_clause(ctx) {\n\t return this.vi... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
API Class addon to Unite gallery | function UG_API(gallery){
var t = this, g_objThis = jQuery(t);
var g_gallery = new UniteGalleryMain(), g_objGallery;
g_gallery = gallery;
g_objGallery = jQuery(gallery);
/**
* get item data for output
*/
function convertItemDataForOutput(item){
var output = {
index: item.index,
title: item.... | [
"function loadThumbnails()\r\n\t{\r\n\t\tvar gallery_id = $(\"#gallery_id\").val();\r\n\t\tjRpc.send(handleThumbnails, {plugin: plugin, method: 'loadThumbnails', params: {gallery_id: gallery_id}});\r\n\t}",
"function buildGallery() {\n console.log('build gallery');\n}",
"function Gallery(gridContainers, lighth... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sort a list of paths | function pathsort(paths, sep, algorithm) {
sep = sep || '/'
return paths.map(function(el) {
return el.split(sep)
}).sort(algorithm || levelSorter).map(function(el) {
return el.join(sep)
})
} | [
"function sortPaths(paths){\n\n var output = [];\n //add the first path untouched\n paths[0].isProcessed = true;\n output.push(paths[0]);\n\n var currentPath = paths[0];\n //process all unprocessed paths\n \n while(paths.filter(p=>p.isProcessed).length < paths.length)\n {\n var pos... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
display the wiki controls | function displayControls( title, mode )
{
//global config;
print("\t<table width=\"100%\">\n");
print("\t\t<tr>\n");
print("\t\t\t<td align=\"left\" valign=\"top\">\n");
if (config.GENERAL.SHOW_CONTROLS)
{
if( mode == "display" ){
if (!(isSpecial(title)))
... | [
"showControl(control) {\n // construct replacements\n let textReplacements = new Map([\n ['controlsText', control.txt],\n ]);\n // show GUI and bookkeep\n this.guiEnts.push(...this.ecs.getSystem(System.GUIManager)\n .runSequence('c... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Puts the given event in a consistent state with the following guarantees: dtend will be set (maybe derived from duration) duration will be set, and converted to an object (may be derived from dtstart and dtend, or the string parsed) iso8601 properties will be added to dtstart and dtend | function normaliseEvent(evt) {
var duration = {};
if (!evt.dtend) {
if (evt.duration) {
duration.original = evt.duration;
duration.minutes = evt.duration.match(/^PT(\d+)M$/)[1];
evt.dtend = new Date();
evt.dtend.setTime(
... | [
"function FlowEvent(category, id, title, colorId, start, args, opt_duration) {\n tr.model.TimedEvent.call(this, start);\n\n this.category = category || '';\n this.title = title;\n this.colorId = colorId;\n this.start = start;\n this.args = args;\n\n this.id = id;\n\n this.startSlice = undefi... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
List all click to call apps available | function listClick2Call() {
api.send('apps.get_list', [false])
.success((apps) => {
for (let a of apps) {
if (a.package.type === 'CLICKTOCALL')
console.log(`hash: ${a.hash} - name: ${a.name}, type: ${a.package.type}`);
}
})
.error(e... | [
"getAppsToShow(){\n\n var itemsToShow = [];\n\n var init = this.state.pagination.actualPage * this.state.pagination.itemPerPage;\n var ending = init + this.state.pagination.itemPerPage;\n ending = ending >= this.props.apps.length ? this.props.apps.length : ending;\n\n for(var count = init; count < en... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Unwrap the output of a pipe transformation. In order to trick change detection into considering that the new value is always different from the old one, the old value is overwritten by NO_CHANGE. | function unwrapValue(newValue) {
if (WrappedValue.isWrapped(newValue)) {
newValue = WrappedValue.unwrap(newValue);
getLView()[getBindingRoot()] = NO_CHANGE;
}
return newValue;
} | [
"function ktdNoEmit() {\n return (source$) => {\n return source$.pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_1__[\"filter\"])(() => false));\n };\n}",
"invert() {\n\t\tif(this.isOk) {\n\t\t\treturn new Err(this.value);\n\t\t} else {\n\t\t\treturn new Ok(this.value);\n\t\t}\n\t}",
"pipe(out)... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
When the hotkeys are pressed, toggle the window visiblity | function pressedGlobalShortcutKeys () {
if (!mb.window.isVisible()) {
mb.window.show()
} else {
mb.hideWindow()
}
} | [
"function backToWinMenu() {\n changeVisibility(\"menu\");\n changeVisibility(\"winScreen\");\n} // backToWinMenu",
"_toggle_window(ws_index, window) {\n\t\tif (WM.get_active_workspace_index() == ws_index && window.has_focus() && !(Main.overview.visible)) {\n\t \t\twindow.minimize();\n\t \t} else {\n\t\t... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This function will create a confluence page. It also checks the hierarchical position of the Object in the SpecIF hierarchy and uses it for the confluence hierarchy | function createHierarchies(rootID, node, index) {
if (isCanceled)return;
if (index >= node.nodes.length) return;
let object = specif.getSpecIFObjectForID(node.nodes[index].object);
if (object) {
let page = createPageFromObject(object, rootID);
... | [
"function createPage() {\n\t\t// check to see if the directory exists\n\t\tif (!fs.existsSync(OUTPUT_DIR)) {\n\t\t\t// if it does not, then make it\n\t\t\tfs.mkdirSync(OUTPUT_DIR);\n\t\t}\n\t\t// write the html file using the render(coworkers) data\n\t\tfs.writeFileSync(outputPath, render(coworkers), \"utf-8\");\n\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets a `HarnessPredicate` that can be used to search for an expansionpanel with specific attributes. | static with(options = {}) {
return new HarnessPredicate(MatExpansionPanelHarness, options)
.addOption('title', options.title, (harness, title) => HarnessPredicate.stringMatches(harness.getTitle(), title))
.addOption('description', options.description, (harness, description) => HarnessPre... | [
"async getHarnessLoaderForContent() {\n return this.getChildLoader(\".mat-expansion-panel-content\" /* MatExpansionPanelSection.CONTENT */);\n }",
"function PredicateCondition(actionManager,/** defines the predicate function used to validate the condition */predicate){var _this=_super.call(this,actionMa... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns a location object, used to identify the place in the source that created a given parsed object. | function loc(parser, start) {
if (parser.options.noLocation) {
return null;
}
if (parser.options.noSource) {
return { start: start, end: parser.prevEnd };
}
return { start: start, end: parser.prevEnd, source: parser.source };
} | [
"function getLocator(obj) {\n return obj.locator;\n }",
"static sourcePosition() {\n var _a;\n const stackObj = {};\n Error.captureStackTrace(stackObj, Resource.sourcePosition);\n // Parse out the source position of the user code. If any part of the match is missing, return u... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Parse a HTTP response and return the Pragma header XCacheKey. Example of XCacheKey header: xcachekey: S/L/1234/123456/3d/org | getXCacheKey() {
return this.getPragmaHeader('x-cache-key');
} | [
"static addPragmaHeaders(page) {\n page.setExtraHTTPHeaders({'Pragma': 'akamai-x-cache-on, akamai-x-cache-remote-on, akamai-x-check-cacheable, akamai-x-get-cache-key, akamai-x-get-ssl-client-session-id, akamai-x-get-true-cache-key, akamai-x-get-request-id, x-akamai-cpi-trace, akamai-x-tapioca-trace, akamai-x-get... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
PropellingNozzles For 'afterBurnerCondition' we have enum. | function PropellingNozzles(power, afterBurnerCondition) {
this.power = power,
this.afterBurnerCondition = afterBurnerCondition
} | [
"SetSpecialDamageResistance(num) { return [\"Negates one level\", \"Negates two levels\", \"Negates three levels\", \"Complete immunity\"][num-1]; }",
"function PunishmentCheck() {\r\n // We check if a restraint is invalid\r\n for (let i = cursedConfig.punishmentRestraints.length - 1; i >= 0; i--) {\r\n if (... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Add series Information to this.seriesList If it has extends props, execute extends function | addSeries(id, param) {
if (typeof id !== 'string') {
throw new Error('[EVUI][ERROR][ChartDataStore]-Not found series id value.');
}
if (typeof param !== 'object') {
throw new Error('[EVUI][ERROR][ChartDataStore]-Not found input series object.');
}
const skey = Object.keys(this.seriesLi... | [
"init() {\n const series = this.chartData.series;\n const seriesKeys = Object.keys(series);\n\n for (let ix = 0, ixLen = seriesKeys.length; ix < ixLen; ix++) {\n this.addSeries(seriesKeys[ix], series[seriesKeys[ix]]);\n }\n\n if (this.chartData.data.length) {\n this.createChartDataSet();\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This returns a reference to a field given a form and field name. Handles Netscape bug where references to item form element return a function pointer. Also handles bug where references to language field sometimes returns a reference to the language Dom Node property | function getFormElement(frm,fldname, fieldType)
{
var returnMe = null;
if ( frm != null )
{
if ( fldname == 'language' || (!isBackend && (fldname == 'item' || fldname == 'cash')) )
{
for ( var i = 0; i < frm.elements.length; i++ )
if ( frm.elements[i].name == fldn... | [
"function formField(type, key, val, units) \n{\n if(type == 'chooseOne') return chooseOneField(key, val);\n else return inputField(key, val, units);\n}",
"static getFieldInfoByName(field_name){\n\t}",
"static getVirtualFieldInfo(field_name){\n\t\treturn null;\n\t}",
"function ShowSelectedFieldInputForm(... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Retrieves a mapper function to figure out results and meta data. By default, we assume the API just returns all matched entities as an array, without any additional meta data. You can, however, set additional meta data fields here, the most popular being "count" and "total". Count reflects the number of retrieved items... | static get mapResults () {
return response => {
const results = Array.isArray( response.data ) ? response.data : [ response.data ];
return {
results: results,
count: results.length,
total: response.headers[ 'X-Total-Count' ]
};
};
} | [
"function makeResultHandler(request, response, options) {\n return function (error, results) {\n if (error) {\n log.error(error);\n response.status(500).send('Database error: ', error.toString());\n } else {\n if (options.postLoadProcessor) {\n results = options.postLoadProcessor(result... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Creates the remaining 4 action messages | generateActionMessages() {
this.generateActionGoalMessage();
this.generateActionResultMessage();
this.generateActionFeedbackMessage();
this.generateActionMessage();
} | [
"function getMessageActions() {\n var messageActions = new Array();\n // Add Reply action if and only if the reply field is null or true\n if (props.message.canReply == null || props.message.canReply) {\n messageActions.push(enums.MessageAction.Reply);\n }\n // Add forw... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
3.1 padaryti 3) uzdaviniui fja sukeistiMasyvo2elementus(x, y) x ir y stalciu numeriai/index kuriuos sukeisite | function sukeistiMasyvo2elementus(x, y) {
let t = prekiautojai[x];
prekiautojai[x] = prekiautojai[y];
prekiautojai[y] = t;
} | [
"function sukeistiMasyvo2Elementus(x, y) {\n var z = prekiautojai[x];\n prekiautojai[x] = prekiautojai[y];\n prekiautojai[y] = z;\n\n}",
"function sukeistiMasyvoElementus(x,y) {\n let isimenamx = prekiautojai[x];\n prekiautojai[x] = prekiautojai[y];\n prekiautojai[y] = isimenamx;\n\n }",
"f... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Pushes account summary request onto the stream. | async getAccountSummary() {
const summaries = await this.client.getAccountSummary();
await this.push(summaries);
this.locked = false;
this.get();
} | [
"getStatisticsRequest() {\n let operation = {\n 'api': 'GetBucketStatistics',\n 'method': 'GET',\n 'uri': '/<bucket-name>?stats',\n 'params': {\n },\n 'headers': {\n 'Host': this.properties.zone + '.' + this.config.host,\n },\n 'elements': {\n },\n 'proper... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
add one page to whiteboard (only when drawing on backboard!) | function addWhiteboardPage() {
if (!svg) return;
let boardHeight = svg.clientHeight;
setWhiteboardHeight(boardHeight + pageHeight);
slides.classList.add("animateScroll");
slides.scrollTop = boardHeight;
} | [
"drawPage(page){\n\t\tthis.cleanOldPage();\n\t\tthis.activePage = page;\n\t\tthis.initAndDrawActivePage();\n\t}",
"function drawPage() {\n\t\n\tif ( !(ERROR_FOUND) ) {\n\t\t// first, draw a menu if there is one\n\t\tif ( CURRENT_PAGE.menu != null ) {\n\t\t \tdrawMenu();\n\t\t}\n\n\t\tdocument.getElementById(\"pag... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Load Custom Texts from Database | _loadCustomTexts() {
//read custom texts from Database and overwrite default texts
let query = "SELECT cat.name, cat.description, t.textKey, t.text ";
query += "FROM text_custom AS t ";
query += "LEFT JOIN text_categories AS cat ON t.catID = cat.ID ";
query += "WHERE t.channelID... | [
"function loadCCText(text) {\n\tclearCC();\n\t//console.log(\"Loading: \"+text);\n\t$('#'+shell.caption.textEl).append(text);\n\tif (CCIsDim) enableCC();\n}",
"function getAllRecordsInDB() {\n PiDictDB.transaction(function(tx) {\n tx.executeSql(\"SELECT * FROM tblPhraseEntities\", [], function(tx, resul... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
looks at curPlayer and toggles it between NASA and USSR | function switchPlayer() {
if (curPlayer == "NASA") {
curPlayer = "USSR";
} else { //curPlayer == "USSR"
curPlayer = "NASA";
}
} | [
"function togglePlayerState() {\n var isPlaying = player.togglePlay();\n\n if (isPlaying) {\n playerPlayIcon();\n } else {\n playerPauseIcon();\n }\n }",
"changePlayerMode() {\n this._inPlayerMode = !this._inPlayerMode\n this.reset()\n }",
"function pl... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get other users reviews | getOtherUserReviews() {
HttpRequestsService.getRequest(`other-user-reviews?usernameId=${this.otherUsernameId}&p=${this.page}`).then(result => {
this.reviewCount = Math.ceil(result.data.reviewsTotal / 5);
this.reviews = result.data.reviews;
}).catch(err => {
EventBus.$... | [
"async function fetchReview() {\n if (user) {\n const res = await axios.get(\n `${baseUrl}/api/ratings/${booking.business_id}/${user.attributes.email}`\n );\n if (res.data.length > 0) {\n setReview(res.data[0]);\n setRating(res.data[0].point);\n setComment(res.data[0].c... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
check if user is super admin | function is_super_admin(user)
{
if(admins.admins.indexOf(user) != -1)
return true; // super admin
return false; // NOT super admin
} | [
"function isSuperAdmin(req, res, next) {\n User.findById(req.user.id).then(user => {\n if (!user) {\n res.status(404).send('User not found');\n }\n // console.log(user);\n if (user.accountType === 'SuperAdmin') {\n req.isSuperAdmin = true;\n } else {\n req.isSuperAdmin = false;\n }... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns a pair: [(regex char class), (POTENTIAL_MATCHES number of strings that might match)] e.g. ["[az09]", ["a", "8", ...]] | function regexCharacterClass()
{
var ranges = rnd(5);
var inRange = rnd(2);
var charBucket = [String.fromCharCode(regexCharCode())]; // from which potenial matches will be drawn
var re = "[";
if (!inRange) {
re += "^";
}
var lo, hi;
for (var i = 0; i < ranges; ++i) {
if (rnd(100) == 0) {
... | [
"function spoccures(string, regex) {\n return (string.match(regex) || []).length;\n }",
"function minimuNumberOfApperances(char, arrayOfStrings) {\n return Math.min(...arrayOfStrings.map(string => (string.match(new RegExp(char,'g')) || []).length));\n}",
"parseRegex(value) {\n // console.log(`parseR... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
FUNCIONES Carga una pagina dentro de un div pasado por parametro | function cargarPagina(div, rutaPagina) {
$("#" + div).load(rutaPagina, function() {
console.log("Pagina \"" + rutaPagina + "\" cargada!")
});
} | [
"function cargarDiv(origen, destino)\r\n{\r\n\t$.ajax(\r\n\t{\r\n\t\turl : origen,\r\n\t\tsuccess : function(data)\r\n\t\t{\r\n\t\t\t$('#' + destino).html(data);\r\n\t\t}\r\n\t});\r\n}",
"function mGetHeader(currentPageName, targetDiv) {\n\tvar parametri = {};\n\tparametri[\"pagina\"] = currentPageName;\n \t$.ge... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Decrypt given buffer using AES. TODO: Move this to own module? | decryptBuffer(buffer, key, iv, algorithm = 'aes-128-ctr') {
let decipher = crypto.createDecipheriv(algorithm, key, iv);
decipher.setAutoPadding(false);
return Buffer.concat([decipher.update(buffer), decipher.final()]);
} | [
"function decrypt(buffer, params) {\n var key = extractKey(params);\n var rs = determineRecordSize(params);\n var start = 0;\n var result = new Buffer(0);\n\n for (var i = 0; start < buffer.length; ++i) {\n var end = start + rs + TAG_LENGTH;\n if (end === buffer.length) {\n throw new Error('Truncate... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Function to publish launch details to the page. Called by launchLibrary and passed a json object closest to the user entered date. | function publishLaunch(launch) {
var placeHolder = 'https://launchlibrary1.nyc3.digitaloceanspaces.com/RocketImages/placeholder_1920.png';
var name = launch.name;
var date = launch.net;
var location = launch.location.name;
var rocket = launch.rocket.name;
var rocketImg = launch.rocket.imageURL;
... | [
"function launchLibrary(year, date) {\n //console.log(date);\n var launchLibraryURL = 'https://launchlibrary.net/1.3/launch?mode=verbose&';\n var targetDate = date.split('-');\n var startDate = 'startdate=' + year[0] + '-' + targetDate + '-01';\n var endDate = '&enddate=' + year[0] + '-' + targetDate... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
check_addr_order return: true: start ip is behind end ip false: start ip is after end ip parameters: ip_s:a string of start ip ip_e:a string of end ip | function check_addr_order(ip_s, ip_e)
{
var arr_ips = ip_s.split('.');
var arr_ipe = ip_e.split('.');
if (arr_ips == null || arr_ipe == null ||
arr_ips.length != 4 || arr_ipe.length != 4) {
return false;
}
for (var i=0; i<4; i++) {
if (arr_ips[i] > arr_ipe[i])
return false;
}
return... | [
"function check_addr(ip, lanip, mask)\r\n{\r\n\tif (ip == null || lanip == null || mask == null)\r\n\t\treturn false;\r\n\r\n\tvar arr_ip \t\t= ip.split('.');\r\n\tvar arr_lanip \t= lanip.split('.');\r\n\tvar arr_mask\t= mask.split('.');\r\n\tvar err = 0;\r\n\t\r\n\t// input is not an IP\r\n\tif (arr_ip == null || ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Query API for exchange rate of our currency and cryptocurrency | async queryAPIforRate(currency, cryptocurrency){
// Query the endpoint
const endpoint = await fetch(`https://api.coinmarketcap.com/v1/ticker/${cryptocurrency}/?convert=${currency}`);
// Return as json
const result = await endpoint.json();
// Return the object
return {
result
}
} | [
"function GetRates(currency, value){\n\tvar valueRate;\n\tif(currency != \"COP\"){\n\t\tvar rates = dbRates.getAllRates();\n\t\tvar f1 = new Date();\n\t\tvar f2;\n\t\tf1.setHours(0,0,0,0);\n\t\tfor (var i = 0; i < rates.length;i++) {\n\t\t\tif(rates[i].nombre === currency){\n\t\t\t\tvar res = rates[i].fecha.split(\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get the number of pending requests | getPendingRequestCount() {
return this._pendingCount;
} | [
"function getCompCount() {\n console.log(\"In getUser\");\n var awarded = 0;\n $.get(\"/app.json\", function(data) {\n completionCount = data;\n console.log(\"This is # of completed tasks in user.js: \"+data);\n count = completionCount;\n console.log(\"Count: \"+count);\n\n }).done(g... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Karma browser reported that updates corresponding Saucelabs jobs whenever a given browser finishes. | function SaucelabsReporter(logger, browserMap) {
const log = logger.create('reporter.sauce');
let pendingUpdates = [];
this.adapters = [];
// This fires when a single test is executed and will update the run in sauce labs with an annotation
// of the test including the status of the test
this.on... | [
"aggregateBrowsers(jobs) {\n // Process failed jobs first, then passed, then incomplete/error.\n jobs = _.sortBy(jobs, job => {\n if (job.passed === false) {\n return 0;\n } else if (job.passed === true) {\n return 1;\n }\n return 2;\n });\n // eslint-disable-next-line ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Scenario Now that the competition gets tough it will Sort out the men from the boys . Men are the Even numbers and Boys are the odd !alt !alt Task Given an array/list [] of n integers , Separate The even numbers from the odds , or Separate the men from the boys !alt !alt | function menFromBoys(arr){
let evenArray = []
let combinedArray =[]
let evenSort = []
let oddSort = []
let oddArray = []
for(let i=0; i<arr.length; i++){
if(arr[i] % 2 === 0){
evenArray.push(arr[i])
}
else{
oddArray.push(arr[i])
}
}
evenSort = evenArray.sort( (a, b) => a - b )... | [
"function pickIt(arr){\n var odd=[],even=[];\n \n for(let i = 0; i < arr.length; i++) {\n if(arr[i] % 2 === 0) even.push(arr[i])\n else odd.push(arr[i])\n }\n\n return [odd,even];\n}",
"function numbersDivider(num) {\n var arr = []\n for(var i = 1; i <= num; i++){\n if(num... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
creates an expression that samples from one of the userdefined channels. don't sample from the same channel that you are using [[target]] on in a loop, just use [[fcolor]] | function channel(channel, vec) {
return new ChannelSampleExpr(channel, vec);
} | [
"function colorTarget() {\n let colorPicked = Math.floor(Math.random() * colors.length);\n return colors[colorPicked];\n}",
"function displayNewColorSample() {\r\n _dom.colorNew[0].innerHTML = _color.toHex() + \"<br/>\"; // for better text selection, we'll add a line break\r\n setSampl... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
returns true/false depending on whether the app exists in the DB regardless whether its status is found or not | async existsInDB() {
let result = {
dataValues: null
};
try {
const tmpResult = await db.appModel.findOne({
where: {
appId: this.appId
}
});
if (tmpResult) {
result = tmpResult;
this.setApp(result.dataValues);
return true;
}
... | [
"function doesApplicationExist (eb, appName) {\n return eb.describeApplications({ ApplicationNames: [appName] }).then(function (data) {\n return !!data.Applications.length;\n });\n}",
"function checkNewApps() {\n if (!localStorage[\"apps\"]) {\n localStorage[\"apps\"] = JSON.stringify(apps);\n }... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
function to call ons website for HTML page containg last updated date | function getUpdatePage(ref){
var cdid = ref
, url = "blank"
$.ajax({
dataType: "text",
url: UPDATE_URL,
success: function(data) {
var part = data.split("<div>Last updated: ")[1];
part = part.split("</div>")[0];
$("#last_date").text("Last updated: " + part);
},
error: funct... | [
"function PageUpdated(date){\n\tjq('#updated').text(date);\n\t}",
"updateLastUpdated() {\n document.getElementById('last_updated').innerHTML = `Last updated: ${new Date()}`;\n }",
"function url_force_reload(url) { \n var date_now = new Date();\n return url + '?v=' + date_now.getTime(); \n}",
"func... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Visit a parse tree produced by Python3Parserlambdef. | visitLambdef(ctx) {
console.log("visitLambdef");
if (ctx.varargslist() !== null) {
return {
type: "LambdaDef",
arguments: this.visit(ctx.varargslist()),
body: this.visit(ctx.test()),
};
} else {
return {... | [
"function Python3Listener() {\n\tantlr4.tree.ParseTreeListener.call(this);\n\treturn this;\n}",
"function cdqlv3Visitor() {\n\tantlr4.tree.ParseTreeVisitor.call(this);\n\treturn this;\n}",
"function createBlocksForAST(ast, workspace) {\n\tconst parse_node = (node) => {\n\t\t\n\t\tconst node_meta = lpe_babel.typ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
dealing with fullscreen button | function fullScreenButton() {
let j = $('[id^="fullscreen"]').on('click', function (e) {
let i = parent.document.getElementsByTagName("iframe")[0]
if (i == null) {
i = document.getElementById("main_container")
}
i.requestFullScreen && i.requestFullScreen();
i.webkitRequestFullScreen && i.... | [
"function updateFullscreenButton() {\n fullscreenIcons.forEach(icon => icon.classList.toggle('hidden'));\n\n if (document.fullscreenElement) {\n fullscreenButton.setAttribute('data-title', 'Exit full screen (f)')\n } else {\n fullscreenButton.setAttribute('data-title', 'Fu... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
14. O functie "produsPozitive" care primeste un array si returneaza produsul numerelor pozitive intrun array primit ca parametru | function produsPozitive(arr) {
let produs = 1;
for (let i = 0; i < arr.length; i++) {
if (arr[i] > 0) {
produs *= arr[i];
}
}
return produs;
} | [
"function productContents(array) {\r\n\tlet product = 1;\r\n\tfor (let i = 0; i < array.length; ++i)\r\n\t{\r\n\t\tproduct *= array[i];\r\n\t}\r\n\treturn product;\r\n}",
"function findMaxProduct(array) {\n\n}",
"function productOfArray(arr){\n if (arr.length === 1) return arr[0]\n return arr[0] * productOfAr... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Takes the original image filename and turns it into originalFileName_size.jpg. | function createPath(fileName, size) {
return fileName.replace(imageTest, "_" + size + "$1");
} | [
"function calculateImageSize(value) {\r\n\r\n}",
"function resize() {\n return new Promise(function (resolve, reject) {\n // print the attributes of the image \n im.identify(['-format', '%wx%h', './public/images/img' + path.extname(file_original_name)], function (err, output) {\n if (e... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get previous step for a specific time | getPreviousStep (time, asIndex) {
let ref = this.tzero;
time -= ref;
time /= (60 * 1000);
let ret = Math.floor(time / this.getStepInterval());
if (asIndex)
ret = ret % this.getTotalStepCount();
return ret;
} | [
"getPreviousTime (step, time) {\n\t\tlet ret = this.getStepTime(step);\n\t\tlet totalTime = this.getTotalInterval() * 60 * 1000;\n\t\twhile (ret > time)\n\t\t\tret -= totalTime;\n\t\treturn ret;\n\t}",
"getNearestTime (step, time) {\n\t\tlet prev = this.getPreviousTime(step, time);\n\t\tlet next = this.getNextTim... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get an existing Cluster resource's state with the given name, ID, and optional extra properties used to qualify the lookup. | static get(name, id, state, opts) {
return new Cluster(name, state, Object.assign(Object.assign({}, opts), { id: id }));
} | [
"static get(name, id, state, opts) {\n return new ServiceLinkedRole(name, state, Object.assign(Object.assign({}, opts), { id: id }));\n }",
"static get(name, id, state, opts) {\n return new Key(name, state, Object.assign(Object.assign({}, opts), { id: id }));\n }",
"static get(name, id, stat... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
returns array of positions of topleft to bottomright corners of given rect as a path | function getCornersOfRect(rect) {
return [
{x: rect.x, y: rect.y},
{x: rect.x + rect.width, y: rect.y},
{x: rect.x + rect.width, y: rect.y + rect.height},
{x: rect.x, y: rect.y + rect.height},
]
} | [
"function getTopLeftOfPaths(paths){\r\n if(paths.length < 1) return [0,0];\r\n \r\n var top = paths[0].top;\r\n var left = paths[0].left;\r\n\r\n for(var i = 0, iEnd = paths.length; i < iEnd; i++){\r\n\r\n var cb = paths[i].controlBounds; // left, top, right, bottom\r\n \r\n if(... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
delete an elem when key is pressed | function inputElem_delete_byKey(e) {
var elem = $(this);
} | [
"function OnkeyDown(event){\n var activeObject = PhotoCollage.getActiveObject();\n if (event.keyCode === 46) {\n \tPhotoCollage.remove(activeObject);\n }\n}",
"function deleteLetterIndex(e) {\n const word = document.querySelector('.word.active') || wordsContainer.firstChild\n if (word.lastChild.clas... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Fetch a value from our 2D perlin noise map and return it | function getNoiseValue(x, y, frequency) {
return Math.abs(noise.perlin2(x / frequency, y / frequency));
} | [
"function polyGetNoise(seed, nonce) {\r\n var l = paramsETA * paramsN / 4;\r\n var p = indcpaPrf(l, seed, nonce);\r\n return byteopsCbd(p);\r\n}",
"function PerlinNoise() {\n //srandom(clock());\n \n this.perlin_TWOPI = SINCOS_LENGTH;\n this.perlin_PI = this.perlin_TWOPI / 2;\n \n this.cosTable = [... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
get bag items by customer id | async getBagItemsByCustomerId(req, res) {
const customerId = req.params.customerId;
var { error } = Joi.validate(customerId, Joi.objectId().required());
if (error) {
return res.status(404).send(error.details[0].message);
}
const bag = await Bag.find({ customer: customerId })
.populate... | [
"async getBagItemById(req, res) {\n const bagItemId = req.params.bagItemId;\n\n var { error } = Joi.validate(bagItemId, Joi.objectId().required());\n\n if (error) {\n return res.status(404).send(error.details[0].message);\n }\n\n const bag = await Bag.findById(bagItemId)\n .populate(\"custo... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
4. First and Last K Numbers | function firstLastKNums (arr) {
let countNums = arr[0];
console.log(arr.slice(1, countNums + 1).join(' '));
console.log(arr.slice(arr.length - countNums, arr.length).join(' '));
} | [
"function lastKNums (length, sequence) {\n let arrWithNums = [1];\n while (arrWithNums.length < length) {\n let result = 0;\n if (sequence >= arrWithNums.length) {\n let currentNum = arrWithNums.reduce ((acc, val) => {return acc + val});\n result += currentNum;\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns a valid vertical alignment. | function validateVerticalAlignment(align) {
var ALIGNMENTS = ['top', 'center', 'bottom'];
var DEFAULT = 'top';
return ALIGNMENTS.includes(align) ? align : DEFAULT;
} | [
"function validateMatrixAlignment(align) {\n var DEFAULT = 'center center';\n\n if (align) {\n var _align$split = align.split(' '),\n _align$split2 = _slicedToArray(_align$split, 2),\n y = _align$split2[0],\n x = _align$split2[1];\n\n return validateVerticalAlignment(y) + ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Initializes the binding start index. Will get inlined. This function must be called before any binding related function is called (ie `bind()`, `interpolationX()`, `pureFunctionX()`) | function initBindings() {
ngDevMode && assertEqual(currentView.bindingStartIndex, -1, 'Binding start index should only be set once, when null');
ngDevMode && assertEqual(currentView.bindingIndex, -1, 'Binding index should not yet be set ' + currentView.bindingIndex);
currentView.bindingIndex = currentView.b... | [
"setupTagIndexForBindings() {\n this.bindingEventListener = ({ binding, operation }) => {\n if (operation === 'tag') {\n this.updateTagIndexForBinding(binding);\n }\n };\n this.tagIndexListener = event => {\n const { binding, type } = event;\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Function to take the membershipType (i.e. platform) and the name (userName) and return the playerID number. | async function _getPlayerId(membershipType, name) {
const endpoint = `SearchDestinyPlayer/${membershipType}/${name}`;
let networkName = (membershipType === 1 ? 'xbox' : 'psn');
console.log('_getPlayerId: networkName=%j, endpoint=%j', networkName, endpoint);
return api(endpoint)
.then(resp => {
if (!resp) thr... | [
"async function _getCharacterId(membershipType, playerId) {\n\tconst endpoint = `${membershipType}/Account/${playerId}`;\n\tconsole.log('_getCharacterId: networkName=%j, playerId=%j, endpoint=%j', membershipType, playerId, endpoint);\n\n\treturn api(endpoint)\n\t\t.then(resp => {\n\t\t\tif (!resp) {\n\t\t\t\tthrow ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
onRememberChange: call to action remember. this action defined in middle | onRememberChange(checked) {} | [
"onRememberChange(checked) {\n this.props.dispatch(actions.auth.rememberChange(checked));\n }",
"toggleRemember(drug) {\n\t\tif(drug.isRemembered) {\n\t\t\tthis.removeFromRememberList(drug.id);\n\t\t} else {\n\t\t\tthis.addToRememberList(drug.id);\n\t\t}\n }",
"function change_nickname(new_nickname) {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Extract props from theme props and omit those from props | function extractProps(props, theme, colorModeProps, componentTheme, currentBreakpoint) {
let newProps = {};
for (let property in props) {
// If the property exists in theme map then get its value
if (themePropertyMap[property]) {
let propValues = extractPropertyFromFunction(property, props, theme, co... | [
"removeUsedProps(aProps) {\n\t\t//METODO: change this to actual source cleanup\n\t\tdelete aProps[\"input\"];\n\t\tdelete aProps[\"groupBy\"];\n\t}",
"_getPartialProperties(props) {\n const options = this.get(); // remove attributes from the prop that are not in the partial\n\n Object.keys(options).forEach(... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Finds the corners of walls. This reduces the amount of work that dijkstra has to do for each block in the map: if a block has neighbor walls in diagonal directions: for each neighbor in diagonal walls: if there are no straight walls in the direction where the diagonal neighbor wall is, mark the block as a corner | function findCorners() {
var corners = [];
for (var y = 0; y < map.length; ++y) {
for (var x = 0; x < map[y].length; ++x) {
if (map[y][x] !== WALL) {
var diagonalBoxes = nearBoxes(x, y, COORD_MODE_DIAGONAL);
for (var i = 0; i < diagonal... | [
"function syncWalls() {\n\tfor (var w_index = 0; w_index < maze.width; w_index++) {\n\t\tfor (var h_index = 0; h_index < maze.height; h_index++) {\n\t\t\tif (w_index > 0 && maze.cells[w_index-1][h_index].right) {\n\t\t\t\tmaze.cells[w_index][h_index].left = generateWall(w_index*maze.cellWidth - maze.wallWidth/2, h_... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
select all from Encuestas | function queryEncuestas(tx){
tx.executeSql('SELECT * FROM Encuestas',[],pullEncuestas);
} | [
"function listarEncargados(req, res){\n Encargado.find({}, (err, encargados)=>{\n if(err){\n res.status(500).send({message: 'Error al traer los profesores'});\n }else{\n res.status(200).send({encargados});\n }\n });\n }",
"function ob... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Determine whether the given properties match those of a `OpenIDConnectConfigProperty` | function CfnGraphQLApi_OpenIDConnectConfigPropertyValidator(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... | [
"function CfnDataSource_OpenSearchServiceConfigPropertyValidator(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... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Transform the freeform body into a serialized format suitable for transmission to the server. | serializeBody() {
// If no body is present, no need to serialize it.
if (this.body === null) {
return null;
}
// Check whether the body is already in a serialized form. If so,
// it can just be returned directly.
if (isArrayBuffer(this.body) || isBlob(this.bod... | [
"convertBodyData(bodyData) { return convertBodyData(bodyData); }",
"setBody (body) {\n this.headers['Content-Type'] = 'application/json'\n this.body = JSON.stringify(body)\n }",
"_getPatchBody(value) {\n let body = {};\n const patch = this.config.patch;\n value = typeof value !== 'un... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Compute the value of vertex a | get a() {
return this.vertices[0];
} | [
"get c() {\n return this.vertices[2];\n }",
"get vertexData() {\n if (!this._vertexData)\n this._vertexData = new VertexData(this.effect.vertexFormat, 4)\n return this._vertexData\n }",
"set ForceVertex(value) {}",
"add_vertex (id=this.V.length) {\n const vert = this.V[id];\n\n i... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
scale the given unsigned number, according to byte pos | function scaleNum(num, pos) {
var scaled = (num << (8 * pos)) >>> 0;
return scaled;
} | [
"function normaliseScale(s) {\n if (s > 1) throw('s must be <1');\n s = 0 | (1 / s);\n var l = log2(s);\n var mask = 1 << l;\n var accuracy = 4;\n while (accuracy && l) {\n l--;\n mask |= 1 << l;\n accuracy--;\n }\n return 1 / ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |