query stringlengths 9 34k | document stringlengths 8 5.39M | negatives listlengths 19 20 | metadata dict |
|---|---|---|---|
show image and replace img child src | function showImg(e) {
imgDiv.className = "display_img";
imgDivChild.src = e.target.src;
} | [
"function changeDisplayImage(image){\n displayedImage.setAttribute('src', image);\n}",
"function changeImg(e) {\n displayedImage.setAttribute('src',e.target.getAttribute('src')); \n}",
"function change_photo_show(ImgD)\n{\n\tvar img_show=document.getElementById('img_main');\n\timg_show.src=ImgD.src;\n}"... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
init function fill cell info to puzzledData array, set cells position x, y and adding event listener on cell click | function init() {
const board = document.getElementsByClassName(className)[0];
boardLength = board.children.length;
rowSize = colSize = Math.sqrt(boardLength + 1);
elWidth = elHeight = 100 / rowSize;
for (let [index, el] of Object.entries(board.children)) {
const valu... | [
"function initialize() {\n // loop over all cells\n // in other words, loop over every row in the table (<tr>)\n // and inside that loop, loop again over every cell in that row (<td>).\n // set on click handler for every cell. The click handler must\n // flip the class attribute of that cell between dead and a... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
maskPhoneInput: Use formatter.js to force valid input on 'tel' inputs | function maskPhoneInput() {
// makes the assumption that there can only be 1 'tel' input per page
var elPhoneInput = document.querySelectorAll('input[type="tel"]')[0];
// check if input[type="tel"] does not exist
if (elPhoneInput == null) {
return;
}
// our input[type="tel"] DOES exist..
var formatt... | [
"maskTel(tel) {\n tel.addEventListener(\"input\", function(e) {\n const input = e.target.value.replace(/\\D/g, \"\").match(/(\\d{0,2})(\\d{0,5})(\\d{0,4})/)\n e.target.value = !input[2] ? input[1] : \"(\" + input[1] + \") \" + input[2] + (input[3] ? \"-\" + input[3] : '')\n })\n }",
"formatPhone(... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Creates the detail element for a given sensor and response type Takes the parent, a response type, sensor number, and trigger number. Returns an appropriate element | function createDetail(p,r,n,i){
var detail;
if(r == "keyboard"){
detail = document.createElement("input");
detail.setAttribute("type", "text");
detail.setAttribute("defaultValue", "Key");
detail.setAttribute("maxlength","1");
} else if (r == "mouse"){
detail = document.createElement("select");
var opt = ... | [
"create(type, environment, parent) {\n switch (type) {\n case 'compass':\n return new Compass(\"Compass\", environment, parent);\n break;\n case 'ultrasound':\n return new Ultrasound(\"Ultrasound\", environment, parent);\n brea... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Determine if a ray and a line segment intersect, and if so, determine the collision point | function getIntersection(x1, y1, x2, y2, x3, y3, x4, y4){
var denom = ((x2 - x1)*(y4 - y3)-(y2 - y1)*(x4 - x3));
var r;
var s;
var x;
var y;
var b = false;
//If lines not collinear or parallel
if(denom != 0){
//Intersection in ray "local" coordinates
r = (((y1 - y3) * (x4 - x3)) - (x1 - x3) * (... | [
"static intersectLineWithRay2D(line, ray) {\n let pt = Line.intersectRay2D(line, ray);\n return (pt && Num_1.Geom.withinBound(pt, line[0], line[1])) ? pt : undefined;\n }",
"intersectionLineST(line) {\n // the two points on two lines the closest two each other are the ones whose\n /... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
checks if spots have had droppable if not it enables it. | function MakespotsDroppable() {
var disabled = "disabled";
for (var i = 1; i <= $("#board div").length; i++) {
if (
$("#spot" + i)
.attr("class")
.search(disabled) > 0 &&
$("#spot" + i).has("img").length == 0
) {
$("#spot" + i).droppable("enable");
}
}
} | [
"function checkVictory() {\n return ($('.ui-droppable').length == 0)\n}",
"enable() {\n if (!this.completed) {\n this.slotEl.droppable(\"enable\");\n this.pieceEl.draggable(\"enable\");\n }\n }",
"disable() {\n this.slotEl.droppable(\"disable\");\n this.pi... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
returns an array of the three other coins in correct order used by makeSmallAssets | returnOtherAssets(){
switch (this.props.coin) {
case 'Bitcoin':
return ["Litecoin", "Ethereum", "Bitcoin Cash"];
case 'Ethereum':
return ["Bitcoin", "Litecoin", "Bitcoin Cash"];
case 'Litecoin':
return ["Bitcoin", "Ethereum", "Bitcoin Cash"];
case 'Bitcoin Cash':
... | [
"function coins(price) {\n const coinsAll = [1, 2, 5, 10, 20, 50, 100]\n\n\n}",
"coins(s, g, rootState) {\n const runePrice = (asset) => {\n if (assetFromString(asset).ticker === 'RUNE') return 1;\n if (!rootState.pools.pools[asset]) return null;\n return rootState.pools.pools[asset].price;\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Validate if the cursor was killed by the user | function isCursorKilled(self, callback) {
if (self.cursorState.killed) {
setCursorNotified(self, callback);
return true;
}
return false;
} | [
"function isCursorDeadAndKilled(self, callback) {\n if (self.cursorState.dead && self.cursorState.killed) {\n handleCallback(callback, new MongoError('cursor is dead'));\n return true;\n }\n\n return false;\n}",
"function isCursorDeadButNotkilled(self, callback) {\n // Cursor is dead but not marked kill... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
function that returns a base64 representation of the canvas | function getImageAsBase64FromCanvas(canvas) {
// return only the base64 image not the header as reported in issue #2
// return canvas.toDataURL('image/jpeg', 1.0).split(',')[1];
return canvas.toDataURL('image/jpeg', 1.0);
} | [
"function getImageAsBase64FromCanvas(canvas) {\r\n // return only the base64 image not the header as reported in issue #2\r\n return canvas.toDataURL('image/jpeg', 1.0).split(',')[1];\r\n\r\n }",
"function getBase64String(imgId) {\n\tvar canvas = document.createElement('canvas');\n\tvar ctx = canvas.getCon... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Generic function for building tree store data from an array of nodes. A node's parent is specified by its parentIdKey field (e.g. 'replyTo') A node's id is specified by its idKey field (e.g. 'commentId') This function returns an object with a 'children' field holding an array of toplevel child nodes. A toplevel child n... | function buildTreeStoreDataUtil(nodes, idKey, parentIdKey) {
if (nodes && nodes.length == 0)
return {expanded: true, children: []};
// Build map of nodes keyed by idKey field
var node;
var nodeMap = {};
for (var i = 0; i < nodes.length; i++) {
no... | [
"function recursiveCreateTree(dataNodes, parentTreeNode, childDataNodeIds) {\n\n var childDataNodes = childDataNodeIds.map(i => dataNodes[i]);\n\n\n //Look for elements in childDataNodes that are undefined\n if (childDataNodes.findIndex(c => !c) >= 0)\n return {\n [parentTreeNode.treeNodeI... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
issues are an array of issue objects (vulns, licnese issues). This reads the licenseUrl or licenseTemplateUrl and adds the license full text from there to the object, in the licenseText property. | function addFulltextToLicenses(issues) {
return fetchAllLicenses(issues) // fill cache
.then(function enhance() {
return issues.map(function (issue) {
var licenseUrl = issue.licenseUrl || issue.licenseTemplateUrl;
if (Array.isArray(licenseUrl)) {
issue.licenseText = licenseUrl.... | [
"function processRepoIssues(RepoName, RepoHtmlUrl, issue) {\n var out ='';\n var HtmlUrl;\n var arr;\n var issueType;\n var title;\n var number;\n var body;\n var labels;\n var created_at;\n var updated_at;\n var labelData = \"\";\n for (var i = 0; issue[i] != undefined; i++) {\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
12) Write a function that randomly generates a number between 1 and 12, and returns the name of the corresponding month. | function getMonth() {
const monthNames = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"];
var number = (Math.floor(Math.random()*12));
return monthNames[number];
} | [
"function randomMonth (){\nconst months = [\"Jan\",\"Feb\", \"March\", \"April\",\"May\",\"June\",\"July\",\"August\",\"September\",\"October\",\"November\",\"December\"];\nvar randomNumber= Math.floor(Math.random(1)*12);\nvar correspondingMonth = months [Math.floor(Math.random(1)*12)];\nreturn correspondingMonth\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Merge props and customizations giving priority to props over context. NOTE: This function will always perform multiple merge operations. Use with caution. | function mergeCustomizations(props, parentContext) {
var _a = (parentContext || {}).customizations, customizations = _a === void 0 ? { settings: {}, scopedSettings: {} } : _a;
return {
customizations: {
settings: mergeSettings(customizations.settings, props.settings),
scoped... | [
"function mergeCustomizations(props, parentContext) {\n var _a = (parentContext || {}).customizations, customizations = _a === void 0 ? { settings: {}, scopedSettings: {} } : _a;\n return {\n customizations: {\n settings: Object(_mergeSettings__WEBPACK_IMPORTED_MODULE_0__[\"mergeSettings\"])... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
fire the date range validator | function FireDateRangeValidator() {
ValidatorValidate($(dateRangeValidator));
} | [
"function handleDateRangeValidation() {\n var container = document.getElementById(\"date-range-input-row\");\n var errorSpan = document.getElementById(\"date-error-span\");\n var dateRange = [];\n var inputFields = container.getElementsByTagName(\"input\");\n var anyFieldEmpty = false;\n for (var ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Helper Method to check if there is any suggestion | hasSuggestions() {
return this.filteredAirports && Object.keys(this.filteredAirports).length > 1;
} | [
"acceptSuggestion() {\n }",
"function ew_IsAutoSuggest(el) {\n\tvar $ = jQuery, $el = $(el);\n\treturn ($el[0] && $el.is(\":hidden\") && $el.data(\"autosuggest\"));\n}",
"haveCompletionEngine(searchUrl) {\n return !this.lookupEngine(searchUrl).dummy;\n }",
"_checkFuzzy() {\n if (!isObject(this._su... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Item onMouseEnter event handler. | _itemOnMouseEnter() {
const that = this;
if (that.disabled || !that.ownerListBox) {
return;
}
if (JQX.ListBox.DragDrop.Dragging && that.ownerListBox.allowDrop) {
JQX.ListBox.DragDrop.DropDetails = { item: that, position: 'bottom' };
}
if (that.o... | [
"function onMouseEnter() {\n LxNotificationService.success('Mouse enter callback');\n }",
"function doOnItemMouseEnter(){\n\t\t\telemFadeIn($(this).find('.'+o.plusClass));\n\t\t\tif(!o.desaturate){\n\t\t\t\telemFadeOut($(this).find('img'), 0.8);\n\t\t\t}\n\t\t}",
"mouseEnter(event) {\n this.setHove... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Send initialisation packet to server. | sendInitData () {
if (this.socket) {
this.socket.emit('init', {
name: this.name,
icon: this.icon,
hasMessages: this.hasMessages()
})
this.sendNewMessages()
}
} | [
"_sendClientInit() {\n this._log(`Sending clientInit`);\n this._waitingServerInit = true;\n // Shared bit set\n this.sendData(new Buffer.from([1]));\n }",
"async sendInit() {\n try {\n if (rpcClient && (rpcClient.connected === undefined || rpcClient.connected)) {\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
reference for the notificationWatcher start the regular notification checks | function startNotificationWatcher() {
notificationCheck(true);
notificationWatcher = setInterval(notificationCheck, 5000);
} | [
"function startWatcher() {\n console.log('startWatcher() notificationsPromise: ', notificationsPromise);\n notificationsPromise = $interval(function notificationWatcher() {\n console.log('notificationWatcher called');\n updateNotifications();\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
MOOD METER ADJUST adjust mood meter based on last video "watched" | function adjustMoodMeter(data) {
console.log(currentIndex);
if (moodMeter < 4 && data[currentIndex].tag == "verygood") {
moodMeter = moodMeter + 2;
console.log(moodMeter);
} else if (moodMeter >= 4) {
gameState = "win";
gameOver();
}
if (moodMeter < 4 && data[currentIndex].tag == "good") {
... | [
"function updateMagnetization(){\n\t\t\tvar sum=0;\n\t\t\tfor(var i=THERMTIME; i<=TIME; i++ ) { sum += M[i]; }\n\t\t\tavgmag= sum/(TIME-THERMTIME+1);\n\t\t\t$('#magval').text(''+(m.pow(avgmag,2)).toFixed(8));\n\t\t}",
"advance(dt) {\n const n = this.meanAngularMotion();\n let M = (this.M + (n * (dt / 1000))... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Prints TypeofTypeAnnotation, prints argument. | function TypeofTypeAnnotation(node, print) {
this.push("typeof ");
print.plain(node.argument);
} | [
"function TypeofTypeAnnotation(node, print) {\n this.push(\"typeof \");\n print.plain(node.argument);\n}",
"function TypeAnnotation(node, print) {\n this.push(\":\");\n this.space();\n if (node.optional) this.push(\"?\");\n print.plain(node.typeAnnotation);\n}",
"function TypeAnnotation(node, print) {\n\t... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Helper function: Checks for the flea market contains atleast one of the items selected. | function _containsItems(fleamarket)
{
for(var i = 0; i < fleamarket.fleamarket_items.length; i++)
{
if($scope.itemsSelected.indexOf(fleamarket.fleamarket_items[i].name) > -1)
return true;
}
return fa... | [
"isPickInStoreSelected() {\n const pickupInStore = this.props.orderItems.filter(item => item.shipModeCode === 'PickupInStore');\n if (pickupInStore.length) {\n return true;\n }\n return false;\n }",
"isSGSelected() {\n const pickupInStore = this.props.orderItems.filter(item => item.shipModeCo... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
update position, angle, angular velocity, and velocity from new physical state. | refreshFromPhysics() {
this.copyVector(this.physicsObj.position, this.position);
this.copyVector(this.physicsObj.velocity, this.velocity);
this.angle = this.physicsObj.angle;
this.angularVelocity = this.physicsObj.angularVelocity;
} | [
"updateVelocity() {\n\n\t\tconst diff = utils.calculateAngleBetweenDirections(this.targetedAngle, this.visibleAngle)\n\t\t\n\t\tthis.velocity = this.velocity * 0.5 + diff * 2\n\n\t}",
"function updateRobotState(timeDiff) {\n actualState.velX = (robotSpecs.wheelRadius / 4) *\n (control.wheel1 - control.w... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
getinterval operator s : src o : offset l : length | function $geti(s, o, l) {
if (s instanceof Uint8Array) {
return s.subarray(o, o + l);
}
if (s instanceof Array) {
var a = new Array(l);
a.b = s.b; // base array
a.o = s.o + o; // offset into base
return a;
}
// Must be a string
return s.substr(o, l);
} | [
"relativeTo(that) {\n if (this.sourceString !== that.sourceString) {\n throw errors.intervalSourcesDontMatch();\n }\n assert(\n this.startIdx >= that.startIdx && this.endIdx <= that.endIdx,\n \"other interval does not co... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Unique argument names A GraphQL field or directive is only valid if all supplied arguments are uniquely named. | function UniqueArgumentNamesRule(context) {
var knownArgNames = Object.create(null);
return {
Field: function Field() {
knownArgNames = Object.create(null);
},
Directive: function Directive() {
knownArgNames = Object.create(null);
},
Argument: function Argument(node) {
var argN... | [
"function UniqueArgumentNamesRule(context) {\n return {\n Field: checkArgUniqueness,\n Directive: checkArgUniqueness\n };\n function checkArgUniqueness(parentNode) {\n var _parentNode$arguments;\n\n // FIXME: https://github.com/graphql/graphql-js/issues/2203\n\n /* c8 ignore next */\n const arg... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Plot error heatmap in a certain div. | function plot_error_heatmap_in_div(canvas_id, esb_type, esb_size) {
if (inputObject.sort_by !== 'param' && inputObject.sort_by !== 'width' && inputObject.sort_by !== 'depth') {
alert('Sort by incorrect:', inputObject.sort_by);
return;
}
var tt = document.getElementById(canvas_id);
if (tt... | [
"createTooltipDiv(heatMap) {\n let element = createElement('div', {\n id: this.heatMap.element.id + 'legendLabelTooltipContainer',\n styles: 'position:absolute'\n });\n this.heatMap.element.appendChild(element);\n }",
"function plotExpectedTable(title, data) {\n \n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Return the latest update level for the given parameters Typically will not be called with an `id`, and is directly | async get(id, params) {
const channel = params.query.channel || 'general';
const level = params.query.level;
const instance = await this.app.service('status').get(id);
/*
* When there isn't any client level, the response is simple, just give
* them the latest in their channel
*/
if (... | [
"update(id, level) {\n // CRUD - Create, Read, Update, Delete\n }",
"updateAccess(ul_id, param) {\n this.db.init();\n this.db.update(\"user_level\", param);\n this.db.where(\"ul_id\", ul_id);\n\n return this.db.execute();\n }",
"getLevelId(){\n return this.last.Level.... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Default compareKeys function will work for numbers, strings and dates | function defaultCompareKeysFunction (a, b) {
if (a < b) { return -1; }
if (a > b) { return 1; }
if (a === b) { return 0; }
throw { message: "Couldn't compare elements", a: a, b: b };
} | [
"function defaultCompareKeysFunction(a, b) {\n\tif (a < b) {\n\t\treturn -1;\n\t}\n\tif (a > b) {\n\t\treturn 1;\n\t}\n\tif (a === b) {\n\t\treturn 0;\n\t}\n\n\tthrow {\n\t\tmessage : \"Couldn't compare elements\",\n\t\ta : a,\n\t\tb : b\n\t};\n}",
"function defaultCompareKeysFunction (a, b) {\n\t if (a < b) { r... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Send positions to all players in a radius | sendPos()
{
for(const playerId in this.players)
{
const data = []
const player = this.players[playerId]
data.push({
name: player.name,
color: player.color,
position: player.engineObject.position,
musicInfo: player.musicInfo
})
for(const nearPlayer ... | [
"broadcastPlayerPositions() {\n const positions = {};\n\n this.players.each((player) => {\n positions[player.getId()] = {\n color: player.getColor(),\n position: player.getPosition()\n };\n });\n\n this.broadcast('player-position', posi... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
is grid matrix solved? | function gridSolved(grid) {
return flatten(grid, 2).length === 36;
} | [
"solve(grid) {\n let updated = false;\n for (let r = 0; r < 9; r++) {\n for (let c = 0; c < 9; c++) {\n if (grid[this.getIndex(r,c)] == null) {\n if(this.trySolveSquareElimination(grid,r,c)) {\n updated = true;\n }... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Convert page.xml to page.markdown | function convert(filename, callback){
fs.readFile(filename, function(err, data) {
var dir = filename.replace(/page\.xml$/, '');
data = data + '';
data = data.replace(/ /g, ' '); // clear up bug that was messing up HTML
var doc = new xmldoc.XmlDocument(data);
var... | [
"function convertMarkdownToHtml(filename, type, text, config) {\n text = addTocToContent(text)\n let md = {}\n\n try {\n try {\n console.log(\"[pretty-md-pdf] Converting (convertMarkdownToHtml) ...\")\n let hljs = require(\"highlight.js\")\n let breaks = config[\"breaks\"]\n md = require(\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
calcula as horas considerando a tolerancia | function calcularTolerancia(dataHoras) {
var toleranciaAMais = toMinutes(jornadaCertPonto + ':00') + tolerancia;
var toleranciaAMenos = toMinutes(jornadaCertPonto + ':00') - tolerancia;
for (i in dataHoras) {
var minRealizadas = toMinutes(dataHoras[i].horas);
if (minRealizadas >= toleranciaA... | [
"function horas(entrada, saida) {\n total = 0;\n entradasec = 0;\n saidasec = 0;\n entrada = entrada.split(\":\");\n saida = saida.split(\":\");\n for (i = 0; i < entrada.length; i++) {\n if (i == 0) {\n entradasec += (entrada[0] * 3600);\n saidasec += (saida[0] * 3600... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Retrieve the player that isn't the given player | getOtherPlayer(basePlayer = this.currentPlayer) {
return this.players.find((player) => player.color !== basePlayer.color);
} | [
"getFirstNotExplodedPlayer() {\n const playersNotExploded = this.players\n .filter((player) => !player.isExploded());\n return playersNotExploded.length > 0 ? playersNotExploded[0] : null;\n }",
"function targetPlayer(){\n \tvar playing = whatIsPlaying();\n \tif(playing !== null)\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Which fields are to be considered "upload" ones | static get uploadFields () { return {} } | [
"canUpload () {\n return this.editable === true &&\n this.isBusy !== true &&\n this.isUploading !== true &&\n this.queuedFiles.length > 0\n }",
"function decideUpload() {\n\tconst inputFile = document.querySelector('#newFile');\n\tconst btnUpload = document.querySelector('#b... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This class defines a complete listener for a parse tree produced by LogicParser. | function LogicListener() {
antlr4.tree.ParseTreeListener.call(this);
return this;
} | [
"function Listener() {\n\tantlr.tree.ParseTreeListener.call(this);\n this.nodeMap = {};\n this.nodeEdges = [];\n this.trivialRoot = null;\n this.crnt_id = -1;\n this.makeCytoNode = makeCytoNode;\n\treturn this;\n}",
"function logicalListener() {\n\tantlr4.tree.ParseTreeListener.call(this);\n\tretur... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Method to load stats data | function loadStatsData(data) {
stats = data;
} | [
"function loadStats() {\n if (statsPath == undefined) return\n if (existsSync(statsPath)) {\n try {\n stats = JSON.parse(readFileSync(statsPath).toString())\n return\n } catch (e) {\n error(\"Failed to read \", e)\n }\n }\n\n if (existsSync(statsPath... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
hardStopTweets() : void This function immediately stops tracking tweets using the Twitter API. | hardStopTweets(){
const twitterConsumerSecret = require('./twitterConfig').consumer_secret;
const twitterTokenSecret = require('./twitterConfig').token_secret;
const Twitter = require("node-tweet-stream")
, twitterAPI = new Twitter({
consumer_key: 'DnXz3QBEptjCkSCXoKmj690GQ',... | [
"function stopTweets(){\n console.log(\"Timer cleared.\\n\")\n clearInterval(timer);\n}",
"stop() {\n\t\tif(this.running) {\n\t\t\tthis.newConfig();\n\n\t\t\tthis.stream.close();\n\t\t\tthis.running = false;\n\n\t\t\tthis.userArgs.DEBUG && this.utils.console(\"Twitter API stopped \");\n\t\t}\t\t\n\t}",
"s... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
When viewing something other than a project, and the current task has a project associated with it, jumps to the project and reselects the task. When viewing a project, and the current task has a time associated with it that is within the next 7 days, then it jumps to "next 7 days" and reselects the task. | function navigateToTask() {
const cursor = requireCursor();
const isFilterView = getIsFilterView();
if (viewMode === 'project' && !isFilterView) {
const dateSpan = getUniqueClass(cursor, 'date');
if (dateSpan) {
withId('top_filters', (topFilters) => {
const predicate = matching... | [
"updateWeekProject() {\n this.getProject('This week').tasks = []\n\n this.projects.forEach((project) => {\n if (project.getName() === 'Today' || project.getName() === 'This week')\n return\n\n const weekTasks = project.getTasksThisWeek()\n weekTasks.forEach((task) => {\n const tas... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
The `integer` type is just a wrapper for the `number` type. The `number` type returns floating point numbers, and `integer` type truncates the fraction part, leaving the result as an integer. | function integerType(value) {
var generated = number(value);
// whether the generated number is positive or negative, need to use either
// floor (positive) or ceil (negative) function to get rid of the fraction
return generated > 0 ? Math.floor(generated) : Math.ceil(generated);
} | [
"function integerType(value) {\n return numberType(Object.assign({ multipleOf: 1 }, value));\n }",
"function IntegerType() {\n}",
"function Int(value) {}",
"function IntegerValue() {}",
"Integer(options = {}) {\r\n return { ...options, kind: exports.IntegerKind, type: 'integer' };\r\n }",
"f... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
SetFieldDisabled Changes the state (enable/disable) of the given field id. Parameters: field_id: ID or name of the field disabled_state: true if the field should be disabled, false otherwise | function SetFieldDisabled(field_id, disabled_state)
{
var field = document.getElementById(field_id);
if (!field)
{
// id not found, check for name
field = document.getElementsByName(field_id);
if (field)
{
field = field[0];
}
}
if (field)
{
... | [
"function disableField(fieldid) {\n\t// disable the respective field and add the class disabled field\t\t\n\t$(\"#\" + fieldid).attr(\"disabled\", \"disabled\").addClass('disabledfield');\n}",
"function setDisabled(elementId, disabledState){\n\tvar elem = document.getElementById(elementId);\n\tif(elem != null){\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Validates the provided named option has the native JavaScript type using typeof checks. | function validateNamedType(functionName, type, optionName, argument) {
validateType(functionName, type, optionName + " option", argument);
} | [
"function verifyOptionType(sourcePath, name, value) {\n if (typeof value === 'object') {\n var msg = 'POSTCSS-HASH-CLASSNAME ERROR: Object value not supported for option \"' + name + '\"!';\n console.error(msg);\n throw new Error(msg);\n } else if (!sourcePath && typeof value === 'function') {\n var m... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Funtion to reenable any cards that have not been matched | function enableUnmatched(){
Array.prototype.filter.call(deckOfCards, function(card){
// removes disabled class from card div
card.parentElement.classList.remove('disabled');
});
//Call disableMatched function to permantly disable matched cards
disableMatched();
} | [
"function enable(){\n let matchedCard=matchedCardState();\n Array.prototype.filter.call(cards, function(card){\n card.classList.remove('disabled');\n //redisable cards that are already matched\n for(var i = 0; i < matchedCard.length; i++){\n matchedCard[... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Compare if two dates are within the same day. | function isDateWithinSameDay(date1, date2) {
return date1.getDate() === date2.getDate() &&
date1.getMonth() === date2.getMonth() &&
date1.getFullYear() === date2.getFullYear();
} | [
"function isSameDate(date1, date2) {\n return eq(date1, date2, 'day')\n}",
"function dates_equal(d1, d2) {\r\n if (!d1 || !d2)\r\n return false;\r\n else\r\n return d1.getDate() == d2.getDate() &&\r\n d1.getMonth() == d2.getMonth() &&\r\n d1.getFullYear() == d2.getFullYear();\r\n}",
... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
function for creating new lecture inside a subject | function createNewLecture(){
var category = document.getElementById("subjectName").innerHTML;
var chooseName = document.getElementById("chooseName").value;
var chooseDate = document.getElementById("chooseDate").value;
var chooseTime = document.getElementById("chooseTime").value;
var created = docum... | [
"function createLecture() {\n // Retrieve the values from each of the input fields.\n var courseTitle = $('#courseTitle')[0].value;\n var lectureTitle = $('#lectureTitle')[0].value;\n var instructor = $('#instructor')[0].value;\n \n // Ensure something was entered for each field.\n if (!courseT... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get site json for the given website and release. /sites// Examples: | async function _getSite(contentStoreEndpoint, site, release) {
console.debug('_getSite: Entry');
// let siteUrl = contentStoreEndpoint + '/sites/' + site + '/';
let siteUrl = `${contentStoreEndpoint}/sites/${site}/${release}/`;
let options = {
url: siteUrl,
json: true
}
try {
console.debug('_ge... | [
"async getSites() {\n const { baseSite } = localSettings;\n return await this.get('/sites', baseSite);\n }",
"function getMicrositeList( ) {\n return $.getJSON('javascript/microsites.json').pipe(function (data) {\n return data.sites;\n });\n }",
"function getActiveSites() {\n developer.Api('... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
SELECTING MASTERS FUNCTIONS OVER ALL THE FUNCTIONS FOR ADDING ROWS DYNAMICALLY / Purpose: It deletes a row from the table. Parameters: oTableBody The handle to the body of the table, whose row is to be deleted. formName The name of the form which contains the checkbox. checkBoxName The name of the delete checkbox. All ... | function CHMdeleteRow(oTableBody,formName,checkBoxName,cntOfCells)
{
// Loop through rows
var i = 0;
for( i=0; oTableBody.rows.length >= 1 && i<eval('document.'+formName+'.'+checkBoxName).length;i++)
{
if(eval('document.'+formName+'.'+checkBoxName)[i].checked)
{
oTableRow = oTableBod... | [
"function delRow(tableID,checkBoxName)\n{\n\tvar objBox = document.all(checkBoxName) ;\n\tif(objBox != null)\n\t{\n\t\tif(objBox.length != null)\n\t\t{\n\t\t\tfor(var i=0;i<objBox.length;i++)\n\t\t\t{\n\t\t\t\tif(objBox[i].checked == true)\n\t\t\t\t{\n\t\t\t\t\tif( i == 0)\n\t\t\t\t\t{\n\t\t\t\t\t\talert(\"The Firs... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This method controls the quick appointment form | function setQuickAppointmentsForm(lang_iso){
var form = 'form[name="quick_appointment_form"]',
page = '/' + lang_iso + '/actions/appointment/';
// declare vars
var $btn, $form, $category_id, $service_id, $date, $forbidden_dates, $hour, $submit_btn;
function init(){
// init vars
$form = $(form);
$categor... | [
"function Appointment() { }",
"function AssignAppointmentTask(myForm)\n{\n\tif(myForm == \"quickAdd-form\")\n\t{\n\t\t/*****Main activity setp starts here******/\n\t\tif(document.getElementById('QA_0-1-17')&&document.getElementById('QA_0-1-17').checked == true)\n\t\t\tdocument.getElementById('QA_0-1-17').value = ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Tensorflow kernel requires input and output channel dimensions, but I just want to apply the same kernel to all channels independantly, so this function generates the appropriate kernel to achieve that. | function convolve(img, kernel) {
const zero = tf.zerosLike(kernel)
kernel = tf.stack([
tf.stack([kernel, zero, zero], 2),
tf.stack([zero, kernel, zero], 2),
tf.stack([zero, zero, kernel], 2)
], 3)
return tf.conv2d(img, kernel, strides = [1, 1], pad = 'valid')
} | [
"function conv2D(kernel, normalizationConstant = 1.0)\n{\n const kernel32 = new Float32Array(kernel.map(x => (+x) * (+normalizationConstant)));\n const kSize = Math.sqrt(kernel32.length) | 0;\n const N = (kSize / 2) | 0;\n\n // validate input\n if(kSize < 1 || kSize % 2 == 0)\n _utils_utils__W... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Function: handleSpreadsheetSearchPages It handles the multiple pages of a search result when viewed. It saves the results of each page for the current query so multiple request aren't made when returning to previously views search result pages. Params: pageToken Drive Search result button action. next or previous. | function handleSpreadsheetSearchPages(action) {
if (action == "next" ) {//&& myDrive.spreadsheetSearchCurrentPage + 1 <= myDrive.spreadsheetSearchTotalPages) {
myDrive.spreadsheetSearchCurrentPage++;
} else if (action == "previous") {
myDrive.spreadsheetSearchCurrentPage--;
}
var startIndex = myDrive.spreads... | [
"function handleSearchPages(action) {\n\t\n\tif (action == \"next\" ) {\n\t\tmySearch.searchCurrentPage++;\n\t} else if (action == \"previous\") {\n\t\tmySearch.searchCurrentPage--;\n\t}\n\n\tvar startIndex = mySearch.searchCurrentPage * mySearch.maxResultsDisplay;\n\tvar endIndex = ((startIndex+mySearch.maxResults... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
7.3.11 HasOwnProperty (O, P) | function HasOwnProperty(o, p) {
return Object.prototype.hasOwnProperty.call(o, p);
} | [
"function HasOwnProperty(o, p) { // eslint-disable-line no-unused-vars\n\t\t// 1. Assert: Type(O) is Object.\n\t\t// 2. Assert: IsPropertyKey(P) is true.\n\t\t// 3. Let desc be ? O.[[GetOwnProperty]](P).\n\t\t// 4. If desc is undefined, return false.\n\t\t// 5. Return true.\n\t\t// Polyfill.io - As we expect user a... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Subscribes the listener to all the matching topics. | function subscribeListenerToAllMatchingTopics(topicName, listener, count) {
var matchingTopics = getAllTopics(topicName);
// subscribe listener all the matching topics
for(var matchingTopic in matchingTopics) {
subscribeListenerToOneTopic(matchingTopic, listener, count);
}
} | [
"function subscribeToAllPushTopics(oauth) {\n subscribeToPushTopics(oauth, 'SessionsTopic'); //session changes\n subscribeToPushTopics(oauth, 'SpeakersTopic3'); //speaker changes\n console.log('Subscribed to Push Topics');\n}",
"subscribeToChannels() {\n Object.values(CHANNELS).forEach(channel => {\n t... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Atualiza as estruturas de indices. | UpdateIndex()
{
// Esvazia os indices.
this.index = {};
this.specialIndex = {};
for(var i = 0; i < this.gameObjects.length; i++)
{
// Verifica se ja existe um objeto do mesmo tipo nos indices e o adiciona.
if(this.index[this.gameObjects[i].obj... | [
"SetIndices() {}",
"function createIndex()\n{\n index = Object.create(objIndex);\n index.setIN = 0;\n index.setDOM = 0;\n}",
"function IndicesBuilder() {\n this._indices = [];\n this._indexObjs = [];\n }",
"_getIndex() {}",
"rebuildIndices() {\n const me = this,\n isFiltere... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Extract links from URL stream | function getLinks(url_encoded_fmt_stream_map)
{
var links=url_encoded_fmt_stream_map.split(",");
var urls= []
for(i in links){
var link=links[i];
var url=getQueryVairable(link,"url");
url=decodeURIComponent(url);
var sig=getQueryVairable(link,"sig");
sig=decodeURIComponent(sig);
var quality=getQueryVaira... | [
"function extractLinks() {\n let links = [];\n\n for (const block of message.blocks) {\n for (const element of block.elements) {\n for (const subelement of element.elements) {\n if (subelement.type == 'link') {\n links.push(subelement.url);\n }\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
if start button is clicked then open start container | function showStartContainer() {
const start = document.getElementById("start");
$("div.start-container").show();
start.classList.toggle("active");
$("div.start-container").css("z-index", "10000");
$("div.start-container").css("display", "");
} | [
"function showStart() {\n document.body.className = '';\n var startButton = document.getElementById('start');\n startButton.style.display = '';\n mode = modes.START;\n}",
"function startBtn () {\n start.addEventListener('click', container )\n}",
"function setup_start() {\n display.start.css('display',... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Encapsulates a human player. | function HumanPlayer( id, name ) {
this.id = id;
this.name = name;
this.currentDeferred = null;
} | [
"function HumanPlayer(playerID){\n this.playerID = playerID;\n}",
"function HumanPlayer(symbol, game) {\n Player.call(this, symbol, game);\n this.ai = false;\n}",
"function player(username, hand) {\n this.username = username\n this.hand = hand\n}",
"function OogaahHuman() {\n\tOogaahPlayer.apply(this, ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Updates the object transform for rendering | updateTransform() {
super.updateTransform();
// TODO don't need to!
// this.displayObjectUpdateTransform();
// PIXI.Container.prototype.updateTransform.call( this );
} | [
"updateTransform(){}",
"function transformObjects(){\r\n\t/*Actualizo las transformaciones para cada uno de los objetos*/\r\n\ttransformPiso();\r\n\ttransformBase();\r\n\ttransformStand();\r\n\ttransformGirl();\r\n\t//transformBall();\r\n}",
"function updateTransformation() {\n\n\t\t(group || node).setAttribute... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
peerConnectHandler is the function to be called on a peer whenever the 'connect' event is emitted. When triggered, the peer is fully connected to another peer and should now be set to handle packets appropriately. | peerConnectHandler(peer){
var connectingID = peer.metadata;
this.addNodeConnection(connectingID,peer);
console.log(`Peer OnConnect! - ${connectingID}`);
if(this.nodeToCallbacks[connectingID]) {
this.nodeToCallbacks[connectingID].forEach((callback) => {
callback();
});
}
delet... | [
"function onConnect(){\n util.info('Peer connected on port:' + port + ' with host:' + host);\n self.addPeer(socket);\n }",
"_onPeerConnection (peer, peerId) {\n console.debug('New peer connection ' + peerId)\n\n peer = this._addPeer(peer, peerId)\n\n // Add event handlers for peer communication\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Function to update the pets | function updatePets() {
console.log("Calling updatePets function!");
for(let i =0; i< numPets; i++) {
// gets the data within that id and creates an object that updatePets can understand
var nameID = 'name' + (i+1);
var ageID = 'age' + (i+1);
var breedID = 'breed' + (i+1);
... | [
"function updatePet() {\n\n} // end updatePet",
"function updatePlanets( toMove ) {\n\tfor(var i=0; i<planets.length; i++) {\n\t\tplanets[i].update( toMove );\n\t}\n}",
"function updatePrices() {\n clickUpgrades['shovel'].price = clickUpgrades['shovel'].newprice;\n clickUpgrades['excavator'].price = click... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
================================== Functions ================================== function to compute the "Next Arrival" and the "Minutes Away" arrival, based on the current time, the first spaceship time and the frequency | function nextArrivalMinutesAway(firstSpaceshipTime, frequency) {
// convert the first spaceship time to make sure it comes before the current time
var firstTimeConverted = moment(firstSpaceshipTime, "HH:mm").subtract(1, "years");
// get the difference, in minutes, between the current time and the first spac... | [
"function nextArrivalTime(start, freq) {\n\n var current = currentTime();\n var currArray = current.split(\":\");\n var currentMinutes = convertTimeToMinutes(parseInt(currArray[0]), parseInt(currArray[1]));\n \n var startArray = start.split(\":\");\n var startMinutes = convertTimeToMinutes(parseIn... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Init method, initialize task timeout history | init() {
this.taskContainer.buildAllTasks();
for (const taskName in this.taskContainer.getTasks()) {
this.taskTimeouts[taskName] = 0;
}
} | [
"constructor() {\n super();\n this.timers = {};\n this.crontab = {};\n }",
"init() {\n let {\n startTime,\n endTime,\n currentTime,\n duration,\n notOpenTip,\n openingTip,\n closedTip\n } = this\n\n try {\n startTime = new Date(... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Keep data in the variable `cardsInTrades` syncronized with pending | async function updateCardsInTrade () {
const updateTrade = async ({ object: { id } }, change) => {
const trade = await Trade.get(id);
trade.yourOffer.forEach(({ id: cid, print_id: pid }) => {
cardsInTrades.updatePrint(id, "give", cid, pid, change);
});
trade.parnerOffer.f... | [
"async function updateCardsInTrade () {\n const updatePrint = (tradeId, side, pid, change) => {\n if (pid in cardsInTrades[side]) {\n if (change > 0) {\n cardsInTrades[side][pid].push(tradeId);\n } else {\n cardsInTrades[side][pid] = cardsInTrades[side][... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Handles the cases when other users send messages to their local p2pserver. param: socket the socket sending the message. | messageHandler(socket)
{
socket.on('message', message => {
const data = JSON.parse(message);
switch(data.type)
{
//when another user has a more updated chain.
case MESSAGE_TYPES.chain:
this.blockchain.replaceChain(data.chain);
break;
//when an... | [
"function send_message(socket) {\n if (socket) {\n socket.emit(\"message\", buffer);\n }\n}",
"function ppc_send_sock(socket, msg)\r\n{\r\n console.log('--- Skynet server to PPC socket: <'+msg+'> ---');\r\n socket.write(msg);\r\n}",
"function sendPrivateMessage(socket, recieverUsername, messa... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Attaches the default header to a headers parameter. The headers parameter is not modified. | static async _defaultHeaders(headers = {}) {
let newHeaders = Object.assign(headers, {
Authorization: `Bearer ${(await Login.tokens()).access_token}`,
});
return newHeaders;
} | [
"setDefaultHeader(name, value) {\n this.defaultHeaders[name] = value;\n }",
"setOptionalHeaders(optionalHeaders) {\n if (typeof optionalHeaders === 'object'){\n Object.assign(this.defaultHeaders, optionalHeaders);\n }\n }",
"resetRequestHeaders() {\n headers = Object.assign({}... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Creates a new AbortSignal instance that will abort after the provided ms. | static timeout(ms) {
const signal = new AbortSignal();
const timer = setTimeout(abortSignal, ms, signal);
// Prevent the active Timer from keeping the Node.js event loop active.
if (typeof timer.unref === "function") {
timer.unref();
}
return signal;
} | [
"function createAbortSignal() {\n const signal = Object.create(AbortSignal.prototype);\n EventTarget.call(signal);\n abortedFlags.set(signal, false);\n return signal;\n}",
"function setAbortableTimeout(signal, throttleEndTimeMillis) {\n return new Promise(function (resolve, reject) {\n // Derives ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
clear out the employeeList key and refresh the page | function clearEmployees() {
localStorage.removeItem("employees");
location.reload();
} | [
"function clearEmployeeData() {\n\t\t\tctrl.employee = {\n\t\t\t\temId: '',\n\t\t\t\temFirstname: '',\n\t\t\t\temLastname: '',\n\t\t\t\temBirthday: '',\n\t\t\t\temSex: '',\n\t\t\t\temSexString: '',\n\t\t\t\temHometown: '',\n\t\t\t\temEthnic: '',\n\t\t\t\temPhone: '',\n\t\t\t\temStarteddate: '',\n\t\t\t\tliId: '',\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
info: makes defense objects | function makeDefenseObjects ( object, defenseTypes, vendor ) {
var defenseObjects = [];
for ( var i = 0 ; i < defenseTypes.length ; i++ ) {
var defenseObject = {
typeOfDefense: shorter( defenseTypes[i] ),
VendorId: vendor.id
}
defenseObjects.push( defenseObject );
}
return defenseObjects... | [
"function Defense() {\n\n}",
"function initiateDefenses() {\n // check if triangulation mode is on\n if ($scope.gameOptions.mode === 'triangulation') {\n initiateTimeLimit();\n }\n // check if darknet mode is on\n if ($scope.gameOptions.mode === 'darknet') {\n initiateTimeLimit();\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Queries backend endpoint 'indiv_grow_data', passes data to processGrowData function | function getGrowData() {
start = document.getElementById('start_date').value;
end = document.getElementById('end_date').value;
sensor_id = document.getElementById('sensor_id').value;
params = {
start: start,
end: end,
sensor_id: sensor_id
}
$.getJSON('http://flask-env... | [
"function processGrowData(data) {\n // The order of GROW variables returned is not consistent,\n // so we need to check if the variable names match\n // before assigning them to their javascript variables.\n if (data['Data'][0]['VariableCode'] == 'Thingful.Connectors.GROWSensors.air_temperature') {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Adds internal classes to be able to provide customizable selectors keeping the link with the style sheet. | function addInternalSelectors() {
addClass($(options.sectionSelector, container), SECTION);
addClass($(options.slideSelector, container), SLIDE);
} | [
"function addInternalSelectors() {\n container.find(options.sectionSelector).addClass(SECTION);\n container.find(options.slideSelector).addClass(SLIDE);\n }",
"function addInternalSelectors() {\n container.find(options.sectionSelector).addClass(SECTION);\n container.find(options... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
display a OneZoom phylotree | function onezoom_tree(selected_tree) {
d3.text("/arborapi/projmgr/project/" + project + "/PhyloTree/" + selected_tree+ "/newick", function (error, newickString) {
onezoom_init(newickString);
});
} | [
"function show_hypertree_map(id_to_show, w, h) {\n levelDistance = 100;\n\n //Create a new canvas instance.\n var canvas = new Canvas('mycanvas', {\n //Where to append the canvas widget\n 'injectInto': 'infovis',\n 'width': w,\n 'height': h,\n\n //Optional: create a backgr... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Utility functions for working with ArcCollection and arrays of arc ids. Return average segment length (with simplification) | function getAvgSegment(arcs) {
var sum = 0;
var count = arcs.forEachSegment(function(i, j, xx, yy) {
var dx = xx[i] - xx[j],
dy = yy[i] - yy[j];
sum += Math.sqrt(dx * dx + dy * dy);
});
return sum / count || 0;
} | [
"function getPolyLengthFromArcs(arcs_, arcCollection_){\n\t//console.log(arcs_)\n\tvar length_ = 0;\n\tfor (var i=0; i<arcs_.length; i++){\t\n\t\tvar arc_id = arcs_[i];\n\t\tif(arc_id<0)arc_id=(arc_id*(-1))-1;\n\t\tlength_ = length_ + arcCollection_[arc_id].length;\n\t}\n\treturn length_;\n}",
"function getLength... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets or sets the vertical alignment of the selected cells. | get verticalAlignment() {
return this.verticalAlignmentIn;
} | [
"get verticalAlignment() {\n return this._g.verticalAlignment;\n }",
"function alignSelected() {\n var node = this.selection.getNode();\n return Element.getStyle(node, 'textAlign');\n }",
"function contentCell_setVAlign(value)\n{\n\tthis.valign = value;\n\tthis.tdElem.vAlign = value;\n}",
"se... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
open the product detail page based on logged in user role | function openProductHelper() {
if(currentUser.roles[0] === 'designer') {
openImageEdit();
} else if(currentUser.roles[0] === 'applier') {
openQrScanner();
} else if(currentUser.roles[0] === 'reviewer') {
openApprovalPage();
}
} | [
"function gotoProductDetail(id)\n\t\t{\n\t\t\t$state.go('app.admin-users.detail', {id: id});\n\t\t}",
"function gotoDetails(selectedProduct) {\n if (selectedProduct && selectedProduct.productID()) {\n var url = '#/Inventory_Product_Details/' + selectedProduct.productID();\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
chainRec :: ChainRec m => (TypeRep m, (a > c, b > c, a) > m c, a) > m b . . Function wrapper for [`fantasyland/chainRec`][]. . . `fantasyland/chainRec` implementations are provided for the following . builtin types: Array. . . ```javascript . > chainRec ( . . Array, . . (next, done, s) => s.length == 2 ? [s + '!', s + ... | function chainRec(typeRep, f, x) {
return ChainRec.methods.chainRec (typeRep) (f, x);
} | [
"function chainRec(typeRep) {\n return function(f) {\n return function(x) {\n return Z.chainRec (typeRep, step, x);\n };\n function step(next, done, x) {\n return Z.map (either (next) (done), f (x));\n }\n };\n }",
"function chainRec(typeRep, f, x) {\n return ChainRec.m... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This function changes the fragment of this node and updates the parent and the child nodes with the new information of this node. | change_fragment(new_fragment) {
if (this.get_fragment_id() != null) {
let fragment = this.get_fragment();
fragment.remove_node(this);
if (fragment.get_contents_size() == 0){
this.fc.delete_fragment(fragment);
}
}
this.set_fragment(new_fragment)
new_fragment.add_node(this... | [
"update_children(){\n let children = this.get_children_objects()\n for (var i = 0; i < children.length; i++) {\n children[i].set_parent_node(this);\n }\n this.notify_fragment_dirty();\n }",
"change_fragment_node_and_children(old_fragment_id, new_fragment) {\n let current_fragment_id = this.ge... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Compute the minimum number of moves to the end of phase 1 | minDist1() {
// The maximum number of moves to the end of phase 1 wrt. the
// combination flip and slice coordinates only
let d1 = this.pruning('sliceFlip', N_SLICE1 * this.flip + this.slice);
// The combination of twist and slice coordinates
let d2 = this.pruning('sliceTwist', N_SLICE1 * ... | [
"function minNumberOfJumps(array) {\n // Write your code here.\n\tif(array.length <= 1) return 0;\n\tlet maxReach = array[0];\n\tlet currSteps = array[0];\n\tlet jump = 0; \n\tfor(let i = 1; i < array.length - 1; i++) {\n\t\tmaxReach = Math.max(maxReach, array[i] + i);\n\t\tcurrSteps --;\n\t\tif(currSteps === 0) {... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Checks if a given value is a valid measurement value. | function isMeasurementValue(value) {
return typeof value === 'number' && isFinite(value);
} | [
"function isMeasurementValue(value) {\n return typeof value === 'number' && isFinite(value);\n }",
"function isMeasurementValue(value) {\n return typeof value === 'number' && isFinite(value);\n}",
"function isMeterValueQuestionable(value) {\n\tif(value == '0' || value == '0.0') {\n\t\treturn true;\n\t} e... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Creates the input form element specific for this field. Type of element is decided upon the value of 'field.type', that can take the following values: "text", "text multiple", or "select". When the type is "select" the field must come with a, 'options' attribute. According to the type of the 'options' attribute, the ' ... | function createInputForField (field) {
var e;
switch (field.type) {
case "text":
e = $("<input/>", {type: "text", "class": "form-control"});
break;
case "select":
e = $("<select/>", {"class": "form-control"});
switch ($.type (field.options)) {
case "array": // (1)
... | [
"createInp() {\n const input = document.createElement(this.selectObj.tagName);\n const label = document.createElement(\"label\");\n label.innerHTML = this.selectObj.labelText;\n if (this.selectObj.optionsText && this.selectObj.optionsValue) {\n for (let i = 0; i < this.selectO... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Takes an array formatted like the problem Returns an array of tower objects | function toTowerArray(towers) {
var towerObjArray = towers.map(elem => {
var towerArray = elem.trim().split(" ");
if (towerArray.length > 2) {
var carrying = (towerArray.slice(3)).join("").split(",");
var towerObj = new Tower(towerArray[0], towerArray[1],carrying);
}
else {
var towerObj = new Tower(t... | [
"function towerBuilder(nFloors) {\n // console.log(nFloors)\n let arr = [\"*\"]\n let star = \"***\"\n for(let i = 1; i < nFloors; i++){\n arr.push(star)\n star += \"**\"\n }\n for(let i = 0; i < arr.length; i++){\n for(let j = 0; j < arr.length - 1 - i; j++){\n arr[i] = ' ' + ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
when the scrolling image finishes | function finishScroll()
{
m_acceleration = m_currentSpeed = 0;
m_scrollingImage.x = (1920 * 0.5) - (m_scrollingImage.width * 0.5);
m_imageContainer.removeChild( m_currentImage );
m_imageContainer.removeChild( m_scrollingImage );
m_imageContainer.unload();
m_currentI... | [
"processScroll () {\n let images = this.getImages();\n let len = images.length;\n for (let i = 0; i < len; i++) {\n if (this.elementInViewport(images[i])) {\n this.loadImage(images[i]);\n }\n\n }\n if (images.length === 0) {\n this.d... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Functions for exporting a wkt GEOGCS definition | function wkt_make_geogcs(P) {
var geogcs = {
NAME: wkt_get_geogcs_name(P),
DATUM: wkt_make_datum(P),
PRIMEM: ['Greenwich', 0], // TODO: don't assume greenwich
UNIT: ['degree', 0.017453292519943295] // TODO: support other units
};
return geogcs;
} | [
"function geocentricFromWgs84(p,datum_type,datum_params){if(datum_type===_constants_values__WEBPACK_IMPORTED_MODULE_0__[\"PJD_3PARAM\"]){//if( x[io] === HUGE_VAL )\n// continue;\nreturn{x:p.x-datum_params[0],y:p.y-datum_params[1],z:p.z-datum_params[2]};}else if(datum_type===_constants_values__WEBPACK_IMPORTED_MO... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
The state of CodeMirror at the given position. | function getState(cm, pos) {
pos = pos || cm.getCursor('start');
var stat = cm.getTokenAt(pos);
if (!stat.type) return {};
var types = stat.type.split(' ');
var ret = {}, data, text;
for (var i = 0; i < types.length; i++) {
data = types[i];
if (data === 'strong') {
ret.bold = true;
} els... | [
"getState(editor, position) {\n return {\n text: editor.model.value.text,\n lineHeight: editor.lineHeight,\n charWidth: editor.charWidth,\n line: position.line,\n column: position.column\n };\n }",
"_toCodeMirrorPosition(position) {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
fitting height of toolchain boxes | function alignToolchainBoxes()
{
var container = $('#toolchains')[0];
var toolchains = container.children;
var maxHeights = { columns: 0, heights: []};
maxHeights.columns = Math.floor(container.clientWidth / toolchains[0].clientWidth);
// read max height per row
Obj.eachElement( ... | [
"function getSizeBasis(widget){return BoxLayout.getSizeBasis(widget);}",
"heightToFit(boundingBox) {\n return null;\n }",
"get stretchHeight() {}",
"function configure_plane_height(){\n\tplane_height =\t((workspace_indexer.workspace_count - 1)\t*\n\t\t\t\t\t sliding_height )\t\t\t\t\t\t\t+\n\t\t\t\t... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Draws "Press E to enter" text when close to a building | function drawEnterText() {
push();
textAlign(CENTER);
textFont(fontChangaBold);
fill(hexDark[3]);
stroke(hexDark[0]);
strokeWeight(3);
textSize(22);
if( adventureManager.getStateName() === "Brothel") {
text('Press [E] to exit', playerSprite.position.x, playerSprite.position.y - p... | [
"on_keydown(e) {\r\n switch (e.keyCode) {\r\n case keymap$4[\"Enter\"]:\r\n case keymap$4[\"Space\"]:\r\n this.modalEnd(false);\r\n break;\r\n case keymap$4[\"Escape\"]:\r\n this.modalEnd(true);\r\n break;\r\n }\r\n }",
"onEscapePress() {}",
"keyEnter() {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Update the county detail area | function pickCounty(county){
// Retrieve data on specified county
var value = absentee_counts_obj[county.id];
document.getElementById("county_title").innerHTML = "<strong>Selected County: </strong> " + value["Jurisdiction"];
var statsParagaph = `
... | [
"function onCountyChange() {\n const state = this.stateSelector.options[this.stateSelector.selectedIndex].value;\n const co = this.countySelector.options[this.countySelector.selectedIndex].value;\n const ops = getCityOptionsByStateIdAndCounty(state, co);\n populateOptions(this.citySelector, ops, '');\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Return all cookies. This is isomorphic and may be called from the serverside though it will return nothing. | function all() {
var str;
try {
str = document.cookie;
} catch (err) {
return {}
}
return parse(str)
} | [
"getAll() {\n return cookies.getAll();\n }",
"function getAllCookies() {\r\n\t\tvar cookies = { };\r\n\t\tif (document.cookie && document.cookie != '') {\r\n\t\t\tvar split = document.cookie.split(';');\r\n\t\t\tfor (var i = 0; i < split.length; i++) {\r\n\t\t\t\tvar name_value = split[i].split(\"=\");\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
for now the home page is the Todo list separated it just in case I want to change that later | function HomePage() {
return <TodoList />;
} | [
"function ToDoList(){\r\n \r\n window.location.pathname = 'ToDoList.html'\r\n \r\n }",
"static displayToDos() {\n const todos = CRUD.getTodos();\n todos.forEach(todo => UI.addToDoToList(todo));\n }",
"processGoHome() {\n window.todo.model.goHome();\n }",
"navigateToList() ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
= Description Alternative flag setter for the mouseMove event type. If set to true, starts listening to mouseDown events when the component has focus. = Parameters +_state+:: Set the mouseDown event listening on/off (true/false) for the component instance. = Returns +self+ | setMouseMove(_state) {
this.events.mouseMove = _state;
this.setEvents();
return this;
} | [
"setMouseDown(_state) {\n this.events.mouseDown = _state;\n this.setEvents();\n return this;\n }",
"setMouseMode(state) {\n if (typeof state === \"boolean\") {\n state = state ? 2 : -1;\n }\n\n if (state < 0) {\n this.write(this.database.exitMouse);\n } else if (this.database.enter... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
valid ipaddr args : netmask_name: netmask object name. Return : if success return true else return false. | function valid_ipaddr(ipaddr_name) {
var obj = get_by_name(ipaddr_name);
for (i=0;i<4;i++) {
if (!valid_range(obj[i], 0, 255)) {
obj[i].focus();
return false;
}
}
return true;
} | [
"function valid_netmask(netmask_name)\n{\n\tvar obj = get_by_name(netmask_name);\n\tif (obj.length != 4) {\n\t\treturn false;\n\t}\n\tvar msk = combine_ipaddr(netmask_name);\n\n var re = /(254|252|248|240|224|192|128)\\.0\\.0\\.0|255\\.(254|252|248|240|224|192|128|0)\\.0\\.0|255\\.255\\.(254|252|248|240|224|192|... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Clear data and close course register modal | function ClearCourseRegisterModal(){
document.getElementById("rCourseName").value = "";
document.getElementById("rMajor").value = "";
$('#courseRegisterModal').modal('hide');
} | [
"function ClearCourseUpdateModal(){\r\n\tdocument.getElementById(\"uCourseId\").value = \"\";\r\n\tdocument.getElementById(\"uCourseName\").value = \"\";\r\n\tdocument.getElementById(\"uMajor\").value = \"\";\r\n\t$('#courseUpdateModal').modal('hide');\r\n}",
"function closeReg() {\n const regModal = document.... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Removes a bullet point from the list | function removeBulletPoint(id) {
selectedSlide.data.list.splice(id, 1);
runUpdateTimer();
displaySlide();
} | [
"function removeBullets() {\n bullets = bullets.filter(function(element) {\n return element.bulletY > 0;\n });\n}",
"RemoveBullet(){\n\n for(this.i = 0; this.i < this.bulRemove.length; this.i++)\n {\n this.bullets.splice(this.bulRemove[this.i], 1);\n }\n this.bu... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Propeller inherits from PropulsionUnit | function Propeller(numberOfFins,spineDirection) {
this.numberOfFins=numberOfFins;
this.spineDirection=spineDirection;
} | [
"function PropulsionUnit() {\n\t}",
"function PropulsionUnit(){\n\tthis.getAcceleration = function (){};\n}",
"function propeller(initialAngle){\r\n multRotationZ(initialAngle + rotatePropeller);\r\n multScale([0.01,0.35,0.01]);\r\n draw(\"cube\",0.0);\r\n}",
"function drawPropeller(){\n push();\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Using a tracing image in Dreamweaver attaches up to four proprietary attributes to the body tag. We want to remove these attributes if Remove Dreamweaver Comments is checked. | function removeTracingAttrs()
{
var bodyNode = dreamweaver.getDocumentDOM('document').body;
//look for tracing attributes - if any are found, toggle
//the global boolean to true and remove all attributes
if (cbRemoveDWComments.checked){
if (bodyNode.getAttribute("tracingsrc") ||
bodyNode.getAttribu... | [
"effectiveBodyTag(attributes) {}",
"function RemoveUnsupportedAttributes() { }",
"function appxextraattributeshandler(x) { }",
"function ncsuA11yToolRemoveARIAAttributesNotes(fr) {\n fr.find('.aria-attribute-highlight-note').remove();\n jQuery('*', fr).removeClass('aria-attribute-highlight');\n// fr.... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Determine whether the given properties match those of a `CfnRoutingControlProps` | function CfnRoutingControlPropsValidator(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 received: ' + JSON... | [
"function CfnRoutePropsValidator(properties) {\n if (!cdk.canInspect(properties)) {\n return cdk.VALIDATION_SUCCESS;\n }\n const errors = new cdk.ValidationResults();\n errors.collect(cdk.propertyValidator('destinationCidrBlock', cdk.validateString)(properties.destinationCidrBlock));\n errors.... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Checks to see if the event should be filtered. Always returns false unless overriden. | filterEvent(event) {
return false;
} | [
"_FilterEntity(e) {\n for(var i = 0; i<this.filters.length; i+=1) {\n if(!this.filters[i](e)) {return false;}\n }\n return true;\n }",
"isFilterable() {\n return this.isKeyboardBehavior(\"filter\") || this.isKeyboardBehavior(\"autocomplete\");\n }",
"haveToShowAdditi... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Add a list of messages to a given room. Simply appends items to the list it's recommended to use the chronoSortRoomMessages mutation immediately after this one to make sure all the room messages are in sorted order. Duplicate messages will be ignored (by ID) | addRoomMessages(state, [roomID, messages]) {
let r = state.rooms[roomID]
if (!r) {
throw new Error('Room with ID ' + roomID + ' not found when calling' +
' addRoomMessages mutation.');
}
for (let m of messages) {
let duplicated = false;
for (let m2 of r.messages... | [
"function addMessage(username, msg, room){\n let time = moment().format('h:mm a');\n let message = {user:username, text:msg, time, room};\n // Check array message length\n // console.log(messagesArr.length)\n if(messagesArr.length > 1000){\n messagesArr.length = 0;\n messagesArr.push(me... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
redirect to Individual artist page | function redirectIndividual(artistId) {
window.location.href = `individual.html?artistId=${artistId}`;
} | [
"function addArtwork(){\n window.location = 'index.php?action=editArtwork&id=0';\n}",
"function redirectToArticlePage(e) {\n let target = e.target;\n if (target.className === \"frame\") {\n let ID = target.firstChild.lastChild.innerHTML;\n setID(ID);\n } else if (target.className === \"l... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
============== Building up the warrior display so that we will know who is next to play or who is playing in that current time we set up the warrior to zero then give it how to behave by conditions ================ | function displayWarriorTurn(warrior){
warrior1Div.className = '';
warrior2Div.className = '';
if(warrior === 'warrior1'){
warrior1Div.className = 'off';
warrior2Div.className = 'on';
} else {
warrior2Div.className = 'off';
warrior1Div.class... | [
"function Warrior() {\n let _experience = 100;\n\n /**\n * Computes the experience of a warrior\n * @return {number}\n */\n this.experience = function() {\n if (_experience >= 10000) return 10000;\n return _experience};\n\n /**\n * Computes the level of a warrior\n * @r... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Return the form for staging | getForm() {
return (
<StagingForm
// Update functions
//onStagingUpdate={this.handleStagingUpdate}
updateValue={this.updateValue}
// Properties
staging={this.staging}
/>
);
} | [
"function getCustomEnvironmentForm() {\n return customForm\n}",
"function getFormTpl(data) {\n\t\t\treturn '<form action=\"wwv_flow.show\" method=\"post\" enctype=\"multipart/form-data\" id=\"' + data.formId + '\" target=\"' + data.iframeId + '\" onload=\"\">' +\n\t\t\t\t'<input type=\"hidden\" name=\"p_flow_id\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Print1To255() Print all the integers from 1 to 255 | function print1To255() {
for (var i = 1; i < 256; i++) {
console.log(i)
}
} | [
"function Print1to255() {\n for (var i = 1; i <= 255; i++) {\n console.log(i);\n }\n}",
"function Print1To255(){\n\tfor(var x=1; x<=255; x++){\n\t\tconsole.log(x);\n\t}\n}",
"function print1To255() {\n for (i=1; i<256; i++) {\n console.log(i);\n }\n}",
"function print1To255() {\r\n for (var... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Builds the release output without polluting the process stdout. Build scripts commonly print messages to stderr or stdout. This is fine in most cases, but sometimes other tooling reserves stdout for data transfer (e.g. when `ng release build json` is invoked). To not pollute the stdout in such cases, we launch a child ... | function buildReleaseOutput(stampForRelease) {
if (stampForRelease === void 0) { stampForRelease = false; }
return tslib_1.__awaiter(this, void 0, void 0, function () {
return tslib_1.__generator(this, function (_a) {
return [2 /*return*/, new Promise(function (resolve) {
... | [
"function invokeReleaseBuildCommand() {\n return tslib.__awaiter(this, void 0, void 0, function* () {\n const spinner = ora.call(undefined).start('Building release output.');\n try {\n // Since we expect JSON to be printed from the `ng-dev release build` command,\n // we spawn... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Checks if value is classified as a Symbol primitive or object. | function isSymbol(value) {
return Object.prototype.toString.call(value) == '[object Symbol]' || typeof value == 'object'
} | [
"function isSymbol(value) {\n return typeof value === 'symbol' ||\n (isObjectLike(value) && baseGetTag(value) == symbolTag);\n}",
"function _isSymbol (obj) {\n\treturn toString.call(obj) === '[object Symbol]';\n}",
"function isSymbol(val) {\n return isValue(val) && typeof val === 'symbol';\n}",
"... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |