query stringlengths 9 34k | document stringlengths 8 5.39M | negatives listlengths 19 20 | metadata dict |
|---|---|---|---|
get the Registration Other Info Reference Action | function registrationOtherInfoReferenceAction() {
const action = {
type: ApiConstants.API_REGISTRATION_OTHER_INFO_REFERENCE_LOAD,
};
return action;
} | [
"function getAction() {\r\n\r\n return( action );\r\n\r\n }",
"function registrationForm() {\n app.getForm('profile').handleAction({\n confirm: function () {\n var email, profileValidation, password, passwordConfirmation, existingCustomer, Customer, target, customerE... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
A stub function that would eventually calculate the shipping price | static calculateShippingPrice(shippingAddress, productCost, shippingProvider, daysToDeliver) {
return 42;
} | [
"function shippingCost(order)\n{\n return order.shipping_lines.reduce((total, sl) => total + parseFloat(sl.price), 0);\n}",
"calculateTradeAmount(side, curAQuantity, usdtQuantity, price, initService){\n //Buy - we need to calculate how much token we can get for our USDT\n if(side == process.env.BUY){\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Reset the filter to have all of it's filter values set to the provided value | reset(value) {
this.filter = this.filter.map(() => value);
} | [
"function resetFilters() {\n Filters.distance = 10;\n Filters.minPrice = 0.0;\n Filters.maxPrice = 100.0;\n Filters.itemQuality = 0;\n Filters.gender = 'all';\n Filters.type = 'all';\n Filters.size = 'all';\n Filters.color = 'all';\n Filters.freeOnly = false;\n}",
"clearAllFilters() {\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Creates HTML code to do into the div for the super frame segment information display. | function displaysuperframesegment(i){
var framesegment = document.getElementById("superframesegment");
superframesegment.innerHTML = "<b>Window number:</b> " + i + "<br />" +
"<b>Character index:</b> " + windownums[i] + "<br />" +
"<b>GC Content Percentage:</b> " + windowdata[i];
} | [
"function injectHTML(e)\r\n {\r\n doc = barElement.contentDocument;\r\n\r\n doc.body.innerHTML = \t\r\n \"<style type='text/css'>\" + \r\n \".rounded\t\t\t\t\t{-moz-border-radius:5px;-webkit-border-radius:5px}\"+\r\n \".overflow\t\t\t\t\t{overflow-x:hidden;overflow... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Creates an expression with the given type and attributes | function expression(expr, attr) {
var expression = { expression: expr };
if (attr)
for (var a in attr)
expression[a] = attr[a];
return expression;
} | [
"function createNode(type, attributes, props) {\r\n var node = document.createElement(type);\r\n if (attributes) {\r\n for (var attr in attributes) {\r\n if (! attributes.hasOwnProperty(attr)) continue;\r\n node.setAttribute(attr, attributes[attr]);\r\n }\r\n }\r\n if (props) {\r... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Search suspicious comments on Google and save other Facebook pages that contain it | function googleSearch() {
if(verbose == 1) console.log('entering googleSearch');
comment = comments_to_search.shift();
var url = 'http://www.google.com/search?q=' + comment + '+facebook';
if(verbose == 1) console.log('google search for comment: ' + comment);
var temp = '';
var page = require(... | [
"registerSeenComments() {\n // Don't run this more than once in some period, otherwise scrolling may be slowed down. Also,\n // wait before running, otherwise comments may be registered as seen after a press of Page\n // Down/Page Up.\n if (!unseenCount || cd.g.dontHandleScroll || cd.g.autoScrollInProgr... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
method to get one customer by customer Id from customer API | function getCustomer(id) {
return $http.get(baseUrl+"customer/"+id,{headers:setHeaders()});
} | [
"function getCustomer(axios$$1, customerToken) {\n return restAuthGet(axios$$1, 'customers/' + customerToken);\n }",
"async findCustomer(customerId) {\n return Appointment.findOne({where:{customerId}});\n }",
"async findOneWithCustomer(req, res, next) {\n let pet;\n const { id } = req.params;\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
function changeImmYear function changeBYear Take action when the user changes the value of an explicit birth year field. Input: this element containing a birth year | function changeBYear()
{
let form = this.form;
let censusId = form.Census.value;
let censusYear = censusId.substring(censusId.length - 4);
let byear = this.value;
let row = this.name.substring(this.name.length - 2);
let bDateElt = form.elements['BDate' + row];
let... | [
"function changeImmYear()\n{\n let form = this.form;\n let censusId = form.Census.value;\n let censusYear = censusId.substring(censusId.length - 4);\n let immyear = this.value;\n if (this.value == '[')\n {\n this.value = '[Blank';\n }\n let res = immyear.match(... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
autoplay the carousel images | function autoplay() {
$('.carousel').carousel('next');
setTimeout(autoplay, 4000);
} | [
"function carouselPlay(){\n clearInterval(carouselStartId);\n carouselStartId = carouselStart(); \n\n TweenMax.to($('.carouselPlay'), 0.2, {x: 20, opacity: 0, scale: 0.3, display: 'none', ease: Power2.easeInOut});\n TweenMax.fromTo($('.carouselPause'), 0.2, {x: -20, opacity: 0, scale: 0.3, display: 'no... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
calcul du salaire net | calcSalaireNet(facture) {
// facture.salaireNet = (facture.nombreHeuresNormales * facture.salaireHoraireNormal + facture.nombreHeuresMajorees * facture.salaireHoraireNormal * (1 + ((facture.taux_majore) / 100))).toFixed(2)
// console.log('calc salaire net ' + facture.salaireNet)
return (facture.nombreHeures... | [
"getNetEnergy() {\n return this.maxEnergy - this.fatigue\n }",
"calcNettoPayment() {\n if (elements.ageInputWork.checked) {\n this.calcTax();\n this.netAmount = this.payment - this.PIT;\n } else {\n this.netAmountUnderAge = this.payment;\n }\n }",
"function calcularTotalComprobacion... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Change type in the NewGridObj based on user selection of a col/row type We don't need dim since only one dimension can have types (in typesInDim) | function changeType(sel_obj, ind, htmlId) {
if (!htmlId) { // while configuring a new grid
NewGridObj.dataTypes[ind] = parseInt(sel_obj.value);
} else {
var gridId = getGridIdOfHtmlId(htmlId); // find grid id from step
var gO = CurFuncObj.allGrids[gridId]; // get grid obj from func
... | [
"function changeDimHasTypes(dim, state) {\r\n\r\n var gO = NewGridObj;\r\n\r\n if (state)\r\n gO.typesInDim = dim;\r\n else\r\n gO.typesInDim = -1;\r\n\r\n reDrawConfig();\r\n\r\n}",
"set_col(col, type) {\n this.df = this.df.map(x => {\n switch (type) {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns a version of the given pattern with params interpolated. Throws if there is a dynamic segment of the pattern for which there is no param. | function formatPattern(pattern, params) {
params = params || {};
var _compilePattern3 = compilePattern(pattern),
tokens = _compilePattern3.tokens;
var parenCount = 0,
pathname = '',
splatIndex = 0,
parenHistory = [];
var token = void 0,
paramName = void 0,
paramValue = voi... | [
"function replace(format, params) {\n /*jslint unparam: true */\n return format.replace(/\\{([a-zA-Z]+)\\}/g, function (s, key) {\n return (typeof params[key] === 'undefined') ? '' : params[key];\n });\n }",
"match(path, params={}) {\n params.router = this;\n params.route = ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Whether the two envs represent the same environment | function sameEnv(env1, env2) {
return sameEnvDimension(env1.region, env2.region)
&& sameEnvDimension(env1.account, env2.account);
} | [
"static areEnvsDifferent(envModelA, envModelB) {\n const sortEnv = env => {\n env.files = _ramda().default.sortBy(_ramda().default.prop('name'), env.files);\n env.config = (0, _utils().sortObject)(env.config);\n const result = (0, _utils().sortObject)(env);\n return result;\n };\n\n con... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
END of mpowerRequestForChart Chart Generation Function | function mPowerChartGeneration(obj) {
//All Variable Declaration
var height, filtering, divId, chartType, stackLabelEnabled, plotColumnDatalabelEnabled, stackLabelEnabled, chart_title, colorByPoint, colors, stacking, new_yAxis, legend_enabled, dataLabel, tooltip_text;
var yAxis1_title, yAxis2_title, calcu... | [
"function generateCharts () {\n\tgenerateTemperatureChart();\n\tgenerateQPFChart();\n\tgenerateDailyWeatherChart($('#weatherChartDays'), 1, 7); //Also reused by zone available water\n\tgenerateProgramsChart();\n\tbindChartsSyncToolTipEvents();\n}",
"function createChart(element_selector, params)\n{\n title_pos... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns a random number between 1 and 3. This represents a move by the computer. | function randomMove() {
return Math.round(Math.random()*3) + 1;
} | [
"function generateMove() {\n var nextMove = Math.floor(Math.random() * 4);\n sequence.push(nextMove);\n }",
"function inning(){\n return (Math.floor(Math.random()*3));\n\n}",
"function randomMove() {\n\t\tvar availTiles = emptyTiles(board);\n\t\trandom = Math.floor( Math.random() * availTiles.length );\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Check to see if the letter for the current tile and letterinword position is part of a valid word | function checkLetterInWordTree(wordTreeNode, tileLetter, strWorkString, wordLen)
{
var isLetterPartOfWord = false;
// Is the current letter present at the current location in the word tree?
if ( wordTreeNode.hasOwnProperty( tileLetter ) )
{
// Append current tile letter to the working string
... | [
"function checkBoardTile(cx, cy, wordTreeNode, wordLen, strWorkString)\n{\n var tileLetter\n\n wordLen++;\n if (wordLen > maxWordLen) return;\n\n // Flag current tile as occupied\n boardTileUsed[cx][cy] = wordLen;\n\n // Read letter for current tile\n tileLetter = boardTiles[cx][cy];\n\n // ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
FormPermisos::Guardar Guarda el nombre del permisos | function Guardar() {
$.post("ajax/AgregarPermisos.php", {
sName: sInputName.val()
}, function(o) {
if (o.Tupla > 0) {
sInputName.val("");
objMangoMensaje.MensajeExito(o.sMensaje);
objMangoTabla.CargaTabla();
... | [
"function fGuardar(){\n if(fValidaTodo()==true){\n if(fNavega()==true){\n //FRMPanel.fSetTraStatus(\"UpdateComplete\");\n fDisabled(true);\n FRMListado.fSetDisabled(false);\n }\n }\n }",
"function guardarPelicula(e) {\n e.preventDefault();\n const formulario = ne... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Colors in the game table coords | function colorGameCells(coords, color) {
colorCells(coords, color, 'cell');
} | [
"function showColors(player){\n var other = (player + 1) % 2;\n var table1 = document.getElementById(\"top_table\");\n for(var i = 0; i < redTiles[other].length; i++){\n var loc = redTiles[other][i]; //Set any relevant tiles to red\n table1.rows[loc[0]].cells[loc[1]].style.backgroundColor = '... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
The returned function will accept whatever arguments the passedin function accepts and return an object with a date key whose value is today's date (not including the time) represented as a humanreadable string (see the Date object for conversion methods), and an output key that contains the result from invoking the pa... | function dateStamp(func){
const cb = func;
return function(...args){
const obj = {}
const output = cb(...args);
const today = new Date().toDateString();
obj['date'] = today;
obj['output'] = output;
return obj;
}
} | [
"function dateWriter(year, month, day) {\n \n var date1 = new Date().toDateString();\n ; return date1;\n /*\n ;Output of above code is: Today's date is Sat Jun 02 2018\n ;close but doesn't pass in values and cannot get rid of Sat\n */\n // new Date().toLocaleDateString();\n // return Date... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Format and print buckets as they are observed | function formatBuckets (buckets) {
const c = require('@buzuli/color')
const regionDecor = c.pool()
const formatBucket = ({ bucket, region, created }) => {
const dateStr = created.format('YYYY-MM-DD')
const timeStr = c.grey(created.format('HH:mm:ss'))
const regionStr = regionDecor(region)
const bu... | [
"print() {\n console.log(this.ranges.map(range => `[${range.toString()})`).join(' '))\n }",
"function createTagBuckets( tagList ) {\n function SortByTagCount(a,b) { return b.tag_count - a.tag_count; }\n\n $.each( tagList, function(idx,tag){\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Function to draw vertical line set Vertical/Voltage Path attributes | function setVerticalPathData(pathEl, x1, x2, y1, y2, adjustment) {
// x coordinate is fixed for vertical line, considering x1 i.e. start x as fixed x coordinate throught the line
var fixed_x = x1;
// x2 is to decide in which quadrant line is being drawn so as to flip the beveled shap... | [
"function LineOrVertical(line, x) {\n this.vertical = (line === null);\n if (this.vertical) {\n this.x = x;\n } else {\n this.m = line.m;\n this.c = line.c;\n }\n}",
"function draw_lines(container, PreviousPos, CurrentPos, draw_dummy_lines, allow_horizontal, allow_vertical) {\n\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Allow the user to set the port through a swal2 popup. | function setPort(event) {
(async () => {
let port = await getPort(event.currentTarget.dataset.id);
if(!port) return;
if(port.length > 4){
port = port.substring(0, 3) + '...'
Swal.fire("Ports larger than 4 characters will be truncated!")
}
pluginModule.project.plugins[store.getState().... | [
"function setPort(args) {\n\tSETTINGS.PORT = parseInt(args.next()) || SETTINGS.PORT\n}",
"static set popup(value) {}",
"function bestimmePort() {\n\t// options.port ist das uebergebene Kommandozeilenargument\n\tusedPort = Number(options.port);\n\n\tif (!isNaN(usedPort) && usedPort > 1024 && usedPort < 65535) {\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
A wrapper function that makes the XMLCclRequest call to ADM_ADAPTER_CCL_DRIVER to Get Adm Domain Type and examines the reply status before determining how to handle the reply. | function GetAdmDomainTypeCCLRequestWrapper(criterion) {
var adm_domain_type = "UNDEFINED";
var sendAr= [];
var get_adm_domain_type_by_encounter_id_request = new Object();
get_adm_domain_type_by_encounter_id_request.qualifiers = new Object();
get_adm_domain_type_by_encounter_id_request.qualifiers.e... | [
"function domainType(domains) {\n return domains.map((domain) => {\n if (domain.includes('com')) {\n return 'commercial';\n }\n\n if (domain.includes('org')) {\n return 'organization';\n }\n\n if (domain.includes('net')) {\n return 'network';\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
load configurations from file | function loadConfig() {
config_file = fs.readFileSync("./config.json");
config = JSON.parse(config_file);
} | [
"async load() {\n await this.ensureExists();\n this.conf = await fs.readJSON(this.location);\n }",
"function configsLoad(pth) {\n return pth.split(';').map(p => configLoad(p));\n}",
"function getConfiguration () {\n var files = path.join(process.cwd(), 'test/conf')\n var def_conf = files + '... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Disconnect the collection from its graph (i.e parents). Note: It has nothing to do with persistance | disconnect() {
var parents = this.parents();
for (var object of parents.keys()) {
var path = parents.get(object);
object.unset(path);
}
return this;
} | [
"delete() {\n\t\t// Remove all edge relate to vertex\n\t\tthis.vertexMgmt.edgeMgmt.removeAllEdgeConnectToVertex(this)\n\n\t\t// Remove from DOM\n\t\td3.select(`#${this.id}`).remove()\n\t\t// Remove from data container\n\t\t_.remove(this.dataContainer.vertex, (e) => {\n\t\t\treturn e.id === this.id\n\t\t})\n\t}",
... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Used for initializing the positions of the tanks | function positionTanks() {
var divisionSize = stageXblocks / playerTanks.length;
for (var i in playerTanks) {
var xPosition = (i * divisionSize) + (divisionSize / 2);
xPosition = (xPosition <= stageXblocks / 2) ? Math.floor(xPosition) : Math.ceil(xPosition);
playerTanks[i].x = xPosi... | [
"randomInitTile() {\n let randX = this.getRandomInt()\n let randY = this.getRandomInt()\n while (this.isOccupied(randX, randY)) {\n randX = this.getRandomInt();\n randY = this.getRandomInt();\n }\n this.board[randY][randX] = 2;\n this.append(randX, ran... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Enforces a style recalculation of a DOM element by computing its styles. | function enforceStyleRecalculation(element) {
// Enforce a style recalculation by calling `getComputedStyle` and accessing any property.
// Calling `getPropertyValue` is important to let optimizers know that this is not a noop.
// See: https://gist.github.com/paulirish/5d52fb081b3570c81e3a
... | [
"function reinjectStyles() {\n if (!styleElements) {\n orphanCheck();\n return;\n }\n ROOT = document.documentElement;\n docRootObserver.stop();\n const imported = [];\n for (const [id, el] of styleElements.entries()) {\n const copy = document.importNode(el, true);... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
cs_compare_datums() / The function Convert_Geodetic_To_Geocentric converts geodetic coordinates (latitude, longitude, and height) to geocentric coordinates (X, Y, Z), according to the current ellipsoid parameters. Latitude : Geodetic latitude in radians (input) Longitude : Geodetic longitude in radians (input) Height :... | function geodeticToGeocentric(p, es, a) {
var Longitude = p.x;
var Latitude = p.y;
var Height = p.z ? p.z : 0; //Z value not always supplied
var Rn; /* Earth radius at location */
var Sin_Lat; /* Math.sin(Latitude) */
var Sin2_Lat; /* Square of Math.sin(Latitude) */
var Cos_Lat; /* Math.cos(Latitu... | [
"function ToLL(north,east,utmZone)\n{ \n // This is the lambda knot value in the reference\n var LngOrigin = DegToRad(utmZone * 6 - 183)\n\n // The following set of class constants define characteristics of the\n // ellipsoid, as defined my the WGS84 datum. These values need to be\n // changed if a different ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Language: HTTP Description: HTTP request and response headers with automatic body highlighting | function http(hljs) {
const VERSION = 'HTTP/(2|1\\.[01])';
const HEADER_NAME = /[A-Za-z][A-Za-z0-9-]*/;
const HEADERS_AND_BODY = [
{
className: 'attribute',
begin: concat('^', HEADER_NAME, '(?=\\:\\s)'),
starts: {
contains: [
{
className: "punctuation",
... | [
"function createResponse(status, body, contentType) {\n\n\t//remember that the response needs a whole empty line between the headers\n\t//and the body \n\treturn `HTTP/1.1 ${status} OK\\r\\nContent-Type: `+ contentType +`\\r\\n\\r\\n${body}`;\n\n}",
"_debugResponse(uri, status, body) {\n if (this.debugResponse... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Reset the state machine to the uninitialized state The function will set the state machine to the uninitialized state, keep all defined hanlders, and cancel the pending promise if there is one. | function reset() {
current(uninitState);
target(uninitState);
// promise already set as null if it is cancelled or resolved
if (promise)
cancel(Utils.Exception('Reset'));
task = null;
... | [
"reset() {\r\n\t\tthis.changeState(this.initial);\r\n\t}",
"reset() {\n\t\tclearInterval(this.timer);\n\t\tthis.setState(this.initialState);\n\t}",
"reset() {\n\t\tthis.ready = false;\n\t\tthis.states = [];\n\t\tthis.battles = [];\n\t\tthis.fighters = [];\n\t}",
"async resetState() {\n const resetMenuL... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get the current tab and call a callback | function getCurrentTab(callback) {
var queryInfo = {
active: true,
currentWindow: true
};
chrome.tabs.query(queryInfo, function(tabs) {
callback(tabs[0]);
});
} | [
"function getOptionsCurentTab(callback) {\r\n BRW_TabsGetCurrentID(function (tabID) {\r\n optionsTabId = tabID;\r\n callback();\r\n });\r\n}",
"function getCurrentTabId(callback) {\n chrome.tabs.query({active: true, currentWindow: true}, function(tabs) {\n callback(tabs[0].id);\n });\n}",... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Removes the given key and any associated values. Normalizes the key. | remove(key) {
key = normalizeKey(key);
// validate(key);
this.internalRepr.delete(key);
} | [
"unset(key = null) {\n // If only argument is an Array, iterate it as array of keys to remove\n if (key instanceof Array) {\n const keys = key;\n\n for (const key of keys) {\n // Delete prop by key\n DotProp.delete(this.__data, key);\n this.__updates.add(key);\n }\n\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Function adds comments table to comment container | function addCommentTable(postId) {
var commentTable = $("<table class ='commentTable' "
+ "id = 'commentsForPost_" + postId + "'"
+ "cellspacing ='0px' "
+ "cellpadding ='4px' width = '100%'>");
... | [
"createCommentsTable() {\r\n const sql = `\r\n CREATE TABLE IF NOT EXISTS comments (\r\n CommentID integer primary key,\r\n comment text,\r\n time integer,\r\n date integer,\r\n is_Admin integer)`\r\n return this.DB.... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
shown if any inline could not be saved | function show_inline_error() {
var err = {};
err[that.form.entity_name] = {
__all__: ["Some " + that.form.inline.entity + " (in red below) could not be saved. To correct errors and try saving them again - go to list page and edit this " + that.form.entity_name]
... | [
"function editSubmitButtonWarning() {\n\n const hasWordWarning = $('p.word-warning').is(':visible');\n const hasSentenceWarning = $('p.sentence-warning').is(':visible');\n const hasTranslationWarning = $('p.translation-warning').is(':visible');\n\n const hasNoSynonyms = $('input.english-... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Expand all box rules | function boxific_expand_all(){
$('.boxific-rule').each(function(){
var rule = $(this);
var collapsed = rule.find('.boxific-rule-collapsed');
var fieldset = rule.find('fieldset');
collapsed.hide();
fieldset.show();
rule.removeClass('collapsed');
});
} | [
"function boxific_collapse_all(){\n\t\n\t$('.boxific-rule').each(function(){\n\t\tvar rule = $(this);\n\t\tvar collapsed = rule.find('.boxific-rule-collapsed');\n\t\tvar fieldset = rule.find('fieldset');\n\n\t\tcollapsed.show();\n\t\tfieldset.hide();\n\t\trule.addClass('collapsed');\n\t});\n\t\n}",
"function bord... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Function is to add voice task request | function addVoiceTaskRequest(req, res) {
var timestamp = Number(new Date()); // current time as number
var file = req.swagger.params.audiofile.value;
var userId = req.swagger.params.userId.value;
var splitFileName = file.originalname.split('.');
var ext = splitFileName[splitFileName.length - 1].toLo... | [
"function call_control_speak(f_call_control_id, f_tts_text) {\n\n var cc_action = 'speak'\n\n var options = {\n url: 'https://api.telnyx.com/calls/' +\n f_call_control_id +\n '/actions/' +\n cc_action,\n auth: {\n username: f_telnyx_api_key_v1,\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Write a binary function minb that takes two numbers and returns the smaller one | function minb(a, b) {
if (a < b) return a;
return b;
} | [
"function min(num1,num2){\n return Math.min(num1,num2)\n}",
"function min(a, b){\n if (a === null) a = 0;\n if (b === null) b = 0;\n if (isNaN(a) || isNaN(b)) return NaN;\n \n return a < b ? a : b;\n}",
"function min_1(x, y) /* (x : double, y : double) -> double */ {\n return ((x <= y)) ? x : y;\n}",
... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
return node element BoundingClientRect | function getBoundRect(node) {
node = getNode(node);
if (node === window) {
node = getDocumentNode();
}
var rect = node.getBoundingClientRect();
return rect;
} | [
"static childBounds(svgElement) {\n var result \n svgElement.childNodes.forEach(ea => {\n var r = ea.getBoundingClientRect() \n var b = rect(r.x, r.y, r.width, r.height)\n result = (result || b).union(b)\n })\n return result\n }",
"function getFirstVisibleRect(element) {\n // ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Update the queue config | updateConfig() {
this.maxBatchSizeBytes = config.getConfig().maxBatchSizeBytes;
this.batchSize = config.getConfig().batchSize;
this.maxQueueSizeBytes = config.getConfig().maxQueueSizeBytes;
} | [
"async editQueue(queue) {\n await fetchData.editQueue(queue)\n }",
"__resend_configuration_request() {\r\n // if we received all the pending configurations, clear the scheduled job\r\n if (this.pending_configurations.length == 0) {\r\n clearInterval(this.pending_configurations_job)\r\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Fills out a list of songs within an album view. | function populateSongs (songs, list) {
for (var song of songs) {
var songTemplate = importTemplate('album-song-template');
songTemplate.querySelector('.song-name').textContent = song.name;
songTemplate.querySelector('.album-song').value = song.number;
var addButton = songTemplate.querySelector('.add-s... | [
"function populateAlbums (albums, list) {\n\n\t\tfor (var album of albums) {\n\n\t\t\tvar albumTemplate = importTemplate('artist-album-template');\n\n\t\t\tvar albumName = albumTemplate.querySelector('.artist-album-name');\n\t\t\talbumName.textContent = album.name;\n\n\t\t\tvar viewAlbum = emitEvent('view-album', a... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Remove token from Axios configuration | clearToken() {
delete this.axios.defaults.headers.common.Authorization;
if (this.isBrowser()) {
if (this.storeConfig.localStorage) {
window.localStorage.removeItem(this.storeConfig.localStorage.key);
}
if (this.storeConfig.cookie) {
Coo... | [
"function logout() {\n window.localStorage.removeItem(\"authToken\");\n delete axios.defaults.headers[\"Authorization\"];\n}",
"function setAxiosToken(token) {\n axios.defaults.headers[\"Authorization\"] = \"Bearer \" + token;\n}",
"removeToken() {\n Cookies.remove(TOKEN_KEY);\n }",
"function _re... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get Freelancer By ID | function GetFreelancerById(id) {
var URL = API_HOST + API_PROFILS_PATH +'/'+id
Axios.get(URL)
.then((response) => response.data);
} | [
"function get(id) {\n return axios.get(MATERIALS_API + \"/\" + id).then(response => response.data)\n}",
"function getDrink( id ) {\n return rp( {\n url: \"http://www.thecocktaildb.com/api/json/v1/1/lookup.php?i=\" + id,\n json: true\n }).then(function (res) {\n return res.drinks[0];\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Parse the audio JSON file. | function parseAudioJson() {
fs.readFile(audioJson, 'utf8', function (err, data) {
if (err) throw err;
let newJson = JSON.parse(data);
if (audio) {
compareJson(audio, newJson);
}
audio = newJson;
});
} | [
"function loadJSON(file) {\n return JSON.parse(FS.readFileSync(file, \"utf8\"));\n}",
"function handleFile(err, data){\n if(err){\n console.log(err);\n }\n\n obj = JSON.parse(data);\n console.log(\"JSON FILE: \"+ obj.main.temp);\n }",
"function loadSong(id){\n var getBuffer = n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This method plots the different points into the element parameter (an SVG object) | function plotPoints(points, diameter, element){
let builtPoints = buildPoints(points, diameter);
for(let i=0;i<builtPoints.length;i++){
builtPoints['dot'] = plotPoint(element, builtPoints[i]['X'], builtPoints[i]['Y']);
}
return builtPoints;
} | [
"display() {\n //set the color\n stroke(this.element*255) ;\n //draw the point\n point(this.identity.x,this.identity.y)\n }",
"function setSize() {\n\tvar svg = document.getElementById('axis-svg')\n\t// use style here, because width seems only a getter for svg\n\tsvg.style.width = (... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Calculate the dot product of all vectors | function calculateDotProduct(vectors){
var dot;
var xdot;
var ydot;
for (let i = 0; i < vectors.length; i++) {
if(i == 0)
{
xdot = vectors[i].x;
ydot = vectors[i].y;
}
else
{
xdot = xdot* vectors[i].x;
ydot = ydot* v... | [
"function dotProduct(vec1, vec2) {\n return vec1[0]*vec2[0] + vec1[1]*vec2[1];\n}",
"function dot(v1, v2) {\n return v1[0]*v2[0] + v1[1]*v2[1];\n}",
"function vmm( x , y )\n {\n\n let i = undefined ;\n let j = undefined ;\n\n for( i = 0; i < x.nv; ++i )\n \n for( j = 0; j < y.nv; ++j )\n\n thi... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
A custom PropTypes validator to make sure that each `control` in the `controls` prop contains the given `propName`, or the `SelectionControlGroup` has defined that prop. | function requiredByAllControls(validator) {
return function validate(props, propName, component) {
for (var _len = arguments.length, others = Array(_len > 3 ? _len - 3 : 0), _key = 3; _key < _len; _key++) {
others[_key - 3] = arguments[_key];
}
var err = validator.apply(undefined, [props, propName,... | [
"function CfnMultiRegionAccessPointPolicyPropsValidator(properties) {\n if (!cdk.canInspect(properties)) {\n return cdk.VALIDATION_SUCCESS;\n }\n const errors = new cdk.ValidationResults();\n if (typeof properties !== 'object') {\n errors.collect(new cdk.ValidationResult('Expected an objec... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Flattens all the given iterables into a single iterable. | flatten(...iterables) {
return (function*() {
for (let iter of iterables) {
for (let item of iter) { yield item; }
}
})();
} | [
"function flattenIterNodes(nodes) {\n var result = []\n for (var i = 0; i < nodes.length; ++i) {\n if (nodes[i]._node.ctorName === \"_iter\") {\n result.push.apply(result, flattenIterNodes(nodes[i].children))\n } else {\n result.push(nodes[i])\n }\n }\n return ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Recognition data for shape input | function ShapeRecognitionData() {
} | [
"shapesToModel() {\n\n let newModel = {'res': [{'index': [], 'freq': [], 'gain': [], 'decay': []}]};\n\n for (var i = 0; i < this.shapes.lines.freq.length; i++)\n newModel.res[i] = this.shapesToResonator (i);\n\n return newModel;\n\n }",
"function convert(sample, dataset) {\n let points = [[], [... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Is Editor excluded when Any Platform is set to true. | GetExcludeEditorFromAnyPlatform() {} | [
"SetExcludeEditorFromAnyPlatform() {}",
"SetExcludeFromAnyPlatform() {}",
"GetExcludeFromAnyPlatform() {}",
"hideEditor() {\n if (this._editor.active) {\n this._editor.active = false;\n\n $('#monaco').hide();\n\n $('#file-tabs-placeholder').show();\n $('#editor-placeholder').show();\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
called when user clicks download plot data button | function download_plot(event)
{
// identify plot to be downloaded
var plot_id = event.data.id;
// get user selection
var curr_sel = selections.filtered_sel();
// make sure something is selected
if (curr_sel.length == 0) {
dialog.ajax_error("There are no plots visible. Please make ... | [
"downloadData() {\n let domEl = document.createElement('a');\n domEl.id = \"download\";\n domEl.download = this._options.download.filename || \"grapher_data.csv\";\n domEl.href = URL.createObjectURL(new Blob([Grapher.to_csv(this.data)]));\n domEl.click();\n }",
"function plot... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
function to equip weapon | function equipWeapon(person){
if (person.inventory.length > 0 ) {
person.weapon = person.inventory[0]
}
} | [
"function weaponChange(element, player){\n let playerWeapon = player.currentWeapon;\n if(element.hasClass(\"weapon-1\")){\n element.removeClass(\"weapon-1\");\n element.addClass(playerWeapon.className);\n player.currentWeapon = weapons[0];\n weaponDisplay(player);\n getItem.play();\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Register a task to be run by the orchestrator at the appropriate time. Type should be one of 'willSave' or 'didSave'; didSave is the default. The distinction is only present to allow formatting to occur at the appropriate time. willSave callbacks: These callbacks are invoked synchronously in the order they are register... | register (name: string, callback: Callback, type: CallbackKind = 'didSave') {
if (typeof callback !== 'function') {
throw new Error('callback must be a function')
}
if (type !== 'didSave' && type !== 'willSave') {
throw new Error('type must be a willSave or didSave')
}
if (type === 'will... | [
"function registerCallback(type, func) {\n if( callbacks.hasOwnProperty(type) == false ) {\n callbacks[type] = [];\n }\n callbacks[type].push(func);\n }",
"function save_task(doc, db, cb) {\n //store new data to our mLab DB\n db\n .collection('Tasks')\n .insertOne(doc, f... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Create a require function for the given requirer. If no requirer is given, create a require function for toplevel modules instead. | function createRequire(requirer) {
return function require(id) {
// Make sure an id was passed.
if (id === undefined) {
throw new Error("can't require module without id!");
}
// Built-in modules are cached by id rather than URL, so try to find the
// module to be required by i... | [
"require(path) {\n assert(path, 'missing path');\n assert(typeof path === 'string', 'path must be a string');\n return Module._load(path, this, /* isMain */ false);\n }",
"function getModuleByID(id, requireIfNotExists, req = require) {\n if (id === '.') {\n return getMainModule(id);\n }\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
All men are mortal Socrates is a man. Therefore, socrates is mortal. | function man(name) {
this.name = name;
this.isMortal = true; //All men are mortal
} | [
"brotherinlaw(person) {\n if (person.gender === 'male') {\n var spouse = person.ismanof;\n var brother = this.brothers(spouse);\n var sisters = this.sisters(person);\n if (sisters.length > 0) {\n sisters.forEach(function (sis) {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
( 'while' | 'until' ) CONDITION ('when' GUARD)? 'then' BODY ( 'while' | 'until' ) CONDITION ('when' GUARD)? NEWLINE INDENT BODY | patchAsStatement() {
if (this.body && !this.body.inline()) {
this.body.setIndent(this.getLoopBodyIndent());
}
// `until a` → `while a`
// ^^^^^ ^^^^^
let whileToken = this.sourceTokenAtIndex(this.getWhileTokenIndex());
this.overwrite(whileToken.start, whileToken.end, 'while');
... | [
"enterIfThenStatement(ctx) {\n\t}",
"enterIfThenElseStatement(ctx) {\n\t}",
"enterWhileStatementNoShortIf(ctx) {\n\t}",
"enterWhileExpression(ctx) {\n\t}",
"function evaluate_while_statement(stmt,env) {\n if (is_true(evaluate(while_predicate(stmt),env))) {\n evaluate(while_statements(stmt),env);\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This script contains code to automate some common user stage update functionality Funnel Take users in different stages and funnel all of them into one stage Params stages array of all stages to be funneled stageUpdate new stage to funnel all the users | function funnel(stages, stageUpdate){
connectToDb()
.then(() => createOrQueries(stages))
.then(queries => executeUpdate(queries, stageUpdate))
.then(success)
.catch(failure)
function createOrQueries(stages){
return stages.map(stage => {
return { stage }
})
}
function executeUpdate(queries){
retu... | [
"function updateData() {\n var pipelineSteps = {};\n if ($scope.buildConfigs && $scope.builds && $scope.deploymentConfigs) {\n Kubernetes.enrichBuildConfigs($scope.buildConfigs, $scope.builds);\n $scope.fetched = true;\n angular.... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Checks a given node against matching projection slots and returns the determined slot index. Returns "null" if no slot matched the given node. This function takes into account the parsed ngProjectAs selector from the node's attributes. If present, it will check whether the ngProjectAs selector matches any of the projec... | function matchingProjectionSlotIndex(tNode, projectionSlots) {
var wildcardNgContentIndex = null;
var ngProjectAsAttrVal = getProjectAsAttrValue(tNode);
for (var i = 0; i < projectionSlots.length; i++) {
var slotValue = projectionSlots[i];
// The last wildcard projection slot should match al... | [
"elementFromNode(node) {\n let part = this.nodes2parts[node.uuid];\n // one of many hacks to handle circular constructs, this returns the ID for the initial block\n // which we assume is the circular block itself when given the id for the end cap.\n if (part === Layout.backboneEndCapId) {\n invaria... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Carries location search from start page to map page. Resizes the map on page show, resets the center, and fires the data toggler. | function startButtonClick() {
if($("#pac-input-intro").val() != "") {
$("#pac-input").val($("#pac-input-intro").val());
}
// Resize the map to page once the new page has finished loading.
$(document).on("pageshow", function(e, d) {
var center = g_map.getCenter();
google.maps.event.trigger(g_map, 'resize');
... | [
"function updateMap() {\n\tif (myKeyWords == \"\") {\n\t\tfor (var i = 0; i < MAX_K; i++){\n\t\t\tkNearMarkers[i].setVisible(false);\n\t\t}\n\t\treturn ;\n\t}\n\t$.post(\"/search/\", {\n\t\tuserPos:myMarker.getPosition().toUrlValue(),\n\t\tkeyWords:myKeyWords,\n\t}, function(data, status){\n\t\t/* Cancel all the ol... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Metodo encargado de definir los segmentos que componen un digito y a partir de los segmentos adicionar la representacion del digito a la matriz | function adicionarDigito(numero) {
self.numero = parseInt(numero)
// Array para almacenar los segmentos de cada numero.
var segList = [];
switch (self.numero) {
case 1:
segList.push(3, 4);
break;
case 2:
segList.push... | [
"function TinySegmenter() {\n var patterns = {\n \"[一二三四五六七八九十百千万億兆]\":\"M\",\n \"[一-龠々〆ヵヶ]\":\"H\",\n \"[ぁ-ん]\":\"I\",\n \"[ァ-ヴーア-ン゙ー]\":\"K\",\n \"[a-zA-Za-zA-Z]\":\"A\",\n \"[0-90-9]\":\"N\"\n }\n this.chartype_ = [];\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Convert Angular Span to TypeScript TextSpan. Angular Span has 'start' and 'end' whereas TS TextSpan has 'start' and 'length'. | function ngSpanToTsTextSpan(span) {
return {
start: span.start,
length: span.end - span.start,
};
} | [
"function createRangeToSpan(span) {\n const { textNode, start, end } = getRenderingPosition(span)\n\n if (!textNode) {\n throw new Error(\n `The textNode on to create a span is not found. ${span.id}`\n )\n }\n\n if (start < 0) {\n throw new Error(`start must be posi... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Step 2: Find cheapest date to travel to each of the destinations | function getCheapestFlightToAllDestinations(destinationCode, callback) {
console.log('dest code' + destinationCode);
var minPrice = 99999.9;
var leg = null;
var iter = 0;
var depIndex = -1;
var offerLegs = null;
var legs = [];
var bestData = null;
for(var j=0;j<departureDateArray.length; j++) {
va... | [
"function combineSearch(tp1, tp2) {\n return tp1.map(travelPlan => {\n let arrival = new Date(travelPlan.legs[travelPlan.legs.length - 1].arrival)\n let bestWaitTime = Infinity\n let bestTravelPlan2 = tp2[0]\n // Find the most appropriate corresponding second travel plan.\n for (let i = 0; i < tp2.l... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
addListener to change display where it is mobile and put containerMixwhere fruits are waiting to be mixed to the other place | function test_match(){
var mW = window.matchMedia("(max-width: 600px)");
mW.addListener(WidthChange);
WidthChange(mW);
function WidthChange(mW){
if(mW.matches){
var containerMix = $(".container-glass-items").detach();
$(".container-fruits").find(".container-move-btn").before(conta... | [
"toggleAppContainer(){\n const showing = !this.state.showAppContainer;\n this.setState({ showAppContainer: showing, showContainer:false });\n\n if(showing){\n events.onCentralizerAppsOpen(this.state);//HOOK\n }else{\n events.onCentralizerAppsClose(this.state);//HOOK... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Creates the enemies that are present when the level loads Always create at least one enemy and possibly up to one more per row | createInitialEnemies() {
this.enemies = [];
this.checkEnemyCreation(1000);
for (let i = 0; i < this.level.numEnemyRows - 1; ++i) this.checkEnemyCreation(2);
} | [
"checkEnemyCreation(dt) {\n if (Math.random() < dt * this.level.enemyFrequency * this.level.stoneRows) {\n // only create enemies in stone rows\n const row = Math.floor(Math.random() * this.level.stoneRows + this.level.waterRows);\n const speed = Math.floor(Math.random() * (t... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
function which check if the current user has the right write on the project | static hasRightToWrite(){
var idProject = Router.current().params._id
var project = Projects.findOne(idProject)
if(!project){
return false;
}
var username = Meteor.user().username
var participant = $(project.participants).filter(function(i,p){
return p.username == username && p.right... | [
"function restrictedToEditors(lesson,req,res){\n if ( lesson.editors.includes(req.user.id) ) return false;\n res.status(401).json({message: \"Access Denied\"});\n return true;\n}",
"grantWriteAccess () {\n\n\t\t\tlet clientId = appConfig.auth[process.env.NODE_ENV === 'production' ? 'prod' : 'dev'],\n\t\t... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
get cumulative list of all the permission records associated given group and key | function getPermissionsForGroup(group, groupname, key, type, rawquery, callback) {
getgroupsrecursive(groupname, type, [], function (err, res) {
var matchingGroups = res;
var permissionsList = [];
var query = {};
if (rawquery) {
query = rawquery;
} else {
... | [
"getCommandsByGroup() {\n const groupsToCommand = {\n \"movement\": [],\n \"editing\": [],\n \"selection\": [],\n \"tabs\": [],\n \"formatting\": [],\n \"other\": [],\n };\n\n for (const [key, command] of Object.entries(Commands.commands)) {\n groupsToCommand[command.grou... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
If a markArea has one dim | function ifMarkLineHasOnlyDim(dimIndex, fromCoord, toCoord, coordSys) {
var otherDimIndex = 1 - dimIndex;
return isInifinity(fromCoord[otherDimIndex]) && isInifinity(toCoord[otherDimIndex]);
} | [
"isAreaEmpty(x, y, width, height) {\r\n return this.engine.isAreaEmpty(x, y, width, height);\r\n }",
"function markModel(markMode, rectangle) {\n\n\n\n}",
"get area() { return this.height * this.width; }",
"contains(x, y) {\r\n if (!this.isEnabled()) return false;\r\n if (x < this.at().x ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns all bracket pairs that intersect the given range. The result is sorted by the start position. | getBracketPairsInRange(range) {
var _a;
this.bracketsRequested = true;
this.updateCache();
return ((_a = this.cache.value) === null || _a === void 0 ? void 0 : _a.object.getBracketPairsInRange(range)) || [];
} | [
"function range(start, end) {\n\tvar startDate = new Date(start);\n\tvar endDate = new Date(end);\n\t// retrieve a subarray of the hour buckets within the hour range\n\tvar slicedBuckets = hourBuckets.slice(startDate.getHours(), endDate.getHours() + 1);\n\tvar result = new Array(0);\n\t// make sure they are within ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Renders a list of currently matched Suggestions | renderSuggestions() {
const { value, matched, showList, selectedIndex } = this.state;
if (!showList || matched.length < 1) {
return null; // Nothing to render
}
return (
<ul className="suggestions">
{matched.map((item, index) => (
<li
key={`item-${item}-${inde... | [
"function displayMatches(){\n const matchArray = findMatches(this.value, cities);\n\n const html = matchArray.map( place => {\n const regex = new RegExp(this.value, 'gi');\n\n const cityName = place.city.replace(regex, `<span class=\"hl\">${this.value}</span>`);\n const stateName = place.state.replace(re... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
The AWS::SecretsManager::SecretTargetAttachment resource completes the final link between a Secrets Manager secret and its associated database. This is required because each has a dependency on the other. No matter which one you create first, the other doesn't exist yet. To resolve this, you must create the resources i... | function SecretTargetAttachment(props) {
return __assign({ Type: 'AWS::SecretsManager::SecretTargetAttachment' }, props);
} | [
"function Secret(props) {\n return __assign({ Type: 'AWS::SecretsManager::Secret' }, props);\n }",
"function AssessmentTarget(props) {\n return __assign({ Type: 'AWS::Inspector::AssessmentTarget' }, props);\n }",
"toDescriptor() {\n return {\n apiVersion: 'v... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
_element Return the closest dom element | function _element(node) {
// Return the closest dom element
return node.nodeType == 1 ? node : node.parentNode;
} | [
"function get_element_from_event (event, element_type) {\n\t\tvar target = $(event.target);\n\t\tvar element = null;\n\n\t\tif(target.is(element_type)) {\n\t\t\telement = target;\n\t\t} else if(target.parent(element_type).length) {\n\t\t\telement = target.parent(element_type+\":first\");\n\t\t}\n\n\t\treturn elemen... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Handle a dropdown selection. Calls the onSelect property function with the selectedCountry currency. | _handleDropdown(event) {
if(this.props.hasOwnProperty('onSelect') && typeof this.props.onSelect === 'function') {
this.props.onSelect(event, country2currency[event]);
}
} | [
"function countryChange() {\n country = document.getElementById(countryName + \"-select\").value;\n updateData();\n }",
"function handleCountrySelect(clickObject) {\n if (selectedCountry) { //case: country is selected\n if (selectedCountry.toLowerCase() === clickObject.target.feature.pr... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
The AWS::ApiGateway::RestApi resource contains a collection of Amazon API Gateway resources and methods that can be invoked through HTTPS endpoints. For more information, see restapi:create in the Amazon API Gateway REST API Reference. Documentation: | function RestApi(props) {
return __assign({ Type: 'AWS::ApiGateway::RestApi' }, props);
} | [
"function createApi(opts){\n var deferred = Q.defer(),\n params = {\n name : opts.name,\n description : opts.description\n };\n\n apigateway.createRestApi(params, function(err, data) {\n if (err) deferred.reject(err);\n else deferred.resolve(data);\n }... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
LONG TEXT ////////////////////////////////////////////////////////////////////////////// the renderer for long text element. | function LongtextElementRenderer() {
} | [
"function ShowExampleAppLongText(p_open) {\r\n SetNextWindowSize(new ImVec2(520, 600), ImGuiCond.FirstUseEver);\r\n if (!Begin(\"Example: Long text display\", p_open)) {\r\n End();\r\n return;\r\n }\r\n /* static */ const test_type = STATIC(\"test_type\", 0);\r\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Itterate through DOM nodes typing | function typeNodes(node) {
//console.log(node);
if (node === null) {
if (typed.length === 1) {
return;
}
//
var parent = typed.pop().parentElement;
typed.peek().appendChild(parent);
typed.peek().parentElement.insertBefore(cursor, typed.peek().nextSibling);
typeNodes(cursor.nextSibling);
... | [
"_processNodes(){\n this.shadowRoot\n .querySelector('slot')\n .assignedNodes()\n .forEach((n) => this._processNode(n));\n }",
"function fetchTags(xmlDoc,nodeType)\n {\n var node = xmlDoc.documentElement;\n var nodes = node.querySelectorAll(\"*\");\n var childrenNodes =[... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This function is used to join a conversation. conversationId is the id of the conversation which should be joined role is the role of the agent (AGENT, MANAGER) | async joinConversation(conversationId, role = 'AGENT') {
if (!this.isConnected) return;
return await this.myAgent.updateConversationField({
'conversationId': conversationId,
'conversationField': [{
'field': 'ParticipantsChange',
'type': 'ADD',
... | [
"function JoinCommand(channelName) { \r\n var voiceChannel = GetChannelByName(channelName); \r\n \r\n if (voiceChannel) { \r\n voiceChannel.join(); \r\n console.log(\"Joined \" + voiceChannel.name); \r\n } \r\n \r\n return voiceChannel; \r\n }",
"joinPlayerChan... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Given a ISBN10 string with no dashes, convert it to the ISBN13 represented as a string with no dashes. | function convertIsbn10ToIsbn13(isbn10){
// Check if isbn10 is valid
if (!isValidIsbn10(isbn10)){
console.warn(`${isbn10} is not a valid ISBN10 or not expecting dashes in argument`);
return "";
}
let prefix = "978";
let middle = isbn10.substring(0, isbn10.length - 1);
let isbn13 =... | [
"function isbn13to10(isbn13)\n{\n var first9 = (isbn13 + '').slice(3).slice(0, -1);\n var isbn10 = first9 + isbn10_check_digit(first9);\n return isbn10;\n}",
"function parse_ISBN13() {\n\n var prod_details_elms = $('div#detail-bullets table#productDetailsTable div.content ul');\n var isbn_text = $(prod... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
this function gets all users saved on the db and saves them in this.state. users aver getting the response from the backend it also creates a list with all usernames and saves ist in this. state.usernames | getUsers() {
// get the memes from the express server
fetch('http://localhost:3005/users/getUsers')
.then(res => {
return res.json()
})
.then(users => {
this.setState({
users: users.users,
})
... | [
"async function fetchUsers() {\n const response = await fetch('/api/users');\n const json = await response.json();\n\n setUsers(json);\n }",
"async getUsersByNames(userNames) {\n userNames = userNames.map(name => name.toLowerCase());\n const usersData = await this._client.callApi({\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns a new Vector3 set with the result of the normal transformation by the given matrix of the given vector This methods computes transformed normalized direction vectors only (ie. it does not apply translation) | static TransformNormal(vector, transformation) {
const result = Vector3.Zero();
Vector3.TransformNormalToRef(vector, transformation, result);
return result;
} | [
"static Normalize(vector) {\n const result = Vector3.Zero();\n Vector3.NormalizeToRef(vector, result);\n return result;\n }",
"static Normalize(vector) {\n const result = Vector4.Zero();\n Vector4.NormalizeToRef(vector, result);\n return result;\n }"... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Creates a parts array for a relName where first part is plugin ID, second part is resource ID. Assumes relName has already been normalized. | function makeRelParts(relName) {
return relName ? splitPrefix(relName) : [];
} | [
"function getParams(parts) {\n return parts.split(';').reduce((acc, attribute) => {\n let [key, value] = attribute.trim().split('=');\n key = key.trim();\n\n if (value === undefined || key === 'rel') {\n return acc;\n }\n\n acc[key] = value\n .trim()\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Create a new flowline by selecting center / shear lines | function newFlowline(){
resetFlowline();
flowline.markers[0].enableEdit(map).startDrawing();
} | [
"function hLine(i){\n var x1 = scaleUp(0);\n var x2 = scaleUp(boardSize - 1);\n var y = scaleUp(i); \n drawLine(x1, x2, y, y);\n //alert(\"i:\" + i+ \" x1:\"+x1+ \" x2:\"+x2+\" y1:\"+y+ \" y2:\"+y);\n }",
"shakyLine(x0, y0, x1, y1) {\n // Let $v = (d_x, d_y)$ be a v... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
SMA Tree constructor. This assumes that the "top" contains the objStructureTree. | function smaUITree(topFrame)
{
this.m_tree = (topFrame != undefined && topFrame != null)
? topFrame.objStructureTree : getTopWindow().objStructureTree;
this.m_HiddenFrame = findFrame(getTopWindow(), "hiddenFrame");
this.m_qDebug = false;
if ( this.m_qDebug )
{
console.debug("T... | [
"stackToTree(stack) {\n stack.close()\n return dist_Tree.build({\n buffer: StackBufferCursor.create(stack),\n nodeSet: this.parser.nodeSet,\n topID: this.topTerm,\n maxBufferLength: this.parser.bufferLength,\n reused: this.reused,\n start: this.ran... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Updates the knob position following the currently configured value. Useful on reflows where the dimensions of the slider itself have been modified. | _updateKnobPosition() {
this._setKnobPosition(this._valueToPosition(this.getValue()));
} | [
"updateSeekBar(seekBar, seekBarValue) {\n seekBar.value = seekBarValue;\n \n }",
"_updateHandleAndProgress(newValue) {\n const max = this._effectiveMax;\n const min = this._effectiveMin;\n\n // The progress (completed) percentage of the slider.\n this._progressPercentage = (new... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
return all threads, hide the token | function getAllThreads(req, res) {
return __awaiter(this, void 0, void 0, function* () {
try {
const result = yield Threads_1.default.findAll();
const hidetoken = result.map((value) => {
var _a;
const replies = (_a = value.replies) === null || _a === v... | [
"function _GET_AllThreads() {\n\n $.ajax({\n dataType: \"json\",\n // headers: { \"Authorization\": \"Basic \" + btoa(state.user + \":\" + state.password) },\n url: \"/threads\",\n success: function success(data) {\n state.movieThreads = data.movieThreads;\n saveToStorage(state); // persist\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
render(src, dst, config) Renders templates located in templates directory src is the name of the template; dst is the destination path of the rendered template config is the configuration to be applyed to the template | function render(src, dst, config) {
return swig.renderFileAsync(path.join.apply(path, [
__dirname, "..", "templates", src
]), config)
.then(function(text) {
return fs.writeFileAsync(dst, text);
});
} | [
"function render_tmpl() {\n\n\tvar cache = {};\n\n\tvar compile_template = function (filename) {\n\t\treturn Q\n\t\t\t.fcall(function () {\n\n\t\t\t\tif (cache[filename]) return cache[filename];\n\n\t\t\t\tplugins.util.log('loading template: ' + filename);\n\t\t\t\treturn Q\n\t\t\t\t\t.nfcall(fs.readFile, filename)... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Constructor. Unused states: KeysRounded State holds what was latest key to save object in AsyncStorage, all keys, all items, cost of every category and should view update itself. | constructor(props){
super(props);
this.state = {
lastKey: 0,
keysRounded: false,
keys: [],
fetchedItems: [],
CostsbyCateg: [],
update: false
}
this.eleContainsInArray = this.eleContainsInArray.bind(this);
} | [
"constructor(props) {\r\n\t\tsuper(props)\r\n\r\n var tripInfo = this.props.tripInfo;\r\n var tripDate = new Date(tripInfo.tripDate);\r\n\r\n this.state = {\r\n city: tripInfo.locationID.city,\r\n country: tripInfo.locationID.country,\r\n tripDate: (tripDate.get... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
login to api with facebook token | apiLogin(){
var vm = this;
var response = vm.fbResponse();
// Get our token from the api, posting facebook's accessToken
// to api/auth/facebook/token
var token = (response && response.authResponse && response.authResponse.accessToken) || null;
if(!token){
console.log('No facebook access... | [
"authenticateFacebook(token, create, username, sync, vars, options = {}) {\n const request = {\n \"token\": token,\n \"vars\": vars\n };\n return this.apiClient.authenticateFacebook(this.serverkey, \"\", request, create, username, sync, options).then((apiSession) => {\n return ne... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
MOVE ENCODING 0000 0000 0000 0000 0000 1111 1111 source square 0xFF 0000 0000 0000 1111 1111 0000 0000 target square 0xFF00 0000 0000 1111 0000 0000 0000 0000 source piece 0xF0000 0000 1111 0000 0000 0000 0000 0000 target piece 0xF00000 0001 0000 0000 0000 0000 0000 0000 capture flag 0x1000000 store squares & pieces in... | function encodeMove(sourceSquare, targetSquare, sourcePiece, targetPiece, captureFlag) {
return (sourceSquare) |
(targetSquare << 8) |
(sourcePiece << 16) |
(targetPiece << 20) |
(captureFlag << 24)
} | [
"constructor(/*i*/color, /*s*/move) {\r\n this.color = color;\r\n this.source = move;\r\n var s = move.replace(/\\?|!/g,'');\r\n s = s.replace(/o|0/g,'O');\r\n if (s.substr(0, 5) == 'O-O-O') {\r\n this.castle = 'Q';\r\n this.dest = Coord.fromString(this.color == -1 ? 'c8' : 'c1');\r\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Renders the list of artifact blocks for each artifact in the array returned by the response | artifactBlockList() {
return this.state.artifacts.map((currArtifact, i) => {
return <ArtifactBlock artifactData={currArtifact} key={i} />;
});
} | [
"function showRepositories(repositoriesArray) {\n var print = '<h5> Repositories </h5>'\n \n print += \"<table>\";\n\n //Compose the render with stargazers coun and forks from git\n for(var i = 0; i < repositoriesArray.length; i++) {\n print += '<tr>';\n print += '<td>' + r... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Changes book patron information, and calls addBookToPatronLoans | function loanBookToPatron(e) {
e.preventDefault();
// Get correct book and patron
const bookId = parseInt(document.querySelector('#loanBookId').value)
const cardNumber = parseInt(document.querySelector('#loanCardNum').value)
const patron = patrons[cardNumber]
// Add patron to the book's patron property
const b... | [
"function loanBookToPatron(e) {\n\te.preventDefault();\n\n\t// Get correct book and patron\n\tconst bookId = document.querySelector('#loanBookId').value;\n\tconst cardNumber = document.querySelector('#loanCardNum').value;\n\n\t// Add patron to the book's patron property\n\ttry{\n\t\tif (bookId!=\"\" && cardNumber!=... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Exit a parse tree produced by KotlinParserexplicitDelegation. | exitExplicitDelegation(ctx) {
} | [
"exitAnnotationTypeMemberDeclaration(ctx) {\n\t}",
"exitNormalClassDeclaration(ctx) {\n\t}",
"exitDelegationSpecifier(ctx) {\n\t}",
"exitUnannReferenceType(ctx) {\n\t}",
"exitParenthesizedType(ctx) {\n\t}",
"visitExit_statement(ctx) {\n\t return this.visitChildren(ctx);\n\t}",
"exitMethodDeclarator(ctx... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get the Swar div details from the dragging swar/ box. | function getSwarDivDetails(currentdragEl) {
return currentdragEl.parentNode.previousElementSibling.getBoundingClientRect();
} | [
"function retrieveSwarsFromUI(inputDivCollection) {\n\tvar notation = {};\n\tvar leftSwarDiv;\n\t//inputDivCollection\n\tfor( var i = 0 ; i < inputDivCollection.length; ++i) {\n\t\tnotation[\"inputDiv\"+(i+1)] = {};\n\t\tnotation[\"inputDiv\"+(i+1)].name = inputDivCollection[i].previousElementSibling.textContent;\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Bind, yield Bind a result of an effectful computation to the `next` function. When the effectful computation yielded on operation, we can remember where to continue (namely the `next` function) | function bind( x, next ) {
if (x instanceof Yield) {
const cont = x.cont; // capture locally
x.cont = function(arg) { return bind(cont(arg),next); };
return x;
}
else {
return next(x);
}
} | [
"function next(arg, isErr) {\n // Preventive measure. If we end up here, then there is really something wrong\n if (!mainTask.isRunning) {\n throw new Error('Trying to resume an already finished generator');\n }\n\n try {\n var result = void 0;\n if (isErr) {\n result = iterator.th... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Goes through the contents of message and replaces strings of > 3 spaces with ' 's as long as the spaces don't occur between tags that handle their own formatting such as '[pre]'. | function expand_spaces(message)
{
var exclude_open = new Array("[code]", "[pre]", ":[", ":/");
var exclude_close = new Array("[/code]", "[/pre]", "]:", "/:");
var open, close;
var colon_on = false;
var level = 0;
var store_unformatted = false;
var store_formatted = false;
... | [
"function hue_clean_chat_message(message) {\n\t\treturn message.replace(/\\=?\\[dummy\\-space\\]\\=?/gm, '');\n\t}",
"function normaliseContentEditableHTML(html) {\n html = html.replace(openBreaks, '')\n .replace(breaks, '\\n')\n .replace(allTags, '')\n .replace(newlines, '<br... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
> 1st method of conditional rendering is the if else block we have to define the return statment inside if and else block according to our condition > 2nd approch is by the elements variable just define the variable inside the render method and according to the condition return the message > 3rd approch is by Ternary O... | render() {
// if & else
// if(this.state.isLoggedIn){
// return (
// <div>
// <h1> Hello Manoj </h1>
// </div>
// )
// }
// else{
// return (
// <div>
// <h1> Hell... | [
"function Home() {\n return (\n <div>\n {/* Comment in JSX */}\n <p>Welcome to product store</p>\n <p>number: {10}</p>\n <p> number exp : {10 + 5} </p>\n <p> func call : { add(10, 30)} </p>\n <p>Boolean True {true.toString()} </p>\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Function Declaration to clear wordGuessArea | function wordGuessClear() {
targetWordGuessArea.textContent = "";
censoredWord = [];
} | [
"function resetGame() {\n\tguessesLeftCounter = 5;\n\tguesses = [];\n\tcurrentGuesses = [];\n\t/*get an array of keys from words object and choose a random one*/\n\tvar keysArray = Object.keys(words)\n\trandomWord = keysArray[Math.floor(Math.random() * keysArray.length)];\n\tdocument.getElementById(\"hint\").innerH... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
TreeAddBranch This function adds a new branch to the tree. This function accepts the following params: id: ID of the branch, must be unique. label: text to be used as the branch label type: Application specific type to be used for drag and drop operations | function TreeAddBranch(id, label, type)
{
var tree = this;
var newBranch = new Branch(tree, tree, id, label, type).branch
newBranch = tree.appendChild(newBranch);
tree.branchesById[newBranch.id] = newBranch;
tr... | [
"TreePush(str_id=null)\n {\n let win = this.getCurrentWindow();\n this.Indent();\n win.DC.TreeDepth++;\n this.PushID(str_id ? str_id : \"#TreePush\");\n }",
"function addToBranch(branch, value, key = null, thenCallback = null) {\n let database = firebase.database();\n\n // ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
When the tour button is pressed, goes to the map and launches the tour. | function tourButtonClick() {
startButtonClick();
startIntro();
} | [
"function goToLocation() {\n const coords = [\n [35.9613161, -84.0230739],\n [32.0756302, -96.5312545],\n ];\n const labels = ['Main Office', 'Office II'];\n const btns = [btnView1, btnView2];\n\n // Adds marker and label for each location\n for (let i = 0; i < coords.length; i++) {\n const marker = L.m... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Auto Dump into Looting II | function lootdump() {
viewPortalUpgrades();
numTab(6, true);
if (getPortalUpgradePrice("Looting_II")+game.resources.helium.totalSpentTemp <= game.resources.helium.respecMax){
var before = game.portal.Looting_II.level;
game.global.lockTooltip = true;
buyPortalUpgrade('Looting_II'); ... | [
"function C006_Isolation_Yuki_StealItems() {\t\n\tPlayerSaveAllInventory();\n\tPlayerRemoveAllInventory();\n}",
"function drop_bag(player_obj, contents) {\n\tconsole.log(\"dropping bag\");\n\tif (player_obj.death_bag != null) {\n\t\tvar new_bag = player_obj.death_bag;\n\t\tnew_bag.data.keys = player_obj.inventory... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Check if the serie is part of favorites | isFavorite (serie) {
return this.favorites.find(item => item.id === serie.id)
} | [
"function storyIsFavorite(story) {\n if (currentUser) {\n let favoriteIds = currentUser.favorites.map(story => story.storyId); \n return favoriteIds.includes(story.storyId);\n }\n }",
"function checkForFavs() {\n for(let favStory of $(user.favorites)){\n let favStoryID = favStory.stor... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
return true if the node at the top of the stack (that means the innermost node in the current output) is lexically the first in a statement. | function first_in_statement(stack) {
var node = stack.parent(-1);
for (var i = 0, p; p = stack.parent(i); i++) {
if (p instanceof AST_Statement && p.body === node)
return true;
if ((p instanceof AST_Seq && p.car === node ) ||
(p instanceof AST_Call ... | [
"function atProcedureLevel() {\n return blockStack.length > 0\n && Object.is(blockStack[blockStack.length-1],topBlock);\n }",
"function isStatement(tree) {\n\tif (tree.type === \"FunctionDeclaration\") {\n\t\treturn !!tree.identifier;\n\t}\n\tvar stats = [\n\t\t\"LocalStatement\", \"Assignmen... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |