query stringlengths 9 34k | document stringlengths 8 5.39M | negatives listlengths 19 20 | metadata dict |
|---|---|---|---|
Function: Gets all the available models Called by GET /v1/QAA/Models ==> gModel() Input: None Output: returns a promise with the locations with id (modelID, modelName) Time Complexity: O(Async) | function getModels() {
let ourQuery = 'SELECT modelID, modelName FROM QAA.model_TB';
return makeConnection.mysqlQueryExecution(ourQuery, mySqlConfig);
} | [
"async getModels()\r\n { \r\n // Find the subjects of all models (from statements having type = 'model')\r\n let models = this.store.match(null, NS_RDF('type'), NS_SOLIDRC('Model'));\r\n\r\n // Build a list of all models by fetching the model data from the model's URL (subject)\r\n let result = awai... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Renders one git branch in HTML. | function createBranchHTML(branch) {
console.debug("createBranchHTML");
branchContainer = document.createElement("div");
var branchLabel = document.createElement("h3");
branchLabel.style = "float:left;";
branchLabel.innerText = "Branch " + branch.name;
branchContainer.appendChild(branchLabel);
var branch... | [
"function getBranches(repNum) {\n //clear branches div\n document.getElementById('branches-div').innerHTML = '';\n //get repo name\n let repo = rObj[repNum].name;\n fetch('https://api.github.com/repos/' + username + '/' + repo + '/branches')\n .then(resp => resp.json())\n .then(data => ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns a getter function that retrieves values only from channel based data if filtering by channel or otherwise gets the value from aggregated data | function getFromAggregatedOrChannelsGetter(valProp, aggregatedDataKey) {
return function(metric, filtersState) {
/* Get from aggregated location */
if (filters.hasNoActiveState(filtersState.channels)) {
let data = dataResolvers.getAggregatedChannelSums(metric, valProp, aggregatedDataKey);
return d... | [
"function getOnlyFromChannelsGetter(valProp) {\n return function(metric, filtersState) {\n let channelsArr;\n\n if (filters.hasNoActiveState(filtersState.channels)) {\n /* No channel filter, get all channels */\n channelsArr = filters.getAvailableFilterStates(filtersState.channels);\n } else {\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Helper to get color values based on largest value in data set | function getGreenAndRedColors(largestValueInDataSet) {
var colorDomain = [
-1*largestValueInDataSet,
-.9*largestValueInDataSet,
-.8*largestValueInDataSet,
-.7*largestValueInDataSet,
-.6*largestValueInDataSet,
-.5*largestValueInDataSet,
-.4*largestValueInDataSe... | [
"static maxValues(mode) { return Color.ranges[mode].zipSlice(1).$take([0, 1, 2]); }",
"function findMaxRGB() {\n\t\n\t//reset\n\tmaxRed = 1;\n\tmaxGreen = 1;\n\tmaxBlue = 1;\n\t\n\tfor (var i = 0; i < filteredPartyPercentList.length; i++) {\n\n\t\t//get the percentage from the list created n filterparty\n\t\tvar ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Toggle the visibility of an container depending on the clicked element elementId = clicked element ID or Class containerId = container ID or Class | function showHide(elementId, containerId) {
$(elementId).on('click', function(e) {
e.preventDefault();
$(containerId).toggleClass('is-hidden');
});
} | [
"function toggleContainer(id,senderId,showText,hideText){var el=jQuery('#' + id);var sender=jQuery('#' + senderId);el.toggle(function(){sender.attr(\"title\",hideText);sender.html(hideText);sender.addClass('hide');},function(){sender.attr(\"title\",showText);sender.html(showText);sender.addClass('show');});}",
"f... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Function that displays the replies that were made by the user | function displayReplies(){
//outputing the rows of posts
let display_table = document.getElementById("tableDisplayRow");
let output_rows = "<table class='pure-table' id='historyTable'><thead><th>Reply content</th><th>Date made</th><th>Reply to comment/reply</th><th>Reply to user</th><th>Anonymous</th></thead><tbo... | [
"showReply() {\n let text = document.createElement(\"p\");\n text.innerHTML = this.reply[this.replyCount];\n this.replyCount++;\n this.main.appendChild(text);\n }",
"function printReplies(replies){\n var out = \"\";\n for (var i = 0; i <= replies.length - 1; i++){\n out += ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Determines if the tile's content is expired. `true` if tile's content is expired; otherwise, `false`. | get contentExpired() {
return this._contentState === _constants__WEBPACK_IMPORTED_MODULE_5__["TILE3D_CONTENT_STATE"].EXPIRED;
} | [
"get contentExpired() {\n return this._contentState === TILE_CONTENT_STATE.EXPIRED;\n }",
"get contentExpired() {\n return this._contentState === TILE3D_CONTENT_STATE.EXPIRED;\n }",
"get contentExpired() {\n return this.contentState === TILE_CONTENT_STATE.EXPIRED;\n }",
"isExpired() {\n ret... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Set cell with id baseCellId to result of evaluating string formula. Update all cells which are directly or indirectly dependent on the base cell. Return an object mapping the id's of all dependent cells to their updated values. | async eval(baseCellId, formula, updateStore=true) {
try {
this._undos = {};
const cellId = cellRefToCellId(baseCellId);
const oldAst = this._cells[cellId]?.ast;
const ast = parse(formula, cellId);
const cell = this._updateCell(cellId, cell => cell.ast = ast);
if (oldAst) this._re... | [
"async eval(baseCellId, formula) {\n const results = /* @TODO delegate to in-memory spreadsheet */this.memSpreadsheet.eval(baseCellId,formula); \n try {\n //@TODO update the baseCellId and formula in db\n for(const [key,value] of Object.entries(results)){\n const forumlaReturned = this.memS... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Function that creates a new `mano.Example` and add its `addElement` method as a callback of the processed sensors. | function record(label) {
// disable decoding
processedSensors.removeListener(decode);
// start recording
// example = new mano.Example();
example = new Example();
example.setLabel(label);
processedSensors.addListener(example.addElement);
} | [
"function record(label) {\n processedSensors.removeListener(decode);\n example = new Example();\n example.setLabel(label);\n\n processedSensors.addListener(example.addElement);\n}",
"function createSensorList() {\n\tsensors.push( new Sensor(1, \"Input 1\", 0, 1023, true) );\n\tsensors.push( new Sensor(2, \"In... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
TODO 5: (a) Write a function called `madlib` that takes 4 separate words as arguments. The function should insert the words into this sentence: "I prefer __1__ while I __2__ so that I don't __3__ on the __4__." (NOTE: the "__1__" and such are where you insert the arguments!) Finally, the function should return that new... | function madlib (wordOne, wordTwo, wordThree, wordFour){
if (wordOne === undefined){
wordOne = 'bananas';
}
if (wordTwo === undefined){
wordTwo = 'bananas';
}
if (wordThree === undefined){
wordThree = 'bananas';
}
if (wordFour === undefined){
wordFour = 'bananas';
}
return ('I pref... | [
"function madlib(words,words2,words3,words4){\n return('My '+words+' brings '+words2+' the '+words3+' to The '+words4+' Yard!')\n}",
"function madlib(word1,word2,word3,word4){\n let sentence = 'The wonderfully beatiful ' + word1;\n sentence += ' has a great talent for ' + word2;\n sentence += ' and is a great... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Function drawSmile(cx,cy,svgEl,i) Given position(cx,cy) and a SVG element with id=i, draws a single smile and defines the animation. | function drawSmile(cx,cy,svgEl,i){
var smiling = true;
var g = svgEl.append("g").attr("id",i).attr("s",1).on("click",
function click(){
// happy/sad animation on click
if(smiling){
d3.select(this.lastChild)
.transition()
.... | [
"function drawSmile() {\n\t//draw smile\n\tcontext.beginPath();\n\tcontext.arc(250, 300, 90, 0.2, Math.PI - 0.2);\n\tcontext.strokeStyle = \"#c20000\";\n\tcontext.lineWidth = 5;\n\tcontext.stroke();\n}",
"function drawSmile(argSmile)\r\n{\r\n\t//fej\r\n\tcircle(argSmile.x, argSmile.y, argSmile.size, argSmile.colo... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Recurse through the API tree, compiling everything | function recurse(tree,path)
{
for (var key in tree)
{
if (key == 'model')
{
compile(tree[key], path);
continue;
}
recurse(tree[key], path == '' ? key : path + '.' + key)
}
} | [
"compile(root)\n {\n // start by resolving the param references (could it be done on the\n // fly whilst compiling?)\n this.resolve(root);\n\n // resolve the connection infos\n // TODO: Shouldn't it be done before this.resolve(), right above?\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Test the specified condition against the specified "view" object | function testCondition(template, view, condition) {
return (new Function('return (' + template.root.conditions[condition] + ')')).call(view);
} | [
"checkAlreadyInView(e){\n let cv = this.state.customViews.find(item => {\n return item.metadata.name === e;\n });\n if(cv.spec.templates){\n return !!cv.spec.templates.find(item => {\n if(item)\n return item.kind === this.state.CRD.metadata.name;\n });\n }\n }",
"enterO... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
getting windspeed data from api | function getWindSpeed(speedUnits){
$.getJSON(api, function(data){
//var humidity = (data.current.humidity);
if (speedUnits == "kph"){
var speedSulfix = " Kph";
var windSpeed = (data.current.wind_kph);
}
else if (speedUnits == "mph")... | [
"getWind(data) {\n var windSpeed;\n windSpeed = data.windSpeed * 3.6; // convert m/s to kph\n return windSpeed.toFixed(0) + ' kph';\n }",
"function getWindSpeeds(data) {\n let results = [];\n\n for (let i = 0; i < data.hourly.length; i++) {\n results.push((data.hourly[i].wind_speed ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
A simple Timer class. | function Timer() {
this.start_ = new Date();
this.elapsed = function () {
return new Date() - this.start_;
};
this.reset = function () {
this.start_ = new Date();
};
} | [
"function Timer() {\r\n\tthis.start_ = new Date();\r\n\tthis.elapsed = function() {\r\n\t\treturn (new Date()) - this.start_;\r\n\t}\r\n\tthis.reset = function() {\r\n\t\tthis.start_ = new Date();\r\n\t}\r\n}",
"function Timer() {\n \t this.start_ = new Date();\n \t\n \t this.elapsed = function() {\n \t retu... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
TODOL A los servicios le entra una basket o un basketId? | static async retrieve(basketId) {
const basket = await Collection.retrieveOne(basketId);
if(!basket) throw new Error(`No basket with that id: ${basketId}`) // TODO: Correct error handling?
const { id, products } = basket;
return new Basket(id, products).serialize();
} | [
"function addBasket() {\n\tvar val = document.getElementById(\"visualBasket\").value;\n\tif (val == \"\") {\n\t\t//console.log('No basket selected.');\n\t} else {\n\t\t// read the current portal user id for authentication in service invokation\n\t\tvar uid = parent.Liferay.ThemeDisplay.getUserId();\n\t\tvar basketi... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Private: Format a date according to the `weekday`, `day`, `month`, and `year` attribute values. This doesn't use Intl.DateTimeFormat to avoid creating text in the user's language when the majority of the surrounding text is in English. There's currently no way to separate the language from the format in Intl. el The lo... | function formatDate(el, date) {
// map attribute values to strftime
var props = {
weekday: {
short: '%a',
long: '%A'
},
day: {
numeric: '%e',
'2-digit': '%d'
},
month: {
short: '%b',
long: '%B'
... | [
"function formatDate(el) {\n // map attribute values to strftime\n var props = {\n weekday: {\n 'short': '%a',\n 'long': '%A'\n },\n day: {\n 'numeric': '%e',\n '2-digit': '%d'\n },\n month: {\n 'short': '%b',\n 'long': '%B'\n },\n y... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
enlarge labels of all selected countries in highlight array | function highlightLabel(highlight) {
d3.selectAll('.labels').transition().style('opacity', 0.2)
.style('font-size', "9.5px").style('fill', '#B8CBED');
highlight.forEach(function(d) {
d3.selectAll('.lab-'+d).transition().style('opacity', 1)
.style('font-size', "13px")
... | [
"function update_selected_country_text() {\n\t\t\t\tif (selected_country_ids.length == 0) {\n\t\t\t\t\t$(\"#region_hover\").html(\" \");\n\t\t\t\t} else {\n\t\t\t\t\tvar selected_countries = remote_json.countries.filter(function (c) {\n\t\t\t\t\t \treturn selected_country_ids.indexOf(c.id) > -1; \n\t\t\t\t\t})... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Checks if any fields have errors; returns concatenated string | function getFieldErrorsString() {
return Object.values(getFieldErrors())
.filter((x) => !!x)
.join(', ')
} | [
"function formatValidationError(fields) {\n\t\t\tvar msg = \"\";\n\t\t\t\n\t\t\tangular.forEach(fields, function (field, index) {\n\t\t\t\t//Manually change label to name\n\t\t\t\tif (field === 'label') {\n\t\t\t\t\tfield = 'name';\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//name to Name\n\t\t\t\tmsg += field.charAt(0).toUpper... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Javascript call used to add a method to the sortable list of the jar scenarios | function addMethodToJarScenario(methodId, methodName) {
$("#sequence").append(
"<li class='ui-state-default' id=" + methodId + " name="
+ methodName
+ "><span class='ui-icon ui-icon-arrowthick-2-n-s'></span>"
+ methodName + "</li>");
} | [
"function addList() {\n\n}",
"createSortableLists() {\n const opListElement = document.getElementById(\"operationsList\");\n const flowListElement = document.getElementById(\"flowList\");\n\n Sortable.create(opListElement, {\n animation: 200,\n easing: \"cubic-bezier(1, ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Function for declaring victory. Popup with victory message appears every time there is a victory, but a different one for each player | function declareVictory() {
if (currentPlayer == "player1") {
message.addClass("color1");
message.html("THE LIGHT SIDE OF THE FORCE WINS!");
winningSound = new Audio("assets/audio/theme.mp3");
winningSound.play();
} else {
message.addClass("col... | [
"function victory() {\n\tdisplayMessage('VICTORY! Thank you! you SAVED EARTH!');\n}",
"function checkVictory() {\n if ((player.y <= 40) && (victory !=1)) {\n victory = 1;\n console.log('you won');\n $('.popup').removeClass('hidden');\n $('.victoryMessage').text(`You managed to beat the game`);\n $... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Find out whether a line ends or starts in a collapsed span. If so, return the marker for that span. | function collapsedSpanAtSide(line, start) {
var sps = sawCollapsedSpans && line.markedSpans, found;
if (sps) { for (var sp = (void 0), i = 0; i < sps.length; ++i) {
sp = sps[i];
if (sp.marker.collapsed && (start ? sp.from : sp.to) == null &&
(!found || compareCollapsedMarkers(fou... | [
"function collapsedSpanAtSide(line, start) { // 5745\n var sps = sawCollapsedSpans && line.markedSpans, found; // 5746\n if (sps) for (var sp, i = 0; i < sps.length; ++i) { ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
for any rpc "methodName", look of "this" object has such async method. This class comes with "eth_sendTransaction" implementation | sendAsync(options,cb) {
console.log("===>> ",this.title, options.method, options.params, options.params.id, options.params.jsonrpc)
const callback = (err,res)=>{
console.log("===",this.title, options.method, "err=", err, "ret=" ,res)
cb(err,res)
}
if ( typeof this[options.method] === 'function' ) {
co... | [
"sendAsync(payload, cb) {\n log.info('ASYNC REQUEST', payload)\n const self = this\n // fixes bug with web3 1.0 where send was being routed to sendAsync\n // with an empty callback\n if (cb === undefined) {\n self.rpcEngine.handle(payload, noop)\n return self._sendSync(payload)\n } else ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Function usedAttempt is made to when it runs, it will retrieve the result of the user playing the game and convert the array letter chosen in the 'choices' array index and convert it to a string | function usedAttempt() {
//Using the .queryselector & .innerhtml methods, I am able to point out to the ID "usedAttempts" from the index.html file while matching with specified message stating the number of attempts the player user has done so far then shows the results of chars they chose; they char choices chosen are... | [
"function handleUserSelection(chosenLetter) {\r\n\tif (!wrongChoices.includes(chosenLetter) || !correctChoices.includes(chosenLetter)) {\r\n\t\tconsole.log(chosenLetter + ' is a new letter!')\r\n\t\tif (word.includes(chosenLetter)) {\r\n\t\t\tconsole.log('Correct Guess');\r\n\t\t\t// add to choices\r\n\t\t\tcorrect... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
newSession(userId) get userId from page make post request with corresponding parameters. | function newSession(){
var userid = document.getElementById("userelement").innerText;
//console.log(session_name, userid, start, end);
postReq(session_name, userid, start, end);
} | [
"function createUserId(req, res, next) {\n var model = req.getModel();\n\n// var userId = model.get('_session.userId');\n\n var userId = req.session.userId ;\n if (!userId) userId = req.session.userId = model.id();\n\n\n //var userId = model.id();\n model.set('_session.userId', userId);\n\n\n n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
filter class name by user supplied regex exclude/include | function filterClass(class_name){
return ((!class_exclude_set || !class_filter_exclude.test(class_name)) && class_filter_include.test(class_name))
} | [
"function classMatchingRegex(className) {\n return new RegExp(\"\\\\b\" + className + \"\\\\b\");\n}",
"function classRE(cls) { return new RegExp(\"\\\\b\" + cls + \"\\\\b\") }",
"function classRegex(name) {\n return new RegExp(\"(^|\\\\s+)\" + name + \"(\\\\s+|$)\");\n }",
"function removeClassRegex (... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Other Functions Get all the winning moves for a specific player and board state | function getWinningMoves(board, player) {
var spaces = getAvailableSpaces();
var moves = [];
for (var i = 0; i < spaces.length; i++) {
var copyBoard = getBoardCopy(board);
var space = spaces[i];
copyBoard[space] = player;
if (checkForWinner(copyBoard, player)) {
moves.push(space);
}
}... | [
"function find_all_moves_on_board(gameState, player_num) {\n\tvar game_states = [];\n\tvar count = 0;\n\tfor( var i = 0; i<gameState.board.length; i++ ) {\n\t\tfor( var j = 0; j<gameState.board[i].length; j++ ) {\n\t\t\tif( gameState.board[i][j] == EMPTY_MARKER ) {\n\t\t\t\tvar next_game = copy_game(gameState);\n\t... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
initialize the color window | function initColorWindow() {
$("colorArea").hide();
$("colorArea").hidden = false;
$("colorBtn").observe("click", function (event) {
if (isColorBarOpened == false) {
// set the location of the emotion window
var total = $("colorBtn").offsetTop - parseInt($("colorArea").getSty... | [
"function init() \n{\n\t//set the squares up with colors and pick a new winning color\n\tsquaresReset(squares.length);\n\t//set up all listeners for the apps\n\tcreateListeners();\n}",
"function init(){\n //Mode Buttons\n setupModeButtons();\n //Squares Colors and Listeners\n setupSquares();\n rese... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
copy the user name in the message field | function copy_user_name (user_name)
{
if (document.post.message)
{
document.post.message.value += user_name;
document.post.message.focus();
}
return false;
} | [
"function copyUserEmail(f) {\n\t\t\t\t\t\t\t// getElementById('userEmailMobile').value = getElementById('userEmail').value;\n\t\t\t\t\t\t\tf.name.value = f.emailMobile.value;\n\t\t\t\t\t\t}",
"addNewMessage(username, content, type) {\n let oldName = this.state.currentUser.name;\n if (oldName !== username){\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets the value at any depth in a nested object based on the path note: adapted from: underscorecontribsetPath | function setPath(obj, value, path) {
var keys = path.split('.');
var ret = obj;
var lastKey = keys[keys.length - 1];
var target = ret;
var parentPathKeys = keys.slice(0, keys.length - 1);
parentPathKeys.forEach(function (key... | [
"$$set(path, value) {\n const node = _getSchemaNodeForPath(this.$$schema(), path);\n if (node) {\n node.set(value);\n }\n else {\n // This might be inside an object that can have additionalProperties, so\n // a TreeNode would not exist.\n const... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
The appropriate function to resolve a step | function getResolveFunc(step){
switch(step.type){
case UPDATE: return performUpdate;
case SAVE: return performSave;
case REMOVE: return performRemove;
case FILE_SAVE: return performFileSave;
case FILE_REMOVE: return performFileRemove;
}
} | [
"function getResolveFunc(step){\n switch(step.type){\n case UPDATE: return performUpdate;\n case SAVE: return performSave;\n case REMOVE: return performRemove;\n }\n}",
"function getResolveFunc(step) {\n switch(step.type){\n case UPDATE: return performUpdate;\n case SAVE: return performSave;\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
generate a stream of one or more vinyl files from a json data source containing the parent template specified by templatePath which can then be piped into nunjucks to create output with data scoped to the datum | function generateVinyl(basePath, dataPath, fPrefix, fSuffix, dSuffix) {
var files = [], r, r2, f, baseTemplate, baseName, _data, fname,
base = fs.readdirSync(basePath);
// stupid code courtesy of node doesnt support default parameters as of v5
fPrefix = fPrefix === undefined ? '' : fPrefix;
fSuffix = fSuffix... | [
"function generateVinyl(basePath, dataPath, fSuffix, dSuffix) {\n var files = [], r, r2, f, baseTemplate, baseName, _data, fname,\n base = fs.readdirSync(basePath);\n\n // stupid code courtesy of node doesnt support default parameters as of v5\n fSuffix = fSuffix === undefined ? options.ext : fSuffix;\n dSuffi... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
SEARCH ====== var elements = search('a div span'); | function search(elements, start) {
var list = [];
pubNubCore.each(elements.split(/\s+/), function (el) {
pubNubCore.each((start || document).getElementsByTagName(el), function (node) {
list.push(node);
});
});
return list;
} | [
"function search( elements, start) {\n var list = [];\n each( elements.split(/\\s+/), function(el) {\n each( (start || document).getElementsByTagName(el), function(node) {\n list.push(node);\n } );\n });\n return list;\n}",
"function findElementsByQuery(){\n\n}",
"function g... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
return source of the card | getCardType (card)
{
return card.getElementsByClassName ("front")[0].src;
} | [
"onCardReceived(card, source) {\n \n }",
"_getCardType(card) {\n var cardSrc = card.getElementsByClassName('card-value')[0].src;\n\n return cardSrc;\n }",
"getSource() {\n return this.getAttribute('src');\n }",
"function getSrc() {\n\t\t\treturn src;\n\t\t}",
"ge... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Asks macOS permission to access media devices | async function getMediaPermission() {
let accessGrantedMicrophone = false;
let accessGrantedCamera = false;
accessGrantedMicrophone = await systemPreferences.askForMediaAccess(
"microphone"
);
accessGrantedCamera = await systemPreferences.askForMediaAccess("camera");
return accessGrantedMicrophone && ... | [
"checkForMicrophoneAccess() {\r\n // Just boilerplate for filling in later with proper code\r\n navigator.permissions.query({ name: 'microphone' }).then(function (result) {\r\n if (result.state == 'granted') {\r\n\r\n } else if (result.state == 'prompt') {\r\n\r\n } el... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Cumulative mentions : Map(SourceName > Map(timestamp => cumulatedCount ) contains for each source, the number of cumulated mentions as of 'timestamp' newMentions : Map(SourceName > Map(timestamp => SortedArray[EVENTIDS]) ) contains new mentions | function updateCumulativeMentions (timeMgr, cumulativeMentions, newMentions, timestamp) {
// Add the content of newMentions to cumulativeMentions
// key=sourceName, Map(timestamp => SortedArray[EVENTIDS])
newMentions.forEach ( (value, key) => {
if (cumulativeMentions.has(key)) {
... | [
"function gen_sourceTimeEvent_tree (mentions) {\n\n const sortedArrayFactory = function (array) {return new SortedArray(array, true)}\n\n let mentionsCountPerSource = new Map()\n\n if (mentions.length > 0) {\n\n // Counts frequencies of sources by mentions\n mentions.reduce(function (acc, cur... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This handler tries to find flow Type annotated react components and extract its types to the documentation. It also extracts docblock comments which are inlined in the type definition. | function flowTypeDocBlockHandler(documentation, path) {
var flowTypesPath = (0, _getFlowTypeFromReactComponent2.default)(path);
if (!flowTypesPath) {
return;
}
(0, _getFlowTypeFromReactComponent.applyToFlowTypeProperties)(flowTypesPath, function (propertyPath) {
return (0, _setPropDescription2.default... | [
"function flowTypeHandler(documentation, path) {\n const flowTypesPath = (0, _getFlowTypeFromReactComponent.default)(path);\n\n if (!flowTypesPath) {\n return;\n }\n\n (0, _getFlowTypeFromReactComponent.applyToFlowTypeProperties)(flowTypesPath, propertyPath => {\n setPropDescriptor(documentation, property... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
syntactic sugar for absent and present checks | isAbsent() {
return "undefined" == typeof this.value || null == this.value;
} | [
"function present( thing ) {\n return !blank(thing);\n}",
"function present(obj) {\n return !blank(obj)\n}",
"function absenty(x) {\n return !existy(x);\n}",
"function isPresent (val) {\n return !isEmpty(val);\n}",
"isAbsent() {\n return this.length == 0;\n }",
"isNotDefined(val) {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
called when mouse is clicked on Start div; sets the maze back to its initial playable state | function startClick() {
var boundaries = $$("div#maze div.boundary");
for(var i = 0 ; i < boundaries.length ; i++){
boundaries[i].removeClassName("youlose");
}
loser = null;
document.getElementById("status").innerHTML = "You are playing maze!";
} | [
"function startClick() {\n start = true;\n var boundaries = $$(\"div#maze div.boundary\");\n for (var i = 0; i < boundaries.length; i++) {\n boundaries[i].classList.remove(\"youlose\");\n }\n $$(\"body\")[0].observe(\"mouseover\", overBody);\n}",
"function startClick() {\n loser = false;\n finish = fa... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Remove selected domains from the inclusion or exclusion list | function remove_selected_domains() {
if (this.id === "excludeRemove") {
var excludedDomains = document.getElementById('excludedDomains');
var excludedDomainsRemoveList = [];
for (var i = excludedDomains.length - 1; i >= 0; i--) {
if (excludedDomains.options[i].selected) {
excludedDomainsRemo... | [
"function removeSelectedExcludedDomain(event)\n{\n event.preventDefault();\n var excludedDomainsBox = document.getElementById(\"excludedDomainsBox\");\n var remove = [];\n for (var i = 0; i < excludedDomainsBox.length; i++)\n if (excludedDomainsBox.options[i].selected)\n remove.push(excludedDomainsBox.o... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Colors Circles with 3 intersections as Green: | function finishedCircleColorer() {
for (var c in circles) {
var intersections = 0;
for (var p in paths)
intersections += circles[c].getIntersections(paths[p]).length;
if (intersections == 3)
circles[c].fillColor = doneColor;
}
} | [
"function checkColor(){\n\tfor (var i = 0; i < circles.length; i++) {\n\t\t// get color of red (0 - 255) from the point of circles, and fill their data with it\n\t\tcircles[i].backgroundColor = (backCtx.getImageData(circles[i].x, circles[i].y, 1, 1)).data[0]\n\t}\n}",
"function circleColor(magnitude) {\n if (m... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
adds a geojson source representing a linestring and corresponding layer to mapbox | function addSourceLineAndLayer(name) {
map.addSource(name, {
"type": "geojson",
"data": {
"type": "Feature",
"properties": {},
"geometry": {
"type": "Polygon",
"coordinates": [
... | [
"function addLineTypeLayer(data_url,id){\n\n\n\n //Add zoom and rotation controls to the map\n map.addControl(new mapboxgl.Navigation());\n map.on('style.load', function() {\n map.addSource(id, {\n \"type\": \"geojson\",\n \"data\": data_url\n });\n map.addLayer({... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Expects: void Returns: Show alert modal before close an ambulance with NFC GIF | function showCloseMODAL() {
$("#trasanoModalHeader").empty();
$("#trasanoModalBody").empty();
$("#trasanoModalFooter").empty();
$("#trasanoModalHeader").append("<h4>Aproxime el móvil a la pegatina NFC...</h4>");
$("#trasanoModalBody").append(
"<img src='img/nfcAnimation-550x344.gif... | [
"dismiss() {}",
"function HideDonateConfirmationClose(){\n\n\t\t$supportOverlay.velocity('fadeOut', 100);\n\t\t$confirmation.velocity('fadeOut', 200);\n\n\t}",
"function closePopUp() {\n document.getElementById(\"modalForRemoteLogger\").setAttribute(\"show\", false);\n }",
"function alertDismissed() {\n\t... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Fill out an entire quadrant Compute the number of rows needed on the fly and partially fill the last. Data dependent on how many elements are created and what the result will look like TODO: Algorithm can currently only handle 3 rows without overlapping circles. | function createQuadrant(svg, quadNum, data, radius) {
var quadrant = [{x: -1, y: -1}, {x: 1, y: -1}, {x: -1, y: 1}, {x: 1, y: 1}][quadNum - 1];
var numOfRows = 0;
var elementsLeft = data.length;
var c = {x: quadrant.x*(radius*2.5)/2, y: quadrant.y*(radius*2.5)/2};
createElement... | [
"function setupMultipleLinesInQuadrant(\n getState,\n { player = currentPlayer } = {}\n) {\n // We do NOT have to go through all rotations\n // at first, since we are looking for a setup inside\n // a single quadrant, rotating a quadrant will not\n // have a meaningful influence\n\n // First at... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Funcion que muestra un mensaje de tipo alert | function showAlertMessage(mensaje) {
alert (mensaje);
} | [
"function mensajeAlert(mensaje) {\n alert(mensaje);\n}",
"function alert_msg(type, msg) {\n Toast.fire({\n type: type,\n title: msg\n })\n}",
"function setAlert(msg, tipoMsg) {\n Messenger().post({\n message: msg,\n type: tipoMsg,\n showCloseButton: true\n });\n}",
"f... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Initializes a new instance of RecoTwEntryCollection class with parameters. | function RecoTwEntryCollection(elements, userIDs, enumerable) {
var _this = this;
if (userIDs === void 0) { userIDs = null; }
if (enumerable === void 0) { enumerable = Enumerable.from(elements); }
this.elements = elements;
this.userIDs = userIDs;
t... | [
"constructor(twitterConfig) {\r\n this.tweetsArray = [];\r\n this.T = new Twit(twitterConfig);\r\n this.userid = '';\r\n }",
"constructor(email: string): void{\n this._date = new Date();\n this._email = email;\n this._entries = [];\n }",
"constructor(Collection){\n this._Collection = ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
validate user name input. if valid, then chain in to the url | function validateUserName () {
let valid = true;
let userName = document.getElementById("inputBox").value.trim().toLocaleLowerCase();
if (userName === '') {// if the input is empty
setModalMessage('NO INPUT', 'Please enter user name');
let userSection = document.getEleme... | [
"function validateName() {\n\t\t\t//fetch user name value\n\t\t\tvar userName = document.getElementById(\"user-name\"),\n\t\t\t\trequireName = document.getElementById(\"req-name\"),\n\t\t\t\t//alphabets only\n\t\t\t\tnameMatch = /^[A-Za-z]+$/;\n\n\t\t\tif (!nameMatch.test(userName.value)) {\n\t\t\t\tevent.preventDe... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
10 Return the lowest fair paid by any passenger. The fare is missing for some passengers you'll need to filter this out! | function getMinFare(data) {
const fareList = data.filter(passenger => passenger.fields.fare != null).map(passenger => passenger.fields.fare)
const minFare = Math.min(...fareList)
console.log(`MINIMUM FARE: $${minFare}`)
return minFare
} | [
"function getMinFare(data) {\n\tconst fare = data.filter( p => p.fields.fare != undefined).map(p => p.fields\n\t.fare)\n\tconst minFare = Math.min(...fare)\n\treturn minFare\n}",
"restitutionFee(player) {\n const standing = player.getStanding(this);\n if (standing >= 0) {\n re... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Positive Or Negative ================================================================================ Description: Returns the respective className for the covid span element, based on value of the input integer and whether positive is true or false (true means that positive values are good and false means that negativ... | function positiveOrNegative(integer, positive) {
let spanClass = 'neutral';
if (positive) {
if (integer > 0) {
spanClass = 'positive';
} else if (integer < 0) {
spanClass = 'negative';
}
} else {
if (integer < 0) {
spanClass = 'po... | [
"function positivityClass(positivity){\n if (positivity == 1){\n return 'Positive'\n } else {\n return 'Negative'\n }\n}",
"getClassText(value) {\n if (parseFloat(value) > 0.0) {\n return \"text-success\"\n } else {\n return \"text-danger\"\n }\n }"... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Reset creation state if record changes | async function resetCreationState() {
setCreationState("");
} | [
"function resetCreationState() {\n return _resetCreationState.apply(this, arguments);\n }",
"resetRecord() {\n this.lastRecordEvent = null;\n this.lastRecordSnapshot = undefined;\n this.curRecordSnapshot = undefined;\n }",
"resetToNew() {\n this.id = cryptohat(53, 0);\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
selector for the Email error | get errorEmail () { return $('#register-error-email') } | [
"get errorEmail () { return $('#login-error-email') }",
"function errorSelector(message) {\n return throwingSelector(message);\n}",
"function action_invalid_login_email(){\n \t$(\"#error-login_email\").css(\"color\",\"red\");\n\t\t$(\"#error-login_email\").html(\"Invalid Email or mobile number format\");\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Validate if Block is being tampered by Block Height | async validateBlock (height) {
var block = await this.getBlock(height)
const originalHash = block.hash
block.hash = ''
return originalHash === this.getHash(block)
} | [
"validateBlock(height) {\n // Add your code here\n // get block object\n let block = this.getBlock(blockHeight);\n // get block hash\n let blockHash = block.hash;\n // remove block hash to test block integrity\n block.hash = '';\n // generate block hash\n let v... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
get file fd and init fd slicer | getFdSlicer() {
return new Promise((resolve, reject) => {
fs.open(this.localPath, 'r', (err, fd) => {
try {
if (err) {
throw err;
}
resolve(FdSlicer.createFromFd(fd));
} catch (error) {
reject({
error,
trace: 'CosRando... | [
"open(path, mode = \"r\") {\n // The new file descriptor takes the first open space (from a closed fd),\n // or just gets pushed to the array if there are no open spots.\n let newFd = this.fds.indexOf(null);\n if (newFd === -1) {\n newFd = this.fds.length;\n }\n const fd = FileDescriptor(path... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Search contract for trigger events | getTriggerEvents() {
if (!this.contract) {
return;
}
// Search the contract events for the hash in the event logs and show matching events.
this.contract.getPastEvents(
"Trigger",
{
filter: { _from: this.coinbase },
fromBlock: 0,
toBlock: "latest"
},
... | [
"function searchEvents() {\n events.get().then((eventQuery) => {\n eventQuery.forEach((document) => {\n if (document.data().EventName.toLowerCase().includes(searchURLParam)) {\n printEvents(document)\n }\n })\n })\n}",
"function searchPending3PPEvents(arrTr... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
copy matrix and make sets where cell = 0 | function initial() {
//add sets for empty cell
for (let i = 0; i < 9; i++) {
solved[i] = [];
for (let j = 0; j < 9; j++) {
solved[i][j] = matrix[i][j];
if (solved[i][j] == 0)
solved[i][j] = new Set([1, 2, 3, 4, 5, 6, 7, 8, 9]);
... | [
"function setZeros(matrix) {\n var rows = new Array(matrix.length);\n var column = new Array(matrix[0].length);\n\n for (var i = 0; i < rows.length; ++i) {\n for(var j = 0; j < column.length; ++j) {\n if(matrix[i][j] === 0) {\n rows[i] = true;\n column[j] = true;\n }\n }\n }\n for... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
[5] AxisSpecifier::= AxisName '::' | AbbreviatedAxisSpecifier [6] AxisName::= 'ancestor' | 'ancestororself' | 'attribute' | 'child' | 'descendant' | 'descendantorself' | 'following' | 'followingsibling' | 'namespace' | 'parent' | | 'preceding' | 'precedingsibling' | 'self' | function axisSpecifier(stream, a) {
var attr = stream.trypop('@');
if (null != attr) return 'attribute';
var axisName = stream.trypopaxisname();
if (null != axisName) {
var coloncolon = stream.trypop('::');
if (null == coloncolon)
throw new XPathException(XPathException.INVALID_EXPRE... | [
"function axisSpecifier(stream,a){var attr=stream.trypop('@');if(null!=attr)return'attribute';var axisName=stream.trypopaxisname();if(null!=axisName){var coloncolon=stream.trypop('::');if(null==coloncolon)throw new XPathException(XPathException.INVALID_EXPRESSION_ERR,'Position '+stream.position()+': Should not happ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
cache topic list and return | function getNewCache(oldState, topicList, boardId, sortType, page, isSuccessful) {
// if we have no access to a forum or sub forum, we
// should return original forum groups.
if (!isSuccessful) { return oldState.list; }
let newTopicList = [];
if (page !== 1) {
newTopicList = oldState[boardId][sortType].... | [
"function readTopics() {\n tRefs.clear();\n let a = []\n for (let s of localStorage.topics.split('\\n')) {\n let [topic, enc] = s.split('=')\n tRefs.set(topic, RefSet.fromEncoded(topic, enc))\n a.push(topic)\n }\n}",
"getAllTopics() {\n return this.topics;\n }",
"funct... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
rollupplugincatchunresolved Catch any unresolved imports to give proper warnings (Rollup default is to ignore). | function rollupPluginCatchUnresolved() {
return {
name: 'snowpack:rollup-plugin-catch-unresolved',
resolveId(id, importer) {
if (isNodeBuiltin(id)) {
this.warn({
id: importer,
message: `"${id}" (Node.js built-in) could not be resolved. (https://www.snowpack.dev/#node-built-i... | [
"function rollupPluginCatchUnresolved() {\n return {\n name: 'snowpack:rollup-plugin-catch-unresolved',\n resolveId(id, importer) {\n // Ignore remote http/https imports\n if (id.startsWith('http://') || id.startsWith('https://')) {\n return false;\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Resets Quiz key to random number and rerenders it... there's probably a better way to do this. | function retakeQuiz() {
return setKey(Math.random());
} | [
"function resetQuiz() {\n questionNum = 0;\n score = 0;\n index = 0;\n renderQuiz();\n}",
"function resetQuiz() {\n\tquestionNumber = 0;\n\tcurrentAnswer = ``;\n}",
"function resetQuiz() {\n questionCounter = 0;\n currentQuestion;\n attempt = 0;\n correctAnswers = 0;\n\n}",
"function r... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Actually prepare items. This is handled outside of the tick because it will take a while and we do NOT want to block the current animation frame from rendering. | prepareItems() {
this.limiter.beginFrame();
// Upload the graphics
while (this.queue.length && this.limiter.allowedToUpload()) {
var item = this.queue[0];
var uploaded = false;
if (item && !item._destroyed) {
for (var i = 0, len = this.uploadHo... | [
"function setItems() {\r\n\t\t\tvar itemTotal = $flipWorld.length;\r\n\t\t\t\titemArr=[];\r\n\r\n\t\t\tfor(var i = 1; i <= itemTotal; i++)\r\n\t\t\t{\r\n\t\t\t\titemArr.push($(\".projectCon li:nth-child(\" + i + \")\"));\r\n\t\t\t}\r\n\r\n\t\t\t// console.log(itemArr);\r\n\t\t\t_itemPosControler.init(itemArr, itemR... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Constructs a new ModifyCallRequest. | constructor() {
ModifyCallRequest.initialize(this);
} | [
"function ModifyCallRequest() {\n _classCallCheck(this, ModifyCallRequest);\n\n ModifyCallRequest.initialize(this);\n }",
"function ModifyConferenceRequest() {\n _classCallCheck(this, ModifyConferenceRequest);\n\n ModifyConferenceRequest.initialize(this);\n }",
"function CreateRequest(config){\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Open more buttons menu. | function openMoreButtonsMenu() {
isMoreButtonsMenu = true;
$('#moreButtonsMenu').toggle();
$('#moreButtonsMenu').html(moreButtonsHtml);
} | [
"function initMoreMenu() {\n\n\tvar items = [\n\t\t{text: 'Business', href: '/nowhere.html'},\n\t\t{text: 'Health', href: '/nowhere.html'},\n\t\t{text: 'Entertainment', href: '/nowhere.html'},\n\t\t{text: 'Tech & Science', href: '/nowhere.html'}\n\t];\n\n\tvar opener = document.getElementById('more-opener');\n\n\ti... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Reads the text in 'sample.txt' using a stream | function readFromStream() {
if (SdkSample.sampleFile !== null) {
SdkSample.sampleFile.openAsync(Windows.Storage.FileAccessMode.read).then(function (readStream) {
var size = readStream.size;
var maxuint32 = 4294967295; // loadAsync only takes UINT32 value.
... | [
"function readFile(fileName, target) {\n let readStream = createReadStream(fileName, \n { encoding: 'utf8', bufferSize: 1024 });\n readStream.on('data', buffer => {\n let str = buffer.toString('utf8');\n target.next(str);\n });\n readStream.on('end', () => {\n // Signal end of ouput sequence\n ta... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Set category filter text | [consts.SET_CATEGORY_FILTER_TEXT](state, txt) {
state.categoryFilterText = txt;
} | [
"[consts.SET_CATEGORY_FILTER_MODE](state, val) {\n state.categoryFilterMode = val;\n state.categoryFilterText = \"\";\n }",
"function categoryFilter() {\n\t\t$(\".category.\" + catergoryName).show(\"400\"); // Show the filter items\n\t\t$(\".category:not(.\" + catergoryName + \")\").hide(\"400\")... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Check if polygon self intersects (using openLayers) | function checkSelfIntersection(polygon) {
if(polygon.CLASS_NAME=="OpenLayers.Geometry.Polygon") {
// checking only outer ring
var outer = polygon.components[0].components;
var segments = [];
for(var i=1;i<outer.length;i++) {
var segment= new OpenLayers.Geometry.LineString([outer[i-1].clone(),out... | [
"intersects_poly(poly) {\n return this.contains_poly(poly) || this.partially_intersects_poly(poly);\n }",
"function intersectsPolygon(a, b) {\n var p = a;\n do {\n if (p.i !== a.i && p.next.i !== a.i && p.i !== b.i && p.next.i !== b.i &&\n intersects(p, p.next, a, b)) return true;\n p =... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Analyzes which halfedges were selected and enables/disables the operation buttons accordingly. Also sets the global selected_halfedges array to the values of the selected halfedges | function configureButtons () {
var sel = d3.selectAll ("g.halfedge.selected");
var he = [];
sel.each(function (d) {
if (d == lastHalfedgeSelected || sel.size() == 1) he[0] = d;
else he[1] = d;
});
selected_halfedges = he;
if (he.length != 1 || !he[0].isBorder) {
d3.select ("button#grow").attr("disabled", t... | [
"function toggleEdges() {\r\n sig.settings(\"drawEdges\", $('#inrender-edge-box').is(':checked'));\r\n $('#edge-slider').toggle('disabled');\r\n draw_edges ^= true;\r\n sig.refresh({skipIndexation: true});\r\n}",
"function updateAllTheGeometry() {\n\n if (config.enableSelection) {\n\n toggle... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This function displays the brewery details whenever the user clicks on one of the brewery buttons. | function displayBreweryDetails(event) {
event.preventDefault();
// Clears out previous brewery information. Otherwise it would just keep appending.
$("#breweryDetails").text("");
var breweryDisplayId = event.target.id;
// breweryDetailsDiv = $("<div>"); figure out what to do with this.
var nameDisplay = b... | [
"function brewClick() {\r\n let brewId = this.id;\r\n let urlBrew = (\"https://api.openbrewerydb.org/breweries/\" + brewId);\r\n let body = document.getElementById(\"under\");\r\n body.style.margin = \"20px\";\r\n body.innerHTML = \"\";\r\n fetch(urlBrew)\r\n .th... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns the transform of this frame relative to the given reference frame, if the transform is defined. options.relativeTo default is parent reference frame | getTransform(context, options) {
if (options && options.relativeTo) {
return this.getTransformRelativeTo(context, options.relativeTo)
} else {
return this.getTransformRelativeTo(context, this.parent)
}
} | [
"get localTransform() {\n return this.transform.localTransform;\n }",
"getTransform() {\n return this.transform;\n }",
"function _getTransform(target, ancestor) {\n var mat = zrender_lib_core_matrix__WEBPACK_IMPORTED_MODULE_5__.identity([]);\n\n while (target && target !== an... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Callback that is called when a questionnaire is stopped | setQuestionnaireStoppedCallback(questionnaireStoppedCallback) {
this.questionnaireStoppedCallback = questionnaireStoppedCallback;
} | [
"function stop_answered(){}",
"function questionStop() {\n clearInterval(questionCounter);\n}",
"function onAnswerIndicatorFinish() {\n log(\"onAnswerIndicatorFinish\");\n hideTag(tags[curQ][1]);\n if(!isWin()) {\n controlsDisabled = false;\n showNextQA();\n } \n}",
"function stop... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Closes a session by setting its status and updating the session object with it. Internally calls `updateSession` to update the passed session object. | function closeSession(session, status) {
let context = {};
if (status) {
context = { status };
} else if (session.status === 'ok') {
context = { status: 'exited' };
}
updateSession(session, context);
} | [
"function closeSession(session, status) {\n let context = {};\n if (status) {\n context = { status };\n } else if (session.status === 'ok') {\n context = { status: 'exited' };\n }\n\n updateSession(session, context);\n }",
"function closeSession(session, status) {\n let context = {};\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
______________________________________________________________________________// Chronicling America API// Loads in documents for the Chaplain being viewed. | function loadChaplainDocs() {
$("#chaplain-docs").append("<p>Loading results for " + $("#chaplain-name").text() + "</p>");
var displayObjects = [];
var i = 0;
while (i < 20) {
ajaxCall($("#chaplain-name").text(), i + 1, displayObjects);
i++;
}
} | [
"getScriptureText(chapId){\n \n fetch(`${this.props.baseURL}bibles/${this.props.bibleId}/chapters/${chapId}?content-type=text`, {\n method: 'GET',\n headers: {\"api-key\": this.props.apiKey},\n //mode: 'no-cors'\n \n })\n .then(response... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Below this comment, create a function named addNumbers, which accepts two parameters. The function should add the two parameters together and write the result to the element with the id resultadd | function addNumbers(num1, num2) {
$('#result-add').text(num1 + num2)
} | [
"function addNumbers() {\n let addend1 = parseInt(document.querySelector('#addend1').value);\n let addend2 = parseInt(document.querySelector('#addend2').value);\n let result = add(addend1, addend2);\n\n // Step 4: Assign the return value to an HTML form element with an ID of sum\n document.querySelec... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
get list leads reject by campId, filter by processtep | static getLeadReject(campId, processStep) {
return __awaiter(this, void 0, void 0, function* () {
try {
let leads = yield lead_1.Lead.findAll({
where: {
CampId: campId,
IsDeleted: false,
Proce... | [
"static listByCampaignId(campId, processStep, limit, page) {\n return __awaiter(this, void 0, void 0, function* () {\n try {\n let offset = limit * (page - 1);\n let activities = yield lead_1.Lead.findAll({\n where: {\n Proces... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
get all item clicks | function getItemClicks(){
let clicksArr = [];
for (let i = 0; i < allItems.length; i++){
clicksArr.push(allItems[i].clicked);
}
return clicksArr;
} | [
"function clickItems() {\n Array.from($items).forEach((i) => {\n i.addEventListener(\"click\", (item) => {\n paintItem({item: item});\n });\n });\n}",
"function getAllItems() {\r\n elements = document.querySelectorAll(\".item\")\r\n for (let i = 0; i < elements.length; i++) {\r\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Called to disable a link to the webstart. | function disableLink(linkID) {
var link = document.getElementById(linkID);
if (link) {
link.onclick = function() {
return false;
};
link.style.cursor = "default";
link.style.color = "#000000";
}
} | [
"function disableLink(eL) {\r\n\teL.onclick = function(e) {\r\n\t\tif (e && e.preventDefault) {\r\n\t\t\te.preventDefault();\r\n\t\t}\r\n\t\telse {\r\n\t\t\twindow.event.returnValue = false;\r\n\t\t}\r\n\t\treturn false;\r\n\t}\r\n}",
"disableOpenExternalLinks() {\n this._allowOpenExternalLinks = false;\n }",... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Parse a data transform specification. | function parseTransform(spec, scope) {
var def = definition(spec.type);
if (!def) error('Unrecognized transform type: ' + $(spec.type));
var t = entry(def.type.toLowerCase(), null, parseParameters(def, spec, scope));
if (spec.signal) scope.addSignal(spec.signal, scope.proxy(t));
t.metadata = def.me... | [
"function parseTransform (spec, scope) {\n const def = Object(vega_dataflow__WEBPACK_IMPORTED_MODULE_4__[\"definition\"])(spec.type);\n if (!def) Object(vega_util__WEBPACK_IMPORTED_MODULE_0__[\"error\"])('Unrecognized transform type: ' + Object(vega_util__WEBPACK_IMPORTED_MODULE_0__[\"stringValue\"])(spec.type));... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Adds a new user to the chatroom DB, only adds if a user of that name is not in Params: a user object (intentionally abstract object to allow for easier changes) Returns true on succesful add, false on fail | addUser(user) {
let foundUser = false;
for (let i = 0; i < this.chatUsersDB.length; i++) {
if (this.chatUsersDB[i].username === user.username) {
foundUser = true;
break;
}
}
if (!foundUser) {
user.hoursInChatroom = 0;
... | [
"function addUser(user) {\n var res = false;\n if (isValid(user)){\n\n users.push(user);\n res = true;\n\n }\n\n return res;\n}",
"function addUser(user){\n\n}",
"async addUser(userId) {\n try {\n const newUser = await this.musicUsers.create({\n user: userId\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
8. Shapes Define function: printShape(shape, height, character) shape is a String and is either "Square", "Triangle", "Diamond". height is a Number and is the height of the shape. Assume the number is odd. character is a String that represents the contents of the shape. Assume this String contains just one character. U... | function traverseObject(someObj) {
console.log(someObj);
} | [
"function printShape(shape, height, character){\n\tvar result = \"\";\n\tswitch(shape){\n\t\tcase \"Square\":\n\t\tfor(var i = 0; i < height; i++){\n\t\t\tfor(var j = 0; j < height; j++){\n\t\t\t\tresult = result + character;\n\t\t\t}\n\t\t\tresult = result + \"\\n\";\n\t\t} break;\n\t\tcase \"Triangle\":\n\t\tvar ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
byAtt Given a list of candidate HTML elements, return the subset that have an attribute a matching regular expression e. Prototype: NodeList objCss(NodeList n, string a, regex e) Arguments: n ... An HTML element a ... A CSS property name e ... An optional property value Results: An array containing the matching nodes, ... | function byAtt(n, a, e) {
var r = new Array();
for (var i = 0; i < n.length; i++) {
if (e.test(objAtt(n[i], a))) {
r[r.length] = n[i];
}
}
return r;
} | [
"function xGetElementsByAttribute(sTag, sAtt, sRE, fn)\r\n{\r\n var a, list, found = new Array(), re = new RegExp(sRE, 'i');\r\n list = xGetElementsByTagName(sTag);\r\n for (var i = 0; i < list.length; ++i) {\r\n a = list[i].getAttribute(sAtt);\r\n if (!a) {a = list[i][sAtt];}\r\n if (typeof(a)=='string... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Replaces the first occurrence of a pattern with a different chunk of HTML. Returns the inserted chunk. Returns null if the pattern was not found. | function replaceImpl(/*HtmlDocument*/ doc, /*Pattern*/ pattern, /*Chunk*/ replacement) {
var range = removeImplForReplace(doc, pattern);
if (!range) return null;
return insertImpl(doc, range, replacement);
} | [
"function replaceImpl(/*HtmlDocument*/ doc, /*Pattern*/ pattern, /*Chunk*/ replacement) {\r\n var range = removeImplForReplace(doc, pattern);\r\n if (!range) return null;\r\n return insertImpl(doc, range, replacement);\r\n}",
"insert(pos, content) {\n return this.replaceWith(pos, pos, content);\n }",
"fu... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
returns the given t tBuffer if given t is allowed, 1 otherwise t is allowed if: t >= 0 and t <= 1 | _isLegalT(t) {
if (t >= 0 && t <= 1) {
t -= this._tBuffer;
return (t > 0) ? round(t, 4) : 0;
}
return 10;
} | [
"function get_index_abs_t(input_buffer){\r\n\t// init\r\n\tlet threshold = 0.1;\r\n\r\n\t// maximum value in the input buffer\r\n\tlet max = Math.max.apply(Math, input_buffer); \r\n\r\n\t// find first drop greater than threshold\r\n\tfor(let tau=1;tau<input_buffer.length;tau++){\r\n\t\tif(input_buffer[tau] < thresh... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
A ratio of viewport height to image height | get_viewport_height_ratio(hgt) {
return jquery_default()("#" + this.config["annbox_id"]).height()/hgt;
} | [
"get_viewport_height_ratio(hgt) {\n\t\treturn $(\"#\" + this.config[\"annbox_id\"]).height()/hgt;\n\t}",
"setShlideViewportHeight() {\n\n let widthOfShlideEl = 0;\n // take off \"%\" or \"px\" on shlideEl.style.width and convert to int (in px)\n if(this.shlideEl.style.width.indexOf(\"%\") != -1) {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Deploy this FaasInstance to an HTTP accessible endpoint. The `url` field on this instance will be populated after the deployment occurs. | async deploy() {
const { url } = await this.provider.faas.createHttpFunction(this.params)
this.url = url
return this
} | [
"async deploy(instanceData = {}, options = {}) {\n return instance.deploy(this, instanceData, options);\n }",
"function serviceDeploy(environment, fn) {\n return async (...args) => {\n let deployment_id;\n try {\n deployment_id = await createDeployment(\n `${environment} - ${isProd ? 'Produ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Called when any of the Special Item checkboxes change. | function OnSpecialItemChanged(specialItem) {
selectionsSpecialItem = specialItem;
OnFilterCriteriaChanged();
} | [
"function handleToggleCheckUncheckedItems() {}",
"function itemCheckStateChanged(e) {\n closeDiffViewOptions();\n var $el = $(this);\n var key = $el.attr('data-key');\n var val = $el.attr('data-value');\n var checked = e.type === 'aui-dropdown2-item-check';\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Converts a unique enum value to its key. G Useful for preparing an enum value for external data (JSON). ! Will return a symbol if the enum value was keyed with one. | valueToKey(e, value) {
this.instanceRule.validate(e);
const enumKeys = getKeysOf(e, this.keyAttributes);
const foundKey = enumKeys.find(key => e[key] === value);
if (foundKey === undefined) {
throw new Error('Enum does not contain the passed value.');
}
return foundKey;
} | [
"function getEnumKey(anEnum, value) {\n for (var key in anEnum) {\n if (value === anEnum[key]) {\n return key;\n }\n }\n\n return '';\n}",
"static getEnumName(group, value) {\n\t\treturn Object.keys(group).find(key => group[key] === value) + '(' + value + ')';\n\t}",
"static mapEnum(value) {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Fetches all the details of the given sneaker name from the webservice API. | function populateDetails(name) {
directView("shop-view");
let url = URL + "sneaker/" + name;
fetch(url)
.then(checkStatus)
.then(response => response.json())
.then(appendDetails)
.catch(handleRequestError);
} | [
"function searchStartupByName(name){\n\tvar dfd = Promise.defer();\n\trequest.get('https://api.angel.co/1/search', {\n\t\tform: {\n\t\t\taccess_token: myToken,\n\t \tquery: encodeURIComponent(name),\n\t \ttype: 'Startup'\n\t\t}\n\t}, function(error, response, body){\n\t\tdfd.resolve(body);\n\t});\n\treturn df... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
obte l'array amb les paraules i imatges de la cadena passada Genera Array con los WordImg obtenidos a partir de la cadena pasada | function initMedia (Cadena)
{
var init = 0;
var resultat = new Array ();
var paraulaImatge;
var fi = Cadena.length;
tmp = Cadena;
var paraules = new Array ();
var paraula;
first = 0;
if (fi != init) {
do {
if (tmp.length >= 1) {
cadena = getCadena ('@', '@', tmp);
par... | [
"function getWordImg (cadena, marca)\r\n{\r\n var imatge;\r\n var word;\r\n var ParaulaImatge;\r\n var posMarca = cadena.indexOf (marca);\r\n word = cadena.substring (0, posMarca);\r\n imatge = cadena.substring (posMarca + 1, cadena.length);\r\n ParaulaImatge = new WordImg (word.toUpperCase(), imatge, \"so/\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
DateTimeBaseEditor < InputElementEditor < BaseEditor | function DateTimeBaseEditor(args) {
InputElementEditor.call(this, args);
var date = this.args.item[this.column.field];
this.boxWidth -= 24;
let gridView = $(args.container).closest('.slick-viewport')
this.fpConfigGrid = fpMergeConfigs({}, fpConfigInit, {
clickOpens: false,
onReady: fun... | [
"function DateTimeEditor(options) {\n // Get the timezone from the end of the type string.\n options.timezone = gutil.removePrefix(options.field.column().type(), \"DateTime:\");\n\n // Adjust the command group.\n var origCommands = options.commands;\n options.commands = Object.assign({}, origCommands, {\n p... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
set flag for the given user | async setFlagForUser (userId) {
let op;
// set or clear flag
if (this.clear) {
op = { $unset: { [this.flag]: true } };
}
else {
op = { $set: { [this.flag]: true } };
}
await this.data.users.updateDirect({ _id: this.data.users.objectIdSafe(userId) }, op);
// send pubnub update on user's me-channel... | [
"async setUserFlags () {\n\t\tif (Commander.dryrun) {\n\t\t\tthis.log('\\tWould have set user flags');\n\t\t\treturn;\n\t\t}\n\t\telse {\n\t\t\tthis.log('\\tSetting user flags...');\n\t\t}\n\t\tconst op = {\n\t\t\t$set: {\n\t\t\t\tinMaintenanceMode: true,\n\t\t\t\tmustSetPassword: true,\n\t\t\t\tclearProviderInfo: ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
getStorage: retrieves a key from localStorage previously set with setStorage(). params: key : localStorage key returns: : value of localStorage key null : in case of expired key or failure | getStorage(key) {
const now = Date.now(); //epoch time, lets deal only with integer
// set expiration for storage
let expiresIn = this.$localStorage.get(key + "_expiresIn");
if (expiresIn === undefined || expiresIn === null) {
expiresIn = 0;
}
if (expiresIn < now) {
/... | [
"function getStorage(key) {\r\n\r\n var now = Date.now(); //epoch time, lets deal only with integer\r\n // set expiration for storage\r\n var expiresIn = localStorage.getItem(key+'_expiresIn');\r\n if (expiresIn===undefined || expiresIn===null) { expiresIn = 0; }\r\n\r\n if (expiresIn < now) {// Expired\r\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns an array of sets of edges corresponding to seams (not necessarily maximal) | getSeams() {
var used = new Set();
var seams = [];
var nbEdges = this.getNonBoundaryEdges(); //interior edges
console.log("nb edges", nbEdges)
for (var i = 0; i < nbEdges.length; i++) {
for (var j = i + 1; j < nbEdges.length; j++) {
var edge = nbEdges[i];
var otherEdge = nbEdge... | [
"getAllEdges() {\n let edges = [];\n for (let i = 0; i < this.size; i++) {\n for (let j = 0; j < this.size; j++) {\n const neighbours = [\n [i + 1, j],\n [i, j + 1],\n ]\n neighbours.map(([p, q]) => {\n if (p < 0 || p >= this.size || q < 0 || q >= this.size... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
compare Callback function with different compare alternatives for the column sort | function compare(a, b) {
// Find out which column and part of column are we sorting on from currentTable
let col = sortableTable.currentTable.getSortcolumn();
let kind = sortableTable.currentTable.getSortkind();
if (col === "ccode" || col === "cname"|| col === "class") {
let ret = 0;
if... | [
"function column_compare(a, b) {\n col_a = $.trim($(a).children('.' + sort_column).text());\n col_b = $.trim($(b).children('.' + sort_column).text());\n\n // If the table is being sorted by urgency index, turns the values into integers so they get compared correctly.\n // Strings of integers get compared strang... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Processes the watch command | ProcessWatchCommand() {
if (this.commandParameters.length < 1)
return;
//get the channel id
this.friendlyChannelName = this.message.content.substring(this.message.content.indexOf(' ') + 1);
this.channelId = this.GetVoiceChannelIdByName(this.friendlyChannelName);
//if... | [
"cmd_watch(cmdTokens, connection) {}",
"function startObserving() {\n var index = void 0,\n onChange = function () {\n console.log('CHANGED');\n };\n\n for (index in config) {\n if (config.hasOwnProperty(index)) {\n // console.log(base + index, config[inde... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Function to create and upload a file Usage: node drive.js create path | function createFile(auth, filePath) {
var encrypted_file = encrypt(filePath);
// {'fileName': name, 'fileData': data, 'fileKey': key}
// var file_path = filePath;
var drive = google.drive({ version: 'v3', auth });
var fileMetadata = {
'name': encrypted_file["fileName"]
};
var media = {
mimeType: ... | [
"async function createFile(auth, filename, filepath, res) {\n const filesize = fs.statSync(filepath).size;\n const drive = google.drive({version: 'v3', auth});\n const google_res = await drive.files.create({\n requestBody: {\n name: filename,\n parents: [process.env.DRIVE_DIR]\n },\n media: {\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
ROUTE checks if a route can be calculated and displayed (if least two waypoints are set) if >= 2 wp: requests the route and associated information else: hides route information | function handleRoutePresent() {
var isRoutePresent = waypoint.getNumWaypointsSet() >= 2;
if (isRoutePresent) {
ui.startRouteCalculation();
var routePoints = ui.getRoutePoints();
for (var i = 0; i < routePoints.length; i++) {
routePoints[i] = routePoints[i].split(' ');
if (routePoints[i].le... | [
"loadRoute() {\n const router = this.platform.getRoutingService();\n\n router.calculateRoute({\n mode: 'fastest;car',\n waypoint0: 'geo!28.0345,-80.5887',\n waypoint1: 'geo!28.3861,-80.7420',\n representation: 'display'\n }, this.loadRouteSuccess, this.loadRouteError);\n }",
"functio... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
preCallback Event: New callback (`postEventPromise`) has been scheduled. | preCallback(schedulerTraceId, isEventListener, promisifyPromiseVirtualRef) {
const runId = this._runtime.getCurrentRunId();
const preEventRootId = this.getCurrentVirtualRootContextId();
const contextId = this._runtime.peekCurrentContextId();
// store update
const upd = asyncEventUpdateCollection.ad... | [
"_postDidChange() {\n this.runCallbacks(CALLBACK_QUEUES.POST_DID_CHANGE);\n }",
"runPostCommit(aCallback) {\n this._pendingPostCommitCallbacks.push(aCallback);\n }",
"_hookPre(evt) {\n\n let _this = this;\n\n return new BbPromise(function (resolve, reject) {\n\n console.log('-----------... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
12.10 The with statement | function parseWithStatement$993() {
var object$1443, body$1444;
if (strict$879) {
throwErrorTolerant$930({}, Messages$874.StrictModeWith);
}
expectKeyword$933('with');
expect$932('(');
object$1443 = parseExpression$969();
expect$932(')');
body$... | [
"function foo (obj) {\n with (obj) {\n a = 2;\n }\n}",
"function ft(e){var t,n;return en&&X(Jt.StrictModeWith),ne(\"with\"),ee(\"(\"),t=He(),ee(\")\"),n=xt(),e.finishWithStatement(t,n)}",
"function parseWithStatement() {\n var object, body, marker = markerCreate();\n \n if (strict)... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Search members in a team. | async function searchMembers (req, res) {
const result = await service.searchMembers(
req.authUser,
req.params.id,
req.query
)
res.send(result.result)
} | [
"async findTeams(root, { filter }, { authUser }, info) {\n if (!authUser) throw new Error(\"Unauthorized\");\n\n const include = getInclude(info);\n const order = [[\"name\", \"ASC\"]];\n\n let logFields = { type: \"Team search\" };\n let where = null;\n\n if (typeof filter !== \"undef... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
stutter :: String > IO String | function stutter(x){
var f = function(s){
var n = Math.floor(Math.random() * Math.floor(s.length / 2));
if (n == 0) return s;
else if (s.match(/\[\/?(i|b|u|url|quote)\]/i)) return s;
else return f(s.slice(0, n)) + '-' + s;
}
return map(f, x.split(' ')).join(' ');
} | [
"function shout(string) {\n return console.log(string + string);\n}",
"function shout(str) {\n console.log(str + str);\n return str + str;\n}",
"function logShout(string){\n console.log(shout(string));\n}",
"function logShout(string) {\n console.log(shout(string))\n}",
"function logShout(string) ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
saves a key value pair in either session storage or local storage based on mode passed or set in object definition mandatory fields | persist(key, value, mode) {
//mode can be enforced by passing 3rd argument
mode = this.checkMode(mode);
var stringifiedValue = JSON.stringify(value);
window[mode].setItem(key, stringifiedValue);
} | [
"static save( keyName , obj = false , storageValue ){\n\n\n /* if obj = false meaning edit and save direct \n if = obj not false meaning add new value with array in storage */\n if(!obj){\n\n }else if(this.load(keyName) == null){\n storageValue ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |