query stringlengths 9 34k | document stringlengths 8 5.39M | negatives listlengths 19 20 | metadata dict |
|---|---|---|---|
getInput Returns editor's input. | getInput() {
return this.input;
} | [
"getInput() {\n\t\treturn this.textBox.getText();\n\t}",
"get editor() {\n return this._input.editor;\n }",
"_getEditInput() {\n return this.contentEditInput || this.defaultEditInput;\n }",
"get editorWidget() {\n return this._input.editorWidget;\n }",
"get editorDomElement() {... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
todo: split it in 1. building cross dependencies 2. sorting by cross dependencies count | function orderByCrossDeps(options) {
const pkgName = options.map(opt => opt.pkg.name);
return options
.map(option => {
option.cross = [];
constants_1.dependencyKeys.forEach(depKey => {
if (!option.pkg[depKey]) {
return;
}
pkgName.forEac... | [
"toDependencyGraph() {\n return _.map(\n // FIND MAX UNIQUE VERSION FIRST\n _.groupBy(this.allDependencies,\"name\"), versionGroup =>\n versionGroup.reduce((maxVersion, version) =>\n !maxVersion || getValue(() =>\n SemVer.gt(SemVer.coerce(version.version),SemVer.coerce(ma... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
obtengo el blob del pdf | get_pdf(service_end_point, param) {
return axios.get(service_end_point, {
responseType: "blob",
params: param
});
} | [
"toBlob() {\n return new Promise((resolve) => {\n // have to do it this way so that the document flushes everything to buffers\n this.pdf.on('end', () => {\n // convert buffers to a blob\n resolve(\n new Blob(this.buffers, {\n type: 'application/pdf',\n })\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Return selections with resolved named fragments and directives. | function getTransformedSelections(definition, path, gqlType, execContext) {
const {
variables,
} = execContext;
const selectionsMap = definition.selectionSet.selections.reduce((o, sel) => {
if (variables && !shouldInclude(sel, variables)) {
// Skip this entirely
return o;
}
if (sel.k... | [
"function _getFragmentsForSelection(sel, collaborator) {\n let frags = sel.getFragments()\n if (collaborator) {\n frags = frags.map(function(frag) {\n frag.collaborator = collaborator\n return frag\n });\n }\n return frags\n }",
"function extractSelections(te... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Verify the added to the cart from the wishlist is indeed displayed | verifyItemPresent() {
return this.cartItem.isDisplayed().should.be.true;
} | [
"validateAddToCart() {\n return this\n .waitForElementVisible('@addToCartBtn', 10000, () => {}, '[STEP] - \"Add to Cart\" button should be displayed')\n .assert.containsText('@addToCartBtn', 'Add to Cart');\n }",
"verifyProductAddedToWatchlistIsDisplayed() {\n return elementUtil.doGetText(th... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Find all the courses of the student | getStudentCourses(studentid) {
return Boekingen.find({$and:[{Student: studentid},{Academiejaar: currentAcademiejaar }]})
} | [
"function returnCourses(){\n\treturn allCourses\n}",
"async function getStudentCourses(studentId) {\n try {\n const res = await fetch(\"/transcript/courses/viewAll/\" + studentId, {\n method: \"GET\",\n });\n const parseData = await res.json();\n setStuden... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
getItems Function get all the items that needs the shipping price to be set version 1.0.1 adding the type of the item into item search filter | function getItems()
{
//Declaring the local variables
var itemFilters = new Array();
var itemTypes = new Array(); //version 1.0.1
try
{
//version 1.0.1
itemTypes[0] = 'InvtPart';
itemTypes[1] = 'Kit';
itemTypes[2] = 'NonInvtPart';
itemTypes[3] = 'OthCharge';
itemTypes[4] = 'Payment';
... | [
"function getItems(){\n return items\n }",
"function loadItems()\r\n{\r\n\t//Declaring the local variables\r\n\t/*var itemSearch = new Array();\r\n\tvar itemFilters = new Array();\r\n\tvar itemColumns = new Array();\r\n\tvar itemShippingCost = 0.0;*/\r\n\r\n\ttry\r\n\t{\r\n\t\t//var record = nlapiLoadRecord('... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
FUNCTION: toggleSubmitAs DESCRIPTION: toggles the visibility of "Submit As: [menu]" that appears on the UI. This menu is disabled in case of Update form and if it is a primary key column ARGUMENTS: show boolean RETURNS: Nothing | function toggleSubmitAs(bShow)
{
if (bShow)
{
_SubmitAs.enabled();
}
else
{
_SubmitAs.append(" ");
_SubmitAs.disable();
}
} | [
"function toggleSubmitAsVisibility(displayAs){\n var currentVal = MENU_SUBMIT.getValue();\n if ( displayAs != TEXT && (currentVal == \" \" || !currentVal)) { // if any form field is chosen in displayAs menu\n MENU_SUBMIT.enable();\n MENU_SUBMIT.del();\n var submitType = getSubmitTypeFromColumnType(... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Return a Promise for a fetched URI Currently Builds on Data.fetchURI Later add JSON extensions Currently eager but later could be lazy Currently uncached | static promiseURI(theURI, form) {
return new Promise((resolve, reject) => {
var theCB;
theCB = (val, errC, errT, part) => {
if (errC > 0) {
if (typeof lggr.trace === "function") {
lggr.trace(`promiseURI ${theURI} rejecting ${errT}`);
}
return reject(new Error(JSON.stringify([errC, errT, part])));
} else {
if (typeof lg... | [
"load (uri, options) {\n var fetcher = this\n if (Array.isArray(uri)) {\n var ps = uri.map(function (x) {\n return fetcher.load(x)\n })\n return Promise.all(ps)\n }\n uri = uri.uri || uri // NamedNode or URI string\n return new Promise(function (resolve, reject) {\n fetcher... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Disables the "Load Order" button on the welcome section. | function disableLoadOrderButton() {
document.getElementById("welcome_load").disabled = true;
} | [
"function disableNewOrderButton() {\n document.getElementById(\"welcome_new\").disabled = true;\n}",
"function disableAddToOrderComponents() {\n $(PIZZA_ADD_ORDER_BUTTON).attr(HTML_DISABLE, \"\");\n $(PIZZA_AMOUNT_SELECTOR).attr(HTML_DISABLE, \"\");\n}",
"function disable() {\n reload();\n}",
"function en... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Keep scroll at bottom if already there and not focused on a log item | keepBottomScroll() {
if (!this.tree.hasFocus()) {
// Scroll to end unless user is interacting with the list
this.$container.scrollTop(this.$container[0].scrollHeight);
}
} | [
"function gotoBottom() {\n log.scrollTop = log.scrollHeight;\n}",
"function goToBottomOfLog(div) {\r\n\tdiv.scrollTop = div.scrollHeight;\r\n}",
"onScroll_() {\n const list = this.logsList_;\n this.shouldSnapToBottom_ =\n list.scrollTop + list.offsetHeight == list.scrollHeight;\n }",
"scrollToL... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This function makes the closeoutData div visible and projectManager div invisible INNER FUNCTION CALLS: getProjectEnums_CLOSEOUT() | function editCloseout(source_id) {
if (source_id) prepareCloseout(source_id);
document.getElementById('projectManager').style.display = 'none';
EDIT_INTENTION = true;
getProjectEnums_CLOSEOUT(true);
currentDivLocation = 'closeoutData';
document.getElementById('closeoutData').style.display = 'inline';
} | [
"function closeInfo() {\n\tconsole.log(\"close\");\n\t$('#allBlackDiv').css('visibility', 'hidden');\n\t$('#aboutDiv').css('visibility', 'hidden');\n}",
"function closeInterest() {\n interestDiv.style.display = 'none';\n homeView.style.display = 'block';\n information.style.display='block';\n events.style.dis... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
draw flakes onto canvas | function drawFlakes() {
ctx.clearRect(0, 0, W, H);
ctx.fillStyle = '#fff';
ctx.beginPath();
for (var i = 0; i < flakesCount; i++) {
var flake = flakes[i];
ctx.moveTo(flake.x, flake.y);
ctx.arc(flake.x, flake.y, flake.r, 0, Math.PI * 2, true);
}
ctx.fill();
moveFlakes();
} | [
"function drawFlakes() {\n ctx.clearRect(0, 0, widthW, heightH);\n ctx.fillStyle = \"white\";\n ctx.beginPath();\n for (let i = 0; i < maxFlakes; i++) {\n let flakesF = flakes[i];\n ctx.moveTo(flakesF.x, flakesF.y);\n // curcle shape:\n ctx.arc(flakesF.x, flakesF.y, flakesF.radius, 0... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Constructor for LinkedList. ...items Optional initial items to add to the list. | constructor(...items) {
this._tail = new Node(this);
this._head = new Node(this);
this._head.next = this._tail;
this._tail.prev = this._head;
lock(this, "_head", "_tail");
lock(this._head, "_list", "_data");
lock(this._tail, "_list", "_data");
... | [
"constructor(_items = []) {\n this._items = _items;\n }",
"function ItemList(nodes) {\n if (nodes && nodes.length > 0) {\n Item.call(this, nodes[0].ownerDocument);\n this.nodes = nodes;\n }\n}",
"function ListItem(item) {\n this.item = item;\n this.next = null;\n}",
"function LNode(ite... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Deferred initialization to avoid a dependency cycle where Tracer depends on Span which depends on the noop tracer. | function initialize() {
exports.tracer = new tracer_1.default();
exports.span = new span_1.default();
exports.spanContext = new span_context_1.default();
} | [
"function initialize() {\n exports.tracer = new tracer_1.default();\n exports.span = new span_1.default();\n exports.spanContext = new span_context_1.default();\n}",
"function initialize() {\n exports.tracer = tracer = new _tracer2.default();\n exports.span = span = new _span2.default();\n exports.spa... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Initialize a new `BinWrapper` | function BinWrapper() {
this._src = [];
} | [
"constructor() { \n \n Bin.initialize(this);\n }",
"constructor(bounds) {\n this.rootBin = new Bin(bounds, null);\n }",
"constructor() {\n if(!_tobin){\n _tobin = this; \n }\n return _tobin; \n }",
"constructor() { \n \n FeeHistogramBin.initialize(this);\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Translate all points in a geometry `n` units in the x direction. | function transx(geo, n) {
for (var i = 0; i < geo.vertices.length; i++) {
geo.vertices[i].x += n;
}
} | [
"function transX(geo, n) {\n for (var i = 0; i < geo.vertices.length; i++) {\n geo.vertices[i].x += n;\n }\n}",
"function TranslateToOrigin(points, n) {\n let centroid = [0, 0, 0];\n for (let i = 0; i < points.length; i++) {\n centroid[0] = centroid[0] + points[i].x;\n centroid[1]... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Store search modifiers in a session cookie, so that checked boxes retain state on page reload/navigation. | function storeSearchModifiers(cookieName, values) {
console.log('storeSearchModifiers: begin');
var serialized = JSON.stringify(values);
$.cookie(cookieName, serialized);
} | [
"function setWildcardSearch() {\n if (document.getElementById('wildcardsearch').checked) {\n setCookie('wildcardsearch', 1);\n } else {\n setCookie('wildcardsearch', 0);\n }\n}",
"function storeSearchedTerms() {\n if (typeof(Storage) !== \"undefined\") {\n var searchedTerm... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Injects a Renderer2 for the current component. | function injectRenderer2() {
// We need the Renderer to be based on the component that it's being injected into, however since
// DI happens before we've entered its view, `getLView` will return the parent view instead.
var lView = getLView();
var tNode = getCurrentTNode();
var n... | [
"function injectRenderer2() {\n // We need the Renderer to be based on the component that it's being injected into, however since\n // DI happens before we've entered its view, `getLView` will return the parent view instead.\n const lView = getLView();\n const tNode = getCurrentTNode();\n const nodeA... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
load data and lock timestamps file to signify the spider is running | async load() {
if (this.loaded) return
this.configs = JSON.parse(stripJsonComments((await fs.readFile(`${this.settings.spiderPath}/configs.json`)).toString()))
this.vectorDB = await (new VectorLibrary({
path: this.settings.vectorDBPath,
fs, digest: async (algo, data)=> {
let hash = crypt... | [
"load() {\n try {\n this._data = require(`../${CACHE_DIRECTORY}/${this._name}.json`);\n } catch (e) {\n this._debug(`${this._name} cache created anew`);\n }\n }",
"function loadData() {\n logi(\"aniDownloader loading cached data\")\n\n try {\n var data = ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
A function that returns the parent element of a particular text where the validity is true | function returnParent(text, parent){
newParent = Array.from(parent);
for(i=0; i < newParent.length; i++){
if(newParent[i].innerHTML == text){
return(newParent[i])
}
}
} | [
"function elem_parent( elem, findFunc )\n{\n let parent = null ;\n let cur_elem = elem ;\n while( cur_elem != null && cur_elem.parentElement )\n {\n if ( findFunc( cur_elem.parentElement ))\n {\n parent = cur_elem.parentElement ;\n break ;\n }\n cur_elem = cur_elem.parentElement ;\n }\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Powerful constructor pattern 1. make an object using Object literal, new, Object.create or another power constructor 2. define some variables and function These become the private members. 3. Augment the object with privileged methods. The privileged methods are public but closes over private members of the object (via... | function powerConstructor(x) {
let that = {}; // object creates
let privateVar = ""; // private members
let privateFunc = function () {}; // private members
that.privilegedPublicMethod = function () {
// use private secret function variable here ..
};
} | [
"function make_class(){\n\tvar isInternal;\n\tvar constructor = function(args){\n if ( this instanceof constructor ) {\n\t\tif ( typeof this.init == \"function\" ) {\n this.init.apply( this, isInternal ? args : arguments );\n\t\t}\n } else {\n\t\tisInternal = true;\n\t\tvar ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Creates the service user and policies using `bin/EnsureServiceUser` | static async ensureServiceUser(parentAccount) {
const resp = await execPath(
NODE_INTERPRETER,
[ensureServiceUser, 'apply', 'service-utapi-user'],
{
AWS_ACCESS_KEY_ID: parentAccount.accessKey,
AWS_SECRET_ACCESS_KEY: parentAccount.secretKey,
... | [
"function serviceCreateUser(req, resp) {\n\t\tlogger.info(\"<Service> CreateUser.\");\n\t\tvar userData = parseRequest(req, ['username', 'password', 'email', 'openId', 'facebookId', 'googleId']);\n\t\t\n\t\twriteHeaders(resp);\n\t\thasPermissionUser(false, req.user, null, function(permOk) {\n\t\t\tif (permOk) {\n\t... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Function : translator_terminate Purpose : terminate the translator | function translator_terminate()
{
this.parser.terminate();
} | [
"function Terminate()\n{\n recordCompletion();\n\n storeDataValue( \"cmi.exit\", \"\" );\n\n terminateCommunication();\n}",
"terminate() {\n\t\t//\n\t}",
"exitTranslationUnit(ctx) {\n\t}",
"exitLanguage(ctx) {\n\t}",
"exitUnstringOrAllPhrase(ctx) {\n\t}",
"exitPerformVaryingPhrase(ctx) {\n\t}",
"abor... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get navigation item a hyperlink, a router link, or a simple value. Return only item name in case it is neither the route nor the element. Return a router link in case the item is route. Return a hyperlink in case the item is element. | function getNavItem(createElement, item) {
if (item.route === undefined && item.element === undefined) {
return item.name;
}
let elementName;
let attrs;
let props;
let classes;
if (item.meta.pathType === PATH_TYPE_ELEMENT) {
elementName = 'a';
attrs = {
href: item.meta.path,
};
... | [
"getLink(item) {\n if (item.url) {\n return item.url;\n }\n else if (item.contentPageLabelOrId) {\n return item.contentPageLabelOrId;\n }\n else if (item.categoryCode) {\n return this.semanticPathService.transform({\n cxRoute: 'categ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
VALIDAR CAMPOS PROCESO 1 | function validarcampos_p1 () {
if (nom_div("nombre_p1").value!=""&&nom_div("opcion_1").value!=0) {
return true;
}
else{
if (nom_div("nombre_p1").value=="") {
alert('Asigne un nombre al proceso 1');
nom_div("nombre_p1").focus();
}
if(nom_div("opcion_1").value==0){
alert('¿Cuantas Lineas de ... | [
"function validarcampos_p2 () {\n\t\n\tif (nom_div(\"nombre_p2\").value!=\"\"&&nom_div(\"opcion_2\").value!=0) {\n\n\t\treturn true;\n\n\t}\n\n\n\telse{\n\n\t\tif (nom_div(\"nombre_p2\").value==\"\") {\n\n\t\t\talert('Asigne un nombre al proceso 2');\n\t\t\tnom_div(\"nombre_p2\").focus();\n\t\t}\n\n\t\tif(nom_div(\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This is the surManager's constructor function, the surManager holds and manages all the other managers | function SurManager() {
this.heroManager = null;
this.monsterManager = null;
this.logManager = null;
this.environmentManager = null;
//this.menuManager = null;
this.lastMouseX = 0;
this.lastMouseY = 0;
this.mousex = 0;
this.mousey = 0;
} | [
"constructor(managers, engineers, interns) {\n this.managers = managers;\n this.engineers = engineers;\n this.interns = interns;\n }",
"constructor(room, roomManager) {\n this.room = room;\n this.roomManager = roomManager;\n\n this.spawns = room.find(FIND_MY_SPA... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Check Board Function a function that looks at the DOM and then creates an array out of the tiles on the board. If they are empty > push 0. If an Ex > push 2. If an Oh > push 5. | function checkBoard() {
const elements = Array.prototype.slice.call($('div .tac'));
const tempArr = [];
const board = [];
elements.forEach((element) => {
const temp = element.className.split(' ');
tempArr.push(temp);
});
tempArr.forEach((tac) => {
if (tac.length < 3) {
board.push(0);
... | [
"initBoard() {\n const numTiles = Math.pow(this.boardSize, 2);\n // contains Tile class instances\n this.tiles = [];\n // contains which tile number is currently at which position on the board (0 is the blank space)\n // initialise it with array of numbers 0..n-1\n this.tileOrder = Array(numTiles)... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
add estimated time it takes to get to neighborhood, using Gmaps transit locations appends to .duration class selector div | function add_directions_duration(lat, lon) {
var directionsService = new google.maps.DirectionsService();
var destinationMarker= new google.maps.LatLng(lat, lon);
var request = {
origin: initial_loc,
destination: new google.maps.LatLng(lat,lon),
travelMode: google.maps.TravelMode.WAL... | [
"function collectTimeAndDistance() {\n // Collect time and distance information\n for (var i = 0; i < directionsModel.route.legs.length; i++) {\n directionsModel.duration.value += directionsModel.route.legs[i].duration.value / 60; // to minutes\n directionsModel.distance.value += directionsModel... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
An element consisting of an article with a srollbar on the left, and an image on the right articleleft options: 0: article text 1: image URL | function buildArticleLeft(options) {
html += `<section id="article-left">
<p>${options[2]}</p>
<img src="${options[0]}" />
</section>
`} | [
"function buildArticleRight(options) {\n html += `<section id=\"article-right\">\n <img src=\"${options[0]}\" />\n <p>${options[2]}</p>\n </section>\n `}",
"function lateralArticleTools() {\n // if article tools isn't static, update its left position just in case\n if($('.article-tools_desktop'... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
QUIZ KEY INPUT HANDLE BUTTON | keyinputHandle(e) {
this.setState({
quizToopenkey: e.target.value
})
} | [
"function buttonInput(event) {\r\n \r\n const data = this.innerText;\r\n\r\n checkInput(data);\r\n\r\n if (\"x/-+=\".indexOf(data) > -1) {\r\n if (data === \"=\") {\r\n displayNumbers = [\"\"];\r\n answerOn = true;\r\n }\r\n screenDisplay([\"\"]);\r\n displayNumbers = [\"\"];\r\n answerO... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
override to return the next move to execute OK = false if move===null, else true msg should contain a message formatted for view (move description and result) this function should decide what actions the mob takes; query _canAct to check if stunned or otherwise incapaciated, then run execCombatCmd(moveNOP) | calcCombatMove(){
var rnd = _.random(1,100);
var result = this._canAct();
if(result.OK===false) {
window.gm.Encounter.execCombatCmd(window.gm.combat.moveNOP);
return(result);
}
if(rnd>30) {
result=window.gm.Encounter.execCombatCmd(window.gm.c... | [
"makeMove(move) {\n if (this.winner != null) {\n // You can't make normal moves when the game is over\n return false\n }\n\n if (move.op == \"beginTurn\") {\n this.beginTurn()\n } else if (move.op == \"attack\") {\n this.attack(move.from, move.to)\n } else if (move.op == \"face\")... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Calls parseCaps and just returns the matchedCaps variable | function processCapabilities (caps, constraints = {}, shouldValidateCaps = true) {
return parseCaps(caps, constraints, shouldValidateCaps).matchedCaps;
} | [
"function processCaps(caps) {\n var constraints = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1];\n var shouldValidateCaps = arguments.length <= 2 || arguments[2] === undefined ? true : arguments[2];\n\n return parseCaps(caps, constraints, shouldValidateCaps).matchedCaps;\n}",
"functio... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
eat() Consumes 2 units of food. If the hunter doesn't have 2 food when they are instructed to eat, they eat as much as they can (0 or 1 unit), but the hunter is no longer healthy | eat() {
let consume = this.food - 2
if (consume > 1) {
this.isHealthy = true
return this.food = consume
} if (consume <= 0) {
this.isHealthy = false
return this.food = 0
}
else if (consume <= 1) {
return this.foo... | [
"eat () {\n if (this.food === 0) {\n this.isHealthy = false;\n\n } else {\n this.food -= 1;\n }\n }",
"eat() {\n if (this.food <= 1) {\n this.isHealthy = false\n this.food = 0\n } else {\n this.food = this.food - 2\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
draws the table for one film at the time | function drawTableFilms(film){
infoFilms = $('#tableContent').html();
infoFilms += "<tr>"+
"<td><img src='/img/Films/"+ IgnoreSpecialCharactersFromString(film.title)+ ".jpg' class='charactersIMG center-block'</td>"+
"<td><b>Title: </b>"+ film.title+"</td>"+
"<td><b>Director: </b>"+ film.director+"</td>"+
... | [
"function drawTable(){\n\n}",
"function tableCreate(movie,allgenres,cast){\n\n //Initial table set up\n let body = document.body,\n tbl = document.createElement('table');\n tbl.style.width = '100px';\n tbl.style.border = '1px solid black';\n\n //Initialize variables and arrays\n let gen... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
this function takes the user ID from the body of the request It searches the Degree Plan Collection using the student ID It returns a JSON array of all the matches It returns an error message in the case of a failure in any of the previous steps | function findDegreePlan(req, res) {
try {
const plan = await Plan.find({"studentID": req.body.id});
res.json(plan);
console.log(
"Semester Endpoint here (GET OPERATION): Communication with the front-end done"
);
} catch (e) {
res.send({ message: "Error in Fetching semester information" });... | [
"function searchByFaculty(req, res){\n var sFaculty= req.body.faculty;\n\n StudentModel.find({\n faculty:sFaculty,\n _creator:req.user.id,\n isDelete:false\n }).then((students)=>{\n if(!students){\n return res.status(404).send();\n }\n res.send({students... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Adds `px` if value is a number, or returns it directly | function appendPxIfNumber(value) {
return typeof value === 'number' ? value + "px" : value;
} | [
"function appendPxIfNumber(value) {\n return typeof value === 'number' ? value + \"px\" : value;\n }",
"function appendPxIfNumber(value) {\n return typeof value === 'number' ? value + \"px\" : value;\n }",
"function _appendPX(value){return/^[-+]?[0-9]+$/.test(value)&&(value+=\"px\"),value}",
"func... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Determine whether the given properties match those of a `ChallengeConfigProperty` | function CfnWebACL_ChallengeConfigPropertyValidator(properties) {
if (!cdk.canInspect(properties)) {
return cdk.VALIDATION_SUCCESS;
}
const errors = new cdk.ValidationResults();
if (typeof properties !== 'object') {
errors.collect(new cdk.ValidationResult('Expected an object, but receive... | [
"function CfnRuleGroup_ChallengePropertyValidator(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 object, but... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
selector for the Name error | get errorName () { return $('#register-error-name') } | [
"function errorSelector(message) {\n return throwingSelector(message);\n}",
"getErrorElement(name) {\n this.infoElement = select(this.errorElement + '.' + this.errorClass, this.inputElement.parentElement);\n if (!this.infoElement) {\n this.infoElement = select(this.errorElement + '.' + t... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
minimizez all the panels | function movePanelsBack(panels)
{
//if the panel array is empty then below logic will work
for(let i=0; i<panels.length; i++)
{
if(panels[i]=="")
break;
else
panels[i].window.minimize();
}
} | [
"minimize() {\n UTILS.runCollection(this.menus, 'minimize');\n UTILS.runCollection(this.labels, 'minimize');\n }",
"function minimize() {\r\n\r\n\t\tlegendContent.selectAll('*').style(\"visibility\", \"hidden\");\r\n\t\tplusSignVLine.style(\"visibility\", \"visible\");\r\n\t\tlegendsOn = false;\r... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
converts a mnlgtun binary string into an array of cents | function mnlgBinaryToCents(binaryData) {
const centsOut = [];
const tuningSize = binaryData.length / 3;
for (let i = 0; i < tuningSize; i++) {
const str = binaryData.slice(i * 3, i * 3 + 3);
const hundreds = str.charCodeAt(0) * 100;
let tens = new Uint8Array([str.charCodeAt(2), str.charCodeAt(1)]);
... | [
"function mnlgBinaryToCents(binaryData) {\n const centsOut = []\n const tuningSize = binaryData.length / 3\n for (let i = 0; i < tuningSize; i++) {\n const str = binaryData.slice(i * 3, i * 3 + 3)\n const hundreds = str.charCodeAt(0) * 100\n let tens = new Uint8Array([str.charCodeAt(2), str.charCodeAt(1... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
list of plugins used by babel parser to parse the components javascript file | get babelParserPlugins() {
return ["typescript", "classProperties", "decorators-legacy"];
} | [
"webpackPlugins() {\n return new MjmlPlugin(this.toCompile);\n }",
"loadPlugins () {\n const plugins = __webpack_require__(\"./client/js/plugins sync recursive .*\\\\.js$\")\n plugins.keys().forEach((plugin) => {\n const init = plugins(plugin).default\n init(this)\n })\n }",
"funct... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This sample demonstrates how to Create Or Update Virtual Machine | async function createVirtualMachine() {
const subscriptionId = process.env["VMWARECLOUDSIMPLE_SUBSCRIPTION_ID"] || "{subscription-id}";
const resourceGroupName = process.env["VMWARECLOUDSIMPLE_RESOURCE_GROUP"] || "myResourceGroup";
const referer = "https://management.azure.com/";
const virtualMachineName = "myV... | [
"async function createOrUpdateVirtualMachine() {\n const subscriptionId =\n process.env[\"NETWORKCLOUD_SUBSCRIPTION_ID\"] || \"123e4567-e89b-12d3-a456-426655440000\";\n const resourceGroupName = process.env[\"NETWORKCLOUD_RESOURCE_GROUP\"] || \"resourceGroupName\";\n const virtualMachineName = \"virtualMachin... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
height : Number of edges/link from root to leaf Maximum of right and left subtree + 1 | heightOfTree(root) {
if (root === null) {
return 0;
}
let leftHeight = this.heightOfTree(root.left);
let rightHeight = this.heightOfTree(root.right);
return 1 + Math.max(leftHeight, rightHeight)
} | [
"heightOfTree(){\n let height = 0;\n let currentNode = this.root;\n if(!currentNode){\n return height\n }\n height = heightHelper(currentNode, height);\n return height\n }",
"function height(bst) {\n if(bst) {\n return 1 + Math.max(height(bst.left), height... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Calculate RMS of time data. | function rms(data) {
var size = data.length, accum = 0;
for (var i = 0; i < size; ++i) {
var s = (data[i] - 128) / 128;
accum += s*s;
}
return Math.sqrt(accum / size);
} | [
"function getTotalMs() {\n let totalTime = Math.round(wavesurfer.getDuration());\n return Math.round(totalTime * 1000);\n}",
"function rms(data) {\n var size = data.length, accum = 0;\n for (var i = 0; i < size; ++i) {\n var s = (data[i] - 128) / 128;\n accum += s*s;\n }\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Function to create a flower at a random position | function createRandomFlower() {
const flowerContainer = document.getElementById("flower-container");
// Create a new flower element
const flower = document.createElement("div");
flower.classList.add("flower");
const position = getRandomPosition();
flower.style.left = position.x + "px";
flow... | [
"function generateFlowerObjects(startx, starty) {\n x = startx - rb4.width * 0.33;\n y = starty + rb4.height * 0.05;\n\n function move(dir) {\n if (dir == 'right') {\n x = x + rb4.width;\n } else if (dir == 'left') {\n x = x - rb4.width;\n } else if (dir == 'up') {\n y = y - rb4.height * ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Author: Monica Thaneer This Verifies the header Of Cart Page The existing method ^^ doesnt seem to be a common function | verifyHeaderOnCartPage()
{
browser.waitForUrlContains("showCart");
console.log("***** The Header of Cart Page: " + eval(locator.txt_pageHeader).getText() + " *****");
assert.assertElementContainsText(eval(locator.txt_pageHeader), contentState.header);
} | [
"verifyCartPageHeader() {\n browser.waitForUrlContains(\"showCart\");\n if (browser.isDisplayed(eval(loginPageLocator.dd_myAccount))) { // If user logged in\n logger.log(\"***** The Header of Cart Page: \" + eval(locator.accountPageHeader).getText() + \" *****\");\n assert.assert... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
enable user for Standard Contact Center role (used to reset role and try again) | async function enableStandardContactCenterAgent ({email}) {
const roles = [
{roleName: 'CJP_PREMIUM_AGENT', 'roleState': 'INACTIVE'},
{roleName: 'CJP_SUPERVISOR', 'roleState': 'INACTIVE'},
{roleName: 'CJP_STANDARD_AGENT', 'roleState': 'ACTIVE'}
]
return setRoles({email, roles})
} | [
"async function enableContactCenterSupervisor ({email}) {\n const roles = [\n {roleName: 'CJP_PREMIUM_AGENT', 'roleState': 'ACTIVE'},\n {roleName: 'CJP_SUPERVISOR', 'roleState': 'ACTIVE'},\n {roleName: 'CJP_STANDARD_AGENT', 'roleState': 'INACTIVE'}\n ]\n return setRoles({email, roles})\n}",
"enableUse... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get "path name" (name with all parent assignments) for assignment at given index | function assignmentGetName(idx) {
var name = assignments[idx].name;
var level = assignments[idx].level;
for (var j=idx-1; j>=0; j--) {
if (assignments[j].level == level - 1) {
level = assignments[j].level;
name = assignments[j].name + "/" + name;
}
}
return name;
} | [
"function assignmentGetPath(idx) {\n\tvar path = assignments[idx].path;\n\tvar level = assignments[idx].level;\n\tfor (var j=idx-1; j>=0; j--) {\n\t\tif (assignments[j].level == level - 1) {\n\t\t\tlevel = assignments[j].level;\n\t\t\tpath = assignments[j].path + \"/\" + path;\n\t\t}\n\t}\n\treturn path;\n}",
"na... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets the dom id of the journal page save button | function getJournalSaveButtonId(id) {
return "journalSaveButton" + id;
} | [
"function getSaveButton() {\n return document.getElementById('save');\n}",
"function saveButtonClicked(event) {\n var id = $(event.target).data('uuid');\n console.log('Fetching save button : %s', id);\n db.get(id).then(function(doc){\n doc.notes = editor.exportFile();\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
parameter current node and direction : left or right, up or down returns the absolute top or leftdistance | function TNodes_doFindClosestLineDistance(nd,direction){
var mysplit=nd.Parent;
var myupnode=nd.Parent.UpNode;
var mydownnode=nd;
var resultnode={};
// TOP ********************************************************
if (direction=='top')... | [
"function getOffset(direction, node) {\n var el = node;\n if (!el.getBoundingClientRect) {\n return 0;\n }\n var rect = el.getBoundingClientRect();\n return direction === 'start' ? rect.top : rect.bottom;\n }",
"function whichDir(node1, node2) {\n const coord1 =... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
tests the model using the testdataset | async function test(testData) {
const result = await model.predict(testData.input).argMax(1).array();
const output = await testData.output.argMax(1).array();
let errorCount = 0;
for (let i = 0; i < output.length; i++) {
if (output[i] !== result[i]) {
errorCount += 1;
}
}
... | [
"async function test(){\n\tmessageP.html('Testing the Model...');\n\tfor(let i=0 ; i<60 ; i++)\n\t\tawait tf.nextFrame();\n\ttestP.html('Test Results');\n\ttestP.show();\n\ttestLossP.show();\n\ttestAccuracyP.show();\n\n\t// Creating the test data\n\tlet testBatch = data.nextTestBatch(10000);\n\tlet test_xs = testBa... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets or Sets the table alignment for selected table. | get tableAlignment() {
return this.tableAlignmentIn;
} | [
"set tableAlignment(value) {\n if (value === this.tableAlignmentIn) {\n return;\n }\n this.tableAlignmentIn = value;\n this.notifyPropertyChanged('tableAlignment');\n }",
"set alignment(value) {\n this.updatePropertyState('alignment', value);\n }",
"get alignm... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
on save see if entityusecode_needs_to_be_set then edit the codes per address | function set_entityusecode_if_edit_address() {
if (nlapiGetContext().getExecutionContext() === 'userinterface') {
if (window.entityusecode_needs_to_be_set) {
set_entityusecode();
}
return true;
}
} | [
"function set_entityuse_code_on_add_address(type, fldname) {\n if (window.setting_new_address && (fldname == 'shipaddresslist' || fldname == 'billaddresslist')){\n window.set_entityuse_code();\n }\n}",
"function set_entityusecode() {\n var STATES = get_states_map(); //use state map to get state a... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Insert lineDelimiters into a string so that each line has width less than the given maxWidth. If lineDelimiter is missing, then '\n' is assumed. The width of a string is measured in pixels using the supplied Ext.util.TextMetrics object. Note that this function could be slow for very long strings but seems to perform we... | function lineBreakString(str, metrics, maxWidth, lineDelimiter)
{
if (!lineDelimiter)
lineDelimiter = '\n';
var width = metrics.getWidth(str);
if (width < maxWidth)
return str;
var rb = [];
var sp = 0;
var sb = [str.charAt(0)];
var wordFragment;
for (var ... | [
"function splitByWidth(content, properties, textWidthMeasurer, maxWidth, maxNumLines, truncator) {\n // Default truncator returns string as-is\n truncator = truncator ? truncator : function (properties, maxWidth) { return properties.text; };\n var... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
sends a challenge to a specific user | function sendChallenge(from, to) {
users[to].emit('challenge', {'id' : from, 'handle' : handles[from] });
console.log(from + ' challenges ' + to);
} | [
"function createChallenge() {\n window.location.href = \"/create-challenge?user_id=\" + userId;\n console.log(\"CreateChallenge\", userId)\n }",
"respond2faChallenge(user_input, challenge_id) {\n var sixDigits = new RegExp(\"\\\\d{6}\");\n var self = this\n return new Promise((resolve, reject) => ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns the card with a given ID | function getCardById(id) {
var card = card_db({ Id: id }).first();
if (!card) {
return null;
}
return card;
} | [
"function getCard(id) {\n for (let i in cards) {\n if (cards[i].id == id) {\n return cards[i];\n }\n }\n }",
"function getCardById(id) {\n var card = cardDB({Id:id}).first();\n if (!card) {\n return null;\n }\n return card;\n}",
"getCard(id) {\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
/ 26 Fit Vids | function thememascot_fitVids() {
$('body').fitVids();
} | [
"function escope_fitVids() {\r\n $('body').fitVids();\r\n }",
"function initFitvids() {\n $('.block-video').fitVids();\n}",
"function initFitVids() {\n $(\".video-container\").fitVids();\n }",
"function fitVideo(){\n\t\"use strict\";\n\t\n\t$j(\".portfolio_images\").fitVids();\n\t$j(\".vi... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Attachment content (media) storage quota in MBs ( Retrieved from gateway ). | get MaxMediaStorageUsageInMB() {
return this.maxMediaStorageUsageInMB;
} | [
"get CurrentMediaStorageUsageInMB() {\n return this.currentMediaStorageUsageInMB;\n }",
"function check_total_attachment_size(controller, count) {\n let bucket = controller.e(\"attachmentBucket\");\n let nodes = bucket.getElementsByTagName(\"attachmentitem\");\n let sizeNode = controller.e(\"attachme... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets the value of the persistence cookie. Does not affect other cookies that may be present. | function setPersistenceCookie(sValue) {
document.cookie = 'JS_PERSISTENCE_COOKIE=' + escape(sValue);
} | [
"function setValue(name, value) {\n if (value) {\n var expirationDate = new Date();\n expirationDate.setMonth(expirationDate.getMonth() + 12);\n document.cookie = name + '=' + encodeURIComponent(value) + '; domain=.ultipro.com; expires=' + expirationDate;\n }\n else {\n document.cookie = name + '=' +... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This function gets the worm who is winning with it size | function getLongestWorm()
{
longestWormSize = 0;
longestWorm = "";
for(var i = 0; i < worms.length; i++)
{
if(players[i])
{
//alert(i+" "+worms[i].length+" "+longestWormSize);
if(worms[i].length >= longestWormSize)
{
longestWorm = worms[i];
longestWormSize = worms[i].length;
... | [
"checkWinner() {\n\n\t\tvar whitetotal = 0;\n\t\tvar blacktotal = 0;\n\n\t\tfor (var i = 0; i < this.board.length; i++) {\n\t\t\tfor (var j = 0; j < this.board.length; j++) {\n\t\t\t\tif(this.board[i][j] == Othello.BLACK) {\n\t\t\t\t\tblacktotal++;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif (this.board[i][j] == Othello.WHITE... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Prepares custom console restriction and applies it to the work request report. | function exWorkRequestDynamicTabs_wrConsole_applyRestriction() {
var console = Ab.view.View.getControl('', 'exWorkRequestDynamicTabs_wrConsole');
var restriction = console.getFieldRestriction();
// remove the default = clause on date_requested - we will add custom clauses for this field
restriction... | [
"function setRestriction(){\n // get reference to the console form\n var console = View.getControl('', 'request_console');\n \n // get the date range values in ISO format\n var dateRequestedFrom = console.getFieldValue('wr.date_requested.from');\n var dateRequestedTo = cons... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Create the property accessor type descriptor based on specified attributes. | function toAccessorType(property, attributes) {
// Create the new descriptor which contains `configurable` and `enumerable`.
var get = attributes.get, set = attributes.set, value = attributes.value, writable = attributes.writable, newDescriptor = tslib_1.__rest(attributes, ["get", "set", "value", "writable"]);
... | [
"static createPropertiesForAttributes() {\n let a$ = this.observedAttributes;\n for (let i=0; i < a$.length; i++) {\n this.prototype._createPropertyAccessor(caseMap.dashToCamelCase(a$[i]));\n }\n }",
"function createAccessor(attr) {\n function accessor(value) {\n if (!arguments.le... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
A higherorder function that returns a function that may be used to check whether an action matches all of the supplied type guards or action creators. | function isAllOf() {
for (var _len2 = arguments.length, matchers = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
matchers[_key2] = arguments[_key2];
}
return function (action) {
return matchers.every(function (matcher) {
return matches(matcher, action);
});
};
} | [
"function isAnyOf() {\n for (var _len = arguments.length, matchers = new Array(_len), _key = 0; _key < _len; _key++) {\n matchers[_key] = arguments[_key];\n }\n\n return function (action) {\n return matchers.some(function (matcher) {\n return matches(matcher, action);\n });\n };\n}",
"function a... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Manage `items` property based on `actions`, `hiddenActions`. | _computeItems() {
if (isEmpty(this.actions)) {
this.items = [];
return;
}
let aActions = clone(this.actions);
const allVisibleActions = this._removeHiddenActions(aActions);
this._primaryActions = filter(allVisibleActions, (o) => {
return this.primaryActions.includes(o.name);
}... | [
"function toggleItems() {\n dispatch({type:\"TOGGLE_ITEMS\"})\n }",
"_toggleItems(action, indexes) {\n const that = this,\n indexesCount = indexes.length;\n\n if (indexesCount > 0) {\n for (let i = 0; i < indexesCount; i++) {\n that['_' + action + 'Item'](ind... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
error messages on imageURL validation | imageURLErrors() {
const errors = [];
if (!this.$v.imageURL.$dirty) return errors;
!this.$v.imageURL.required && errors.push('Image link is required');
return errors;
} | [
"function validateImageURL(image_url){\n \n }",
"function urlImgValid(_url) {\n \tif(_url == \"../img/error-img.png\") {\n \t\treturn false;\n \t}\n\n \treturn true;\n}",
"function validImage(imageURL) {\n var isValidImageURL = imageURL.match(/\\.(jpeg|jpg|gif|png|bmp)$/) !== null;\n if (!isVali... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
check if sound cloud active | function isSCActive(){
return(typeof SC != "undefined");
} | [
"function readAloudStatus() {\n if (!window) return 'unavailable';\n window.mathlive = window.mathlive || {};\n\n if (!window.mathlive.readAloudAudio) return 'ready';\n if (window.mathlive.readAloudAudio.paused) return 'paused';\n if (!window.mathlive.readAloudAudio.ended) return 'playing';\n\n re... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
the name of a variable is located in different spots depending on the AST node type. This helper function accesses the name of a variable depending on the node type. | function getVarName(node) {
let varName = null;
switch (node.type) {
case "AssignmentExpression":
varName = node.left.name;
break;
case "VariableDeclarator":
varName = node.id.name;
break;
case "ExpressionStatement":
if (node.e... | [
"function variableName(tokens) {\n\t\t\ttokens.save();\n\t\t\tlet nextToken = tokens.next();\n\t\t\tif (nextToken.type == \"identifier\") {\n\t\t\t\treturn new Expr(\"variable\", nextToken.value, tokens.clearSave());\n\t\t\t}\n\t\t\telse {\n\t\t\t\ttokens.restore();\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}",
"getVa... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This idea comes from the Gansner paper: to account for edge labels in our layout we split each rank in half by doubling minlen and halving ranksep. Then we can place labels at these midpoints between nodes. We also add some minimal padding to the width to push the label for the edge away from the edge itself a bit. | function makeSpaceForEdgeLabels(g) {
var graph = g.graph();
graph.ranksep /= 2;
_.forEach(g.edges(), function (e) {
var edge = g.edge(e);
edge.minlen *= 2;
if (edge.labelpos.toLowerCase() !== "c") {
if (graph.rankdir === "TB" || graph.rankdir ==... | [
"function makeSpaceForEdgeLabels(g){var graph=g.graph();graph.ranksep/=2;_.forEach(g.edges(),function(e){var edge=g.edge(e);edge.minlen*=2;if(edge.labelpos.toLowerCase()!==\"c\"){if(graph.rankdir===\"TB\"||graph.rankdir===\"BT\"){edge.width+=edge.labeloffset}else{edge.height+=edge.labeloffset}}})}",
"function mak... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
extracts just stimulus from stim/task array | function getStimSet(arr){
let newArr = []
for (let i = 0; i < arr.length; i++) {
newArr = newArr.concat(arr[i][0]); //0 b/c stim are 1st in stimTaskPair arr
}
return newArr;
} | [
"function getTaskSet(arr){\n let newArr = []\n for (let i = 0; i < arr.length; i++) {\n newArr = newArr.concat(arr[i][1]); //1 b/c task is 2nd in stimTaskPair arr\n }\n return newArr;\n}",
"function createStimuliAndTaskSets(nTrials, blockLetter){\n let targetsArr, congruenciesArr, taskArr, stimArr;\n let ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Copy specific elements by a condition. | function copy_if(first, last, output, pred) {
for (; !first.equals(last); first = first.next()) {
if (!pred(first.value))
continue;
output.value = first.value;
output = output.next();
}
return output;
} | [
"function replace_copy_if(first, last, result, pred, new_val) {\r\n for (; !first.equals(last); first = first.next()) {\r\n if (pred(first.value))\r\n result.value = new_val;\r\n else\r\n result.value = first.value;\r\n result = result.next();\r\n }\r\n return res... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
======= Check what state we are in, send to appropriate function ===== | function checkState() {
if (state === `simulation`) {
simulation();
} else if (state === `win`) {
win();
} else if (state === `lose`) {
lose();
}
} | [
"checkPickingState() {}",
"function state(err, value){\n binaryState = value;\n if(binaryState == 1){\n stateActual = \"ON\"; \n}else{\n stateActual = \"OFF\"; \n}\n// AM I RECEIVING ANYTHING?\n// console.log(\"Error %s\", err);\n// console.log(\"Value %s\", value);\n}",
"function state_check(state){\n\tfor (... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
create pictures block, and view picture | function show_pictures(galleryId, imgs, marker_coordinates) {
var arr = galleryId
gId('story_content').style.display = 'block';
if (arr.length > 1) {
// gallery will be created if many pictures are in the temporary panel.
var gallery = document.createElement("div");
gallery.classNa... | [
"function createBlock(imageSrc) {\n let block = document.createElement(\"div\");\n block.className = \"block\";\n createImage(block, imageSrc);\n createSrcDiv(block, imageSrc);\n gallery.appendChild(block);\n }",
"function add_image_block(sentinal) {\n $('#acc_holder').appen... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
if piece is movable, changes the border to black and cursor to normal | function mouseOut() {
if (canMove(this)) {
this.className = "piece normal";
}
} | [
"function highlight() {\n if (moveable(this)) {\n this.classList.add(\"movablepiece\");\n }\n }",
"function movable(){\n\t\toldTop = parseInt(this.style.top);\n\t\toldLeft = parseInt(this.style.left);\n\t\tif (oldTop == emptyTop && oldLeft == (eLeft-100) || oldTop == emptyTop && oldLef... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sanitizes the given untrusted CSS style property value (i.e. not an entire object, just a single value) and returns a value that is safe to use in a browser environment. | function _sanitizeStyle(value){value=String(value).trim();// Make sure it's actually a string.
if(!value)return'';// Single url(...) values are supported, but only for URLs that sanitize cleanly. See above for
// reasoning behind this.
var urlMatch=value.match(URL_RE);if(urlMatch&&_sanitizeUrl(urlMatch[1])===urlMatch[1... | [
"function sanitizeStyle(value) {\n value = String(value).trim(); // Make sure it's actually a string.\n if (!value)\n return '';\n // Single url(...) values are supported, but only for URLs that sanitize cleanly. See above for\n // reasoning behind this.\n var urlMatch = value.match(URL_RE);\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Public function `lessOrEqual`. Returns true if `lhs` is a number less than or equal to `rhs`, false otherwise. | function lessOrEqual (lhs, rhs) {
return number(lhs) && lhs <= rhs;
} | [
"function lessOrEqual(lhs, rhs) {\n return number(lhs) && lhs <= rhs;\n }",
"function lessOrEqual(lhs, rhs) {\n return number(lhs) && lhs <= rhs;\n }",
"function lessOrEqual(lhs, rhs) {\n return number(lhs) && lhs <= rhs;\n}",
"function greaterOrEqual(lhs, rhs) {\n return number(lhs) && lhs >= r... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Imports individual slides into this slideshow | importSlides(){
let parser = new DOMParser();
let importCount = 0;
// Fetch is defaulting to http instead of https,
// despite location.protocol being https.
// This causes a mixed content error and slides
// fail to load. #sigh
let href = window.location.href;
let parts = href.split('/... | [
"async function loadSlides() {\n const slides = []\n\n await Promise.all(mySlides.map(async (slide, index) => {\n let module = await import(`./slides/${slide}.js`)\n slides[index] = module.default\n }));\n\n return slides\n}",
"async function loadSlides() {\n const slides = []\n\n await Promise.all(\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
util.Array.isSimilar(source, compare) > Boolean source (Array): Array to compare. compare (Array): Array to compare. Compares two arrays to see if they have the same length and contain the same items. var arr1 = [1, 2, 3]; var arr2 = [1, 2, 3]; arr1 === arr2; // > false util.Array.isSimilar(arr1, arr2); // > true util.... | function isArraySimilar(source, compare) {
return (
source.length === array.length
&& arrayCommon(source, array).length === arrayUnique(source).length
);
} | [
"function arraysSimilar(arr1, arr2) {\n if (arr1.length !== arr2.length) return false;\n\n arr1.sort();\n arr2.sort();\n\n for (let i = 0; i < arr1.length; i++) {\n if (arr1[i] !== arr2[i]) return false;\n }\n\n return true;\n}",
"function areSimilar(a, b) {\n //Compare the arrays\n if (a.toString() ==... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
function to get the products having a reasonable price | function reasonable_products(products){
let res=[];
products.forEach((product, i) => {
if(product.price<=100){
res.push(product);
}
});
return res;
} | [
"function filterByPrice(prod) {\r\n return prod.price < 1500;\r\n}",
"function filterByPrice(prod) {\n return prod.cost < 1500;\n }",
"function FilterByPrice(price) {\n return products.filter(function (item) {\n return item.price <= price;\n });\n}",
"_find_price (id) {\n let price;\n for(let ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Creates a basic right floating box of given id | function rightBox(idName) {
return $create("div", {
className : "rBox",
id : idName
});
} | [
"function createBox()\n\t{\n\t\treturn that.add('rect', {\n\t\t\tcolor: style.boxColor,\n\t\t\tborderWidth: style.borderWidth,\n\t\t\tborderColor: style.borderColor\n\t\t}, {\n\t\t\ttop: that.id + ' top',\n\t\t\tbottom: that.id + ' top ' + ht,\n\t\t\tleft: that.id + ' left',\n\t\t\tright: that.id + ' right'\n\t\t})... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Remove an event listener returns true if listener was removed returns false on error condition: listener undefined listener not a function event not a string | function removeEventListener(event, listener) {
var indexToRemove,
list;
if (listener === undefined ||
typeof listener !== "function" ||
typeof event !== "string") {
throw new TypeError("EventEmitter: removeEventListener requires a string and a function as arguments");
}
... | [
"removeListener(eventName, callback) {\n let listeners = this.listeners.get(eventName);\n let index;\n\n if (listeners && listeners.length) {\n index = listeners.reduce((i, listener, index) => {\n return (_isFunction(listener) && listener === callback) ?\n i = index :\n i;\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
gets top n players | getTopPlayers(n){
return client({
method: 'GET',
path: PLAYER_SEARCH_ROOT+"getAllByOrderByEloDesc",
params: {
page: 0,
size: n
}
})
} | [
"function getTopPlayers() {\n\t\t\tvm.title = (vm.count !== '' ? 'Top ' + vm.count : 'Top 10');\n\n\t\t\tTopFactory.getTopPlayers(vm.count)\n\t\t\t.then(function(response) {\n\t\t\t\tvm.players = response;\n\t\t\t});\n\t\t}",
"function topTenScorers(teamsAndPlayers) {\n return Object.entries(teamsAndPlayers)\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Displays overlay with "Please wait" text. Based on bootstrap modal. Contains animated progress bar. | function showPleaseWait() {
var modalLoading = '<div class="modal" id="pleaseWaitDialog" data-backdrop="static" data-keyboard="false role="dialog">\
<div class="modal-dialog">\
<div class="modal-content">\
<div class="modal-header">\
<h4 class="modal-title">잠시만 기대려 주세요.</h4>\... | [
"function showPleaseWait() {\n\t var modalLoading = '<div class=\"modal\" id=\"pleaseWaitDialog\" data-backdrop=\"static\" data-keyboard=\"false\" role=\"dialog\">\\\n\t <div class=\"modal-dialog\">\\\n\t <div class=\"modal-content\">\\\n\t <div class=\"modal-header\">\\\n\t ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
sorts the table of painting based on user's input(click) | function sortingTable(paintings) {
let artist = document.querySelector("#artist");
let year = document.querySelector("#year");
let title = document.querySelector("#title");
artist.addEventListener("click", function () {
let sortedArtists = paintings.sort((a, b) => {
... | [
"function sortingTable(paintings) {\n let artist = document.querySelector(\"#artist\");\n let year = document.querySelector(\"#year\");\n let title = document.querySelector(\"#title\");\n\n artist.addEventListener(\"click\", function () {\n let sortedArtists = paintings.sort((... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Prioritising contents based on their relative height to a given bin | function prioritiseTall(bin, cont) {
var contNew = [];
while (cont.length > 0) {
for (c in cont) {
if (cont[c].isUpright == true && cont[c].height > bin * .75) {
contNew.push(cont[c]);
cont.splice(c, 1);
}
}
contNew.push(cont[0]);
cont.splice(0, 1);
}
return contNew;... | [
"function sortByHeight() {}",
"function selectBin() {\r\n\twhile (bins.length > 0) {\r\n\r\n\t\tvar contentsB = contents.slice();\r\n\r\n\t\t//prioritiseTall puts any items with a height of 75%+ of the bin to the front of the array\r\n\t\tcontentsB = prioritiseTall(bins[0], contents.slice());\r\n\r\n\t\tvar space... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Build `regions` list of key/value pairs | function loadAllRegions() {
var allRegions = 'ACAC Member, AFCAC Member, LACAC, European Civil Aviation Commission';
return allRegions.split(/, +/g).map(function (region) {
var index = 1;
return {
value: region.toLowerCase()... | [
"function getRegions() {\n return Object.keys(regions);\n}",
"get_region_lists() {\n\t\tlet region_lists = {};\n\t\tthis.players.forEach((p) => {\n\t\t\tlet reg = p.region;\n\t\t\tif (!region_lists[reg]) {\n\t\t\t\tregion_lists[reg] = [];\n\t\t\t}\n\t\t\tregion_lists[reg].push(p);\n\t\t})\n\t\treturn region_li... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Scrolls to the given left offset. Returns false if the page scroll position is already close enough to the given offset. | function scrollToOffset(offset) {
var currentOffset = window.scrollX;
var pageWidth = window.innerWidth;
document.scrollingElement.scrollLeft = offset;
// In some case the scrollX cannot reach the position respecting to innerWidth
var diff = Math.abs(currentOffset - offset) / pageWidth;
return diff > 0.01;
... | [
"function scrollLeft() {\n if (isRTL() && isOnLastPage()) {\n return false;\n }\n if (isOnFirstPage()) {\n return false;\n }\n\n var documentWidth = document.scrollingElement.scrollWidth;\n var offset = window.scrollX - pageWidth;\n var minOffset = ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets the user driver route per selection and insures only one route is active | function activeRoute(route) {
var index = vm.routes.indexOf(route);
for (i = 0; i < vm.routes.length; i++) {
if (i != index && route.originationTrip == vm.status) {
vm.routes[i].myStartRoute = false;
};
};
if (route.originationTrip == true) {
vm.profile.driver... | [
"setRoutes () {\n ['model', 'collection'].forEach(route => this.setRoute(route));\n }",
"function setRouteOption(routeOption) {\n\t\t\t//set checkox with $('#' + routeOption) active\n\t\t\tvar el = $('#' + routeOption);\n\t\t\tif (el) {\n\t\t\t\tel.attr('checked', true)\n\t\t\t}\n\n\t\t\t//set parent di... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Event handler for the feedback icon | function handleFeedbackIcon(){
if(SOUNDS_MODE){
audioClick.play();
}
mtbImport('feedback.js');
buildFeedbackPopup();
} | [
"function handleClickFeedback (e) {\n svl.tracker.push(\"ModalComment_ClickFeedback\");\n showCommentMenu();\n }",
"iconOnClick(iconType) {\n const videoTimeStamp = this.#video.getCurrentVideoTimeMs();\n const url =\n new URL(PostIconFeedback.#ENDPOINT_FEEDBACK, window.location.origi... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Creates the transaction flags series with empty data on the graph or overrides the existing transaction flags series | function initFlagsSeries(trader) {
flagsSeries = chartSeries.filter(function(series) {
return series.id == flagsSeriesId;
})[0];
if (!flagsSeries) {
flagsSeries = {
type : 'flags',
id : flagsSeriesId,
... | [
"function formatFlagsData(transaction) {\n var title = (transaction.buyerId == selectedTrader.id) ? 'B'\n : 'S';\n return {\n x : transaction.timestamp,\n title : title\n };\n }",
"function getFlagsData() {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
|Kendo Grid Export Excel| | function KendoGridCreateTbExportExcel(allData) {
var t = KendoGridTextAll;
var ctrID = allData.ctrID;
var ctrID2 = "#" + ctrID;
var kg = $(ctrID2).data(kd.kg);
var exportExcel = allData.exportExcel;
var isExport = true;
if (exportExcel != null && exportExcel.isExport != null) {
isExp... | [
"function DinamicExcelExport(e) {\r\n var sheet = e.workbook.sheets[0];\r\n var colTemplates = []; //Initialize new array\r\n var data = this.dataSource.view();\r\n\r\n for (var i = 0; i < this.columns.length; i++) {\r\n if (this.columns[i].template) {\r\n colTemplates.push(kendo.temp... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
function to rate app | function rateApp(){
storage.setItem("rateApp", true);
normalOpenLink(app_link);
} | [
"function appRate(){\n\tif(tracking)\n\t\tanalytics.trackEvent('AppRate', 'Rated');\n\n\ttoggleSetting('appRate');\n\twindow.open('http://play.google.com/store/apps/details?id=' + googlePlayAppId, '_system');\n\tappRate_Group.visible = false;\n\thideAppRate();\n}",
"function rateApp(){\n storage.setItem(\"rate... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Determine whether the given properties match those of a `ComponentMonitoringSettingProperty` | function CfnApplication_ComponentMonitoringSettingPropertyValidator(properties) {
if (!cdk.canInspect(properties)) {
return cdk.VALIDATION_SUCCESS;
}
const errors = new cdk.ValidationResults();
if (typeof properties !== 'object') {
errors.collect(new cdk.ValidationResult('Expected an obj... | [
"function CfnLaunchTemplate_MonitoringPropertyValidator(properties) {\n if (!cdk.canInspect(properties)) {\n return cdk.VALIDATION_SUCCESS;\n }\n const errors = new cdk.ValidationResults();\n errors.collect(cdk.propertyValidator('enabled', cdk.validateBoolean)(properties.enabled));\n return er... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
=================================================================== from functions/io/StdIn.java =================================================================== Needed early: Builtin Needed late: IO PORT TODO: This should be able to set stdin. But don't change it! | function StdIn() {
} | [
"set onStdin(cb) {\n this._stdin = cb;\n }",
"function stdin ( data ) {\n if ( \"clientId\" in data && \"stdin\" in data ) {\n\tio.emit(\"message\", { clientId: data.clientId, message: \"Recived stdin string\" });\n\tif ( data.clientId in _interface ) {\n\t io.emit(\"message\", { clientId: data.cl... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get last paragraph in last cell | getLastParagraphInLastCell(table) {
if (table.childWidgets.length > 0) {
let lastrow = table.lastChild;
let lastcell = lastrow.lastChild;
let lastBlock = lastcell.lastChild;
return this.getLastParagraphBlock(lastBlock);
}
return undefined;
} | [
"getLastParagraph(cell) {\n while (cell.nextSplitWidget) {\n if (cell.nextSplitWidget.childWidgets.length > 0) {\n cell = cell.nextSplitWidget;\n }\n else {\n break;\n }\n }\n let lastBlock;\n if (cell.childWidgets... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Class Fields are not supported in all browsers commenting out item; quantity; children; acquisitionMode; acquisitionCost; | constructor(item, quantity) {
this.item = item;
this.quantity = quantity;
this.children = {};
} | [
"function Item() {\n this.id = 0;\n \n // the bill of material\n //this.billOfMaterial = new BillOfMaterial();\n \n // a short description of the item\n this.briefDescription = '';\n \n // a human readable code associated with the item (sku)\n this.code = '';\n \n // user comment... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get the attachments of the model. | get attachments() {
return this._attachments;
} | [
"getAttachments() {\n let attachments = [];\n if (this.body.attachments && this.body.attachments.length) {\n attachments = this.body.attachments;\n }\n return attachments;\n }",
"get attachments() {\n return this.message ? this.message.attachments : null;\n }",
"get... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sends the given message to the given ip address. | sendMessage(msg, address) {
let message = Buffer.from(msg);
this.socket.send(message, this._sendingPort, address);
} | [
"function sendAddressToServer(message) {\n socket.send(message);\n }",
"function sendMessageToServer(message) {\n socket.send(message);\n }",
"function sendMessageToServer(message) {\n\tsocket.send(message);\n}",
"function sendMessageToServer(message) {\n socket.send(message);\n }"... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Given the name of a service and the array of profiles, return a link to that service that's styled appropriately (i.e. show a link or a checkmark). | function getLink(prettyName, profiles, pushes, token, callback) {
var service = prettyName.toLowerCase();
// This flow is documented here: http://dev.singly.com/authorization
var queryString = querystring.stringify({
client_id: clientId,
redirect_uri: sprintf('%s/callback', hostBaseUrl... | [
"function getLink(prettyName, profiles, token) {\n var service = prettyName.toLowerCase();\n\n // If the user has a profile authorized for this service\n if (profiles && profiles[service] !== undefined) {\n // Return a unicode checkmark so that the user doesn't try to authorize it again\n return spr... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Parse a javadocformat path. | function parseJavadocFlavorPath (pathstr) {
var frags = pathstr.split (Patterns.jpathWord);
var newPath = [ ];
if (!frags.length)
return newPath;
for (var i=1,j=frags.length; i<j; i+=4)
if (frags[i+1]) {
// module, event or external
var stepType = frags[i+1];
... | [
"function parseJsDocString(doc) {\n var e_1, _a;\n // Prepare lines\n var lines = doc.split(\"\\n\").map(function (line) { return line.trim(); });\n var description = \"\";\n var readDescription = true;\n var currentTag = \"\";\n var tags = [];\n /**\n * Parsing will add to \"currentTag\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |