query stringlengths 9 34k | document stringlengths 8 5.39M | negatives listlengths 19 20 | metadata dict |
|---|---|---|---|
Generate list model file | _generateListModel() {
let content = renders.renderListModel(this._config);
this._writer.writeListModel(content);
} | [
"_generateItemModel() {\n let content = renders.renderItemModel(this._config);\n this._writer.writeItemModel(content);\n }",
"function getModelData() {\n var models = []\n var files = fs.readdirSync('assets');\n files.forEach(function (file) {\n if (file.indexOf('.json... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
setting width of Model Target | function setModelTargetWidth(modelTarget, boundingBox) {
// Make the model target slightly wider than the smallest horizontal dimension of the bounding box
modelTarget.SetWidth(1.1 * Math.min(boundingBox.max.x - boundingBox.min.x, boundingBox.max.z - boundingBox.min.z));
} | [
"set detailWidth(value) {}",
"setWidth(newWidth) {this.width = newWidth;}",
"set fixedWidth(value) {}",
"setWidth(L){\n this.w = L;\n \n }",
"shouldElementUseModelWidth() {\n return true;\n }",
"set width(val) {\n this._setAttributes(val,'width')\n }",
"s... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns the number of subscriptions. | get count() {
return this._subscriptions.length;
} | [
"get subscriptionCount() {\n\t\treturn prefs.subscriptions.length;\n\t}",
"get count() {\r\n return this._subscriptions.length;\r\n }",
"function getCountOfSubscribers(){\n return totalSubscribers;\n }",
"get subscriptionCount()\n {\n return FilterStorage.subscriptions.length;\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
the active rss feed is used for the search function | function parse_rss(rss_feed)
{
activeRssFeed = rss_feed; // sets the currently active rss feed which is used by search to look through the articles for matches then display the results
$('#news-content').empty(); // clears the news-content div to make way for the new content
$(rss_feed).find("item").eac... | [
"function rssEvents(){\n\t\tif ( (currentUrl.match(/back/i)) && ((parseInt(localStorage.getItem('rssLastRetrieved')) + 1000*60*20) >= Date.now()) ){\n\t\t\tvar $rssCapableLinks = $(\".rss-capable\");\n\n\t\t\tfor(var t = 0; t<$rssCapableLinks.length; t++){\n\t\t\t\t\n\t\t\t\tvar $specificData = $rssCapableLinks.eq(... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Updates the wether the user has decided to flee or not. True when the flee button is clicked. | function flee() {
isfleeing = true;
makesAMove();
} | [
"function fleeToCar(){\n \n if(turn==1){fleeToCar1=true; player1Fleeing=true;}\n if(turn==2){fleeToCar2=true; player2Fleeing=true;}\n actionsChoosen++; //Let the system know the player has choosen an action\n \n }",
"eat () {\n if (this.food === 0) {\n this.... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Admin can see all the shops. | async function showShops(req, res) {
if (req.user.user == 'admin') {
const result = await ShopkeeperModel.find();
if (result != null) {
return res.status(200).json({ result, message: "All Shops Present.." });
}
else {
return res.status(200).json({ message: "No... | [
"getNearbyShops() {\n\t\tconsole.log('Showing nearby shops');\n\t\tthis.getShops('nearby');\n\t}",
"async function listShops (ctx) {\n const { language, subtitle } = ctx.state;\n\n const shops = await Shop.query()\n .modify('setLocale', 'shop_names', 'shop_id', 'shops.id', language, subtitle)\n .select('i... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Enumerableinvoke(methodName[, arg...]) > Array Invokes the same method, with the same arguments, for all items in a collection. Returns the results of the method calls. | function invoke(method) {
var args = $A(arguments).slice(1);
return this.map(function(value) {
return value[method].apply(value, args);
});
} | [
"function invoke(arr, methodName, var_args){\n if (arr == null) {\n return arr;\n }\n\n var args = slice_1(arguments, 2);\n var i = -1, len = arr.length, value;\n while (++i < len) {\n value = arr[i];\n value[methodName].apply(value, args);\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This event handler calls the handleSubmit public method of fieldset component | handleSubmitModal(event) {
this.template.querySelector("c-create-record-from-fieldset").handleSubmit();
} | [
"handleSubmitModal(event){\n this.template.querySelector('c-create-record-from-fieldset').handleSubmit(); \n }",
"handleSubmit(event) {\n event.preventDefault();\n\n if (this.props.level === 'row') {\n this.addNewOption();\n }\n else {\n this.... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
findWidgetsByPageId(pageId) retrieves the widgets in local widgets array whose pageId matches the parameter pageId | function findWidgetsByPageId(pageId){
var widgets = $http.get("/api/page/"+pageId+"/widget");
return widgets;
} | [
"function findWidgetsByPageId(pageId) {\n // /api/page/:pageId/widget\n return $http.get(\"/api/page/\" + pageId + \"/widget\");\n }",
"function findWidgetsByPageId(pageId) {\n var url = '/api/page/' + pageId + '/widget';\n return $http.get(url);\n }",
"... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Return a resource by its name. | getResource(name) {
const normalizedName = normalizeName(name);
let index = this.origins.length - 1;
while (index >= 0) {
const origin = this.origins[index--];
if (origin.hasResource(normalizedName)) {
return origin.getResource(normalizedName);
... | [
"getResourceWithName(name) {\r\n this.cache.forEach((value, key) => {\r\n if (key.name == name) {\r\n return value;\r\n }\r\n });\r\n return null;\r\n }",
"findResource(name) {\n let ret = null\n this.resources.map(r => r.names.friendly ==... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
NOTE: WebhookPostHandler is a singleton, so all state will need to be maintained in this.session object. fbidHandler is also a singleton, so that will be part of the WebhookPostHandler object. | function WebhookPostHandler(session, testing, pageId) {
if(testing) TEST_MODE = true; // Use sparingly. Currently, only used in callSendAPI
this.travelSfoPageHandler = new TravelSfoPageHandler();
this.seaSprayHandler = new SeaSprayHandler(TEST_MODE);
this.hackshawHandler = new HackshawHandler();
this.pageId = ... | [
"function WebhookPostHandler(session, testing, pageId) {\n if(testing) TEST_MODE = true; // Use sparingly. Currently, only used in callSendAPI\n this.travelSfoPageHandler = new TravelSfoPageHandler();\n this.seaSprayHandler = new BaseHandler(new SeaSprayHandler(TEST_MODE));\n this.seaSprayPrototypeHandler = new... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Connect to the redis server using default connection parametrs from environment variables | function connectToRedis() {
// get hostname of the redis server, which defaults to localhost which is fine for Openshift deployments
// where all contains will run within the same pod
const REDIS_SERVER = process.env.REDIS_SERVER || 'localhost';
const REDIS_PORT = process.env.REDIS_PORT || 6379;
// create re... | [
"configureRedis() {\n redis.connect();\n }",
"constructor() {\n this.client = redis.createClient(config.redis) // Assumption: using default local config\n }",
"function connect_redis() {\n logging.log(\"connecting to redis...\");\n redis = node_redis.createClient(process.env.FLY_REDIS_CACHE_URL ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get the Object3D used to display this Visual | get object3D() {
return this.mObject3D;
} | [
"get objects3D() {\r\n return this._objects3D;\r\n }",
"parent() { return this.vglObject3d.inst(); }",
"function Object3D()\n{\n\tthis.id = MathUtils.generateID();\n\tthis.name = \"\";\n\tthis.type = \"Object3D\";\n\t\n\t/**\n\t * Local position.\n\t */\n\tthis.position = new Vector3(0,0,0);\n\n\t/**\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
animate flag without saturation in overflow area | function animate_flag_without_saturation_overflow_area (direction){
var index = '#filaIndiceDesb'+direction;
$(index).html("<img src='js/css/tilde.gif' border='0' />");
$(index).effect("pulsate",{times:3},500);
} | [
"function animate_flag_with_saturation_overflow_area (direction){\n var index = '#filaIndiceDesb'+direction;\n $(index).html(\"<img src='js/css/cross.png' border='0' />\");\n $(index).effect(\"pulsate\",{times:3},500);\t\n}",
"function animation_flag_without_saturation (){\n var index = '#filaIndice'+gen_inf[... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Update Sale Stat Charts | function update_sale_stats(values){
var json = $.parseJSON(values)
//Update Charts
$('.chart').data('easyPieChart').update(json.total_sales[0]);
$('#chart-percent').html("");
$('#chart-percent').html("<strong>"+json.total_sales[0]+"</strong></div>");
$('#total_sales').html("");
$('#total_sa... | [
"function updateANDBSalesData() {\n\n}",
"function updateRevenueChartData() {\n\n var i;\n var revenues = calculateMonthlyRevenue();\n var expenses = calculateMonthlyExpenses();\n\n for (i = 0; i < 12; i++) {\n revenueChart.data.datasets[0].data[i] = revenues[i];\n revenueChart.data.data... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Reads data from the MINERID_DATA_FILENAME file. | function readMinerIdDataFromFile (aliasName) {
return _readDataFromJsonFile(aliasName, MINERID_DATA_FILENAME)
} | [
"function loadData() {\n\tvitaminData = require(dataFile)\n}",
"function readUserDataFromFile() {\n\t//read file \"filename\" using fs\n\tfs.readFile('./'+ filename, 'utf8', function (err,data) {\n\t\t//if there is an error, print it\n\t\tif (err) {\n\t\t\treturn console.log(err);\n\t\t}\n\t\t//put file contents ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Function to be called by the event listener. Repeatedly calls drawDragRect to redraw rectangle over and over again | function drawRect() {
changeCursor("crosshair")
coordinates = getCanvasMousePosition(canvas, event)
if(coordinates.x > leftCorner.x && coordinates.y > leftCorner.y)
{
drawDragRect(canvas, event, leftCorner)
}
} | [
"function drawDragHandler() {\r\n\r\n }",
"_drawDragRectangle() {\n if (!this._dragStartCoords) {\n return;\n }\n const dragEndCoords = this._dragCurrentCoords = this._dragCache.end = mouse(this._background.node())\n const x1 = Math.min(this._dragS... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Reads stdin into an array of lines. | async function readLines() {
return new Promise<string[]>((resolve, reject) => {
const rl = readline.createInterface({input: process.stdin});
const lines: string[] = [];
rl.on('line', line => {
lines.push(line);
});
rl.on('close', () => {
resolve(lines);
});
});
} | [
"function readStdin() {\n return new Promise((resolve, reject) => {\n let chunks = [];\n process.stdin.on(\"data\", function (chunk) {\n chunks.push(chunk);\n }).on(\"end\", function () {\n resolve(chunks.join(\"\"));\n }).setEncoding(\"utf8\");\n });\n}",
"... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
select dropdowns in the preference popup window for language, distance unit, etc. | function loadPreferencePopupData() {
//versions
var container = $('#extendedVersionPrefs');
for (var i = 0; i < list.version.length; i++) {
var optionElement = new Element('option', {
'value' : i
});
if (i == 0) {
optionElement.selected = true;
}
$(optionElement).html(p.translate(list.versi... | [
"function fillDropDownOpts(){\n\t var hourOptions= \"\",minuteOptions=\"\",langOptions=\"\", countryOptions=\"\";\n\t var langlist =['---Select Language---',\n\t 'Afrikaans',\n\t 'Albanian',\n\t 'Amharic',\n\t 'Arabic Standard',\n\t '... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Convert a string from Trytes. | static stringFromTrytes(trytes) {
// Trim trailing 9s
let trimmed = trytes.replace(/\9+$/, "");
// And make sure it is even length (2 trytes per ascii char)
if (trimmed.length % 2 === 1) {
trimmed += "9";
}
const ascii = TrytesHelper.toAscii(trimmed);
... | [
"static stringToTrytes(str) {\n const encoded = TextHelper.encodeNonASCII(str);\n return encoded ? TrytesHelper.fromAscii(encoded) : \"\";\n }",
"function autoConvert(str) {\n\ttry { return JSON.parse(str) }\n\tcatch(e) { return str }\n}",
"static objectFromTrytes(trytes) {\n if (typeof ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
toggles low_inventory in state | toggleRefill() {
this.setState({
low_inventory: !this.state.low_inventory
})
} | [
"function updateInventory() {\n for (let key in state) {\n if (!inventory[key]) {\n // Hoppa över ifall key inte finns i inventory.\n continue\n }\n state[key] ? inventory[key].status = true : inventory[key].status = false\n }\n }",
"toggleInventoryDelete(state, inventory) {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Add the Menu items of the Product Version dropdown | loadProductVersionsDropDown(prName) {
LoadProductVersions.productVersionsDropdown(prName).then((response) => {
let i = 0;
const array = [];
if (response.length > 0) {
for (i; i < response.length; i++) {
array.push(<MenuItem value={i} key={i... | [
"function populateVersions() {\n serverDetails.productVersions.forEach(function (item) {\n $(PRODUCT_VERSION).append(\"<option value='\" + item.productVersion + \"'>\" + item.productVersion + \"</option>\");\n });\n}",
"function loadVersions() {\n var $navHeader = $( 'header' );\n var $additionalVersio... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Public function `instance`. Returns true if `data` is an instance of `prototype`, false otherwise. Falls back to testing constructor.name and Object.prototype.toString if the initial instanceof test fails. | function instance (data, prototype) {
try {
return instanceStrict(data, prototype) ||
data.constructor.name === prototype.name ||
Object.prototype.toString.call(data) === '[object ' + prototype.name + ']';
} catch (error) {
return false;
}
} | [
"function instance(data, prototype) {\n try {\n return instanceStrict(data, prototype) || data.constructor.name === prototype.name || toString.call(data) === \"[object \" + prototype.name + \"]\";\n } catch (error) {\n return false;\n }\n }",
"function instance(data, prototype) {\n try {\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
find the recipes in both 2 arrays, the complete recipe goes to arr1 | function recsInBothArrs(arr1, arr2) {
const intersectRecs = arr1.filter(a => arr2.some(b => a.idMeal === b.idMeal));
return intersectRecs;
} | [
"function hotSingles(arr1, arr2) {\n let firstFilter = arr1.filter(e => !arr2.includes(e));\n let secondFilter = arr2.filter(e => !arr1.includes(e));\n let combined = [...firstFilter, ...secondFilter];\n\n return combined.filter((e, i) => combined.indexOf(e) === i);\n}",
"function similar(arr1, arr2) {\r\nvar... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Return a JSON parsed env var (eg, VCAP_SERVICES etal) | function getJsonEnvVar (envVar) {
const envVal = process.env[envVar]
if (envVal == null) {
error(`env var ${envVar} was unexpectedly not set, using {}`)
return {}
}
try {
return JSON.parse(envVal)
} catch (err) {
error(`env var ${envVar} was not valid JSON, using {}: ${envVal}`)
return {}... | [
"processServiceEnv(){\n var serviceDefaults = {\n ID: process.env.SERVICE_ID,\n Name: process.env.SERVICE_NAME,\n Address: process.env.SERVICE_ADDRESS,\n Port: process.env.SERVICE_PORT || -1,\n Tags: process.env.SERVICE_TAGS ? process.env.SERVICE_TAGS.sp... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Chain download images from imageList array Saving .png files to /images directory | function downloadImages(id) {
var afterresp = request.post(uri_img + id).on('response', function () {
if (afterresp.response.statusCode == 200) {
var got = item_count+1;
console.log('Downloaded Image (' + got + '/'+ imageList.length + '): ' + id);
var filename = dir_images + '/' + id + '.png';
afterresp.... | [
"function downloadImages() {\r\n\tif (issueImages.length == 0) {\r\n\t\t// Done\r\n\t\tfinish();\r\n\t} else {\r\n\t\t\r\n\t\t// Download file, then call recursive.\r\n\t\timage = issueImages.pop();\r\n\t\tfs.mkdirp(path.dirname(image.path));\r\n\r\n\t\tconsole.log(\"Downloading image: \" + image.fullPath);\r\n\t\t... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Delete User in Firebase Database | DeleteUserDatabase() {
let database = firebase.database();
let dbRef = database.ref();
// Get Node with all users
let usersRef = dbRef.child("users");
// Get Unique Key for New User
let newUserkey = this.UserId;
let userObject = {};
// Construct JSON Object for User
userObject["/user... | [
"function deleteUser() {\n firebase\n .database()\n .ref('users/1234')\n .remove();\n }",
"function deleteUser(key) {\n usersRef.child(key).remove()\n}",
"function userAccountDelete(){\n // using delete will return a promise, and it will activate the onDelete function in the firebase.fu... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
copies over the results into one of our own objects | function copyResults(result, config) {
var r = {};
// copy over
Object.keys(result).forEach(function (key) {
r[key] = result[key];
});
// because Array's start at 0.
r.line -= 1;
// pass the user config along with it
r.config = config;
return r;
} | [
"function copyResults(result, config) {\n var r = {};\n Object.keys(result).forEach(function (key) {\n r[key] = result[key];\n });\n r.line -= 1;\n r.config = config;\n return r;\n }",
"_curRes (result) {\n if (result != null) {\n this._results[this._curPos()] = res... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Complete the 'maxDifference' function below. The function is expected to return an INTEGER. The function accepts INTEGER_ARRAY px as parameter. | function maxDifference(px) {
// Write your code here
let maxDifference = -1;
let minPrice = px[0];
for (let i = 1; i < px.length; ++i){
if (px[i] >= minPrice) {
const temp = px[i] - minPrice;
if (temp > maxDifference) maxDifference = temp;
continue;
}
... | [
"function findMax(arr) {}",
"function findMax(array) {\n\n}",
"function findMax(array) {\n}",
"function max_difference(arr) {\n let max = -1;\n let temp;\n for (let i = 0; i < arr.length - 1; i++) {\n temp = Math.abs(arr[i] - arr[i+1]);\n max = Math.max(max, temp);\n }\n return ma... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Modified by new Jquery Implementation / To add a leading asterik with tab name, If there is any dynamically required/required field in that tab. Arguments: 1) Tab Label Text. 2) Tab Page. Sample Call: SP_DynamicTabLabel('Supplier (T2)','mcPage_003'); | function SP_DynamicTabLabel()
{
if(arguments.length == 1)
{
var PageId = arguments[0];
var TabLabelText = "";
$("ul.tabbernav li a").each(function(anchorIndex){
TabLabelText = $(this).attr("name");
if($("#"+TabLabelText+ " #"+PageId+"").find(".dynamicRequiredLabel").attr("id") != null)
{
... | [
"function SP_DynamicTabLabel()\n{\n if(arguments.length == 1)\n {\n var PageId = arguments[0];\n var TabLabelText = \"\"; \n $(\"ul.tabbernav li a\").each(function(anchorIndex){\n TabLabelText = $(this).attr(\"name\"); \n if($(\"#\"+T... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Grading Calculating This function recalculate the overall review and grade based on the new review and grade | function reCalculateReviewAndGrade(
reviewNum,
newQualityRate,
newDifficultyRate,
newGrade,
oldOverallQualityRate,
oldOverallDifficultyRate,
oldOverallGrade
) {
// First Review Case
if (reviewNum === 0) {
return {
QualityRate: newQualityRate,
DifficultyRate: newDifficultyRate,
ne... | [
"calculatedGrade () {\n\t\t\tlet p = this.participation;\n\t\t\treturn 0.15 * p.studio + 0.05 * p.feedback + 0.05 * p.other + .75 * this.homeworkAverage;\n\t\t}",
"function recalculateAvg() {\n var gradeAvg = 0;\n var gradeWeighting = 0;\n\n // find all grade and calculate the average\n gradeTab... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Postgres has tables in lowercase if you don't escape their names. Which we don't and so let's just lowercase them. | function useLowerCaseTableNames() {
return !config.postgresql.noLowerCaseTableName;
} | [
"function encodeSQLTableRef(tableName)\n{\n var retVal = tableName;\n\n if (tableName.charAt(0) == \"_\")\n {\n retVal = \"`\" + retVal + \"`\";\n }\n else if (dwscripts.isNumber(tableName.charAt(0)))\n {\n retVal = \"`\" + retVal + \"`\";\n }\n else if (tableName.match(/\\W/))\n {\n retVal = \"`\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets a field from the collection by title | getByTitle(title) {
return new Field(this, `getByTitle('${title}')`);
} | [
"function findCustomField(type, title, field) {\n var data = hexo[\"database\"][\"_models\"]; // path to the data of all 'posts' and 'pages'\n if (type === 'posts') {\n data = data[\"Post\"]; // select either the object of all posts\n } else if (type === 'pages') {\n data = data[\"Page\"]; ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
get Access Level String | function getAccess(number){
if (number == 1) return "Read";
if (number == 2) return "Read/Run";
if (number == 3) return "Read/Run/Share";
return "Data error!";
} | [
"get accessLevel() {\n return this._options.accessLevel === \"internal\"\n ? \"\" // internal is default, so we don't have to emit it\n : this._options.accessLevel + \" \";\n }",
"GetAccesLevelName() {\n if (this.props.loginObj.accesLevelID === 1) {\n this.setStat... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Deserializes input to TagMap based on the W3C HTTP text format standard. | function deserializeTextFormat(str) {
const tags = new tag_map_1.TagMap();
if (!str)
return tags;
const listOfTags = str.split(TAG_DELIMITER);
listOfTags.forEach(tag => {
const keyValuePair = tag.split(TAG_KEY_VALUE_DELIMITER);
if (keyValuePair.length !== 2)
throw new... | [
"function parseTag(tagText) {\n \n}",
"function transform ( post, tagMap ) {\n\treturn {\n\t\t...formatWPPost( post ),\n\t\ttags: ( post.tags || [] ).map( tagId => tagMap[ tagId ] ),\n\t};\n}",
"function unpackTags(tx) {\n const tags = tx.get('tags');\n const result = {};\n for (const tag of tags) {... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This is a convenience method to start a conversation using the rest API user: the user to which a message should be sent callback: a function to which we pass the conversation object when done. The conversation object is a javascript object with an id Notes: the rest enpoint URL is contained in the msg as the serviceUR... | function startConversation(user, guid, callback) {
var endpoint = `${rest_endpoint}v3/conversations`;
var data = {
"bot": {
"id": "28:" + appID,
"name": "luislocalnotify"
},
"members": [{
"id": user
}],
"channelData": {
"tenant": {
"id": tenant_id[guid]
}
}
};
rest.post(endpoint, {
... | [
"async function startChat(user_data) {\n // register user and get user_id\n const user_id = await api.callPostApi(routes.register.host, user_data);\n\n // get conversation_id by user_id\n const conversation_id = await api.callPostApi(\n routes.conversation.host,\n user_id\n );\n\n // start talking to bo... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Signs out user and clears session and redirects to login page | signOut() {
this.loggedInUserId = '';
sessionStorage.clear();
this._router.navigate(['/Login']);
} | [
"function loggingOut(){\n\tresetLoggedIn(store[\"current_user\"]);\n\tredirectToHome();\n}",
"function logOut() {\n toDoUserOffline();\n sessionStorage.removeItem('currentUser');\n currentUser = {};\n checkAuthorization();\n }",
"function logout() {\n state.isUserLoggedIn = f... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
this function fills an array with only the sessions occuring on current day or any ahead of the month | getCurrentMonthSessions(data) {
const currentMonthSession = [];
const date = new Date();
const monthIndex = date.getMonth();
const dayIndex = date.getDate();
//we use the date object to get the current month number
data.forEach(item => {
//the date in the object is formatted as month/day... | [
"function determineSessionDate() {\n // get the last visit date from local Storage and pass as Date object\n const lastVisit = new Date(JSON.parse(localStorage.getItem('lastVisit')));\n\n // create current Date object\n const currentDate = new Date();\n\n // The difference in day\n const diffDays = Math.floor... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Execute `callback` and update the `lastExec` timestamp. | function exec() {
lastExec = Date.now();
callback.apply(self, arguments_);
} | [
"function exec(){lastExec=Date.now();callback.apply(self,args);}",
"function exec() {\n\t\t\tlastExec = Date.now();\n\t\t\tcallback.apply(self, arguments_);\n\t\t}",
"function exec() {\n\t lastExec = Date.now();\n\t callback.apply(self, arguments_);\n\t }",
"function exec() {\n last_exec =... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Emits the entirety of the current data object, which contains all caption files, and associated captions. | emitData( $origin = '' ) {
EventBus.$emit('caption_data', this.data, $origin);
} | [
"getfileNewtitle(data) {\n this.getFileTitle.emit(data);\n }",
"function setData() {\n tittle.innerText = songs[songsIndex];\n audio.src = `./audio/${songs[songsIndex]}.mp3`;\n cover.src = `./imgs/${songs[songsIndex]}.jpg`;\n}",
"synthesize() {\n const fullOutdir = path.join(this.project.out... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns metadata for all constructs in the stack. | collectMetadata(stack) {
const output = {};
visit(stack);
// add app-level metadata under "."
if (this.metadata.length > 0) {
output[construct_1.PATH_SEP] = this.metadata;
}
return output;
function visit(node) {
if (node.metadata.length > 0... | [
"function constructInfoFromStack(stack) {\n const isDefined = (value) => value !== undefined;\n const allConstructInfos = constructsInStack(stack)\n .map(construct => constructInfoFromConstruct(construct))\n .filter(isDefined)\n .filter(info => ALLOWED_FQN_PREFIXES.find(prefix => info.fqn... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
=========================================================================== Compares to subtrees, using the tree depth as tie breaker when the subtrees have equal frequency. This minimizes the worst case length. | function smaller(tree, n, m, depth) {
const _n2 = n * 2;
const _m2 = m * 2;
return tree[_n2]/*.Freq*/ < tree[_m2]/*.Freq*/ ||
tree[_n2]/*.Freq*/ === tree[_m2]/*.Freq*/ && depth[n] <= depth[m];
} | [
"function smaller(tree,n,m,depth){var _n2=n*2;var _m2=m*2;return tree[_n2]/*.Freq*/<tree[_m2]/*.Freq*/||tree[_n2]/*.Freq*/===tree[_m2]/*.Freq*/&&depth[n]<=depth[m]}",
"function smaller(tree,n,m,depth){var _n2=n*2;var _m2=m*2;return tree[_n2]/*.Freq*/<tree[_m2]/*.Freq*/||tree[_n2]/*.Freq*/===tree[_m2]/*.Freq*/&&de... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
============================================================================= Window_OmoMenuSkillEquipControl The window for showing equip/swap prompt in the skill scene. ============================================================================= | function Window_OmoMenuSkillEquipControl() { this.initialize.apply(this, arguments); } | [
"function Window_OmoMenuActorSkillEquip() { this.initialize.apply(this, arguments); }",
"function Window_SkillEquipCommand() {\n this.initialize.apply(this, arguments);\n}",
"function Window_OmoMenuActorEquip() { this.initialize.apply(this, arguments); }",
"function Window_EquipCommand() {\n this.initia... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Add logging to kafka | function _addKafkaLogger(options) {
if (options && options.kafka && options.kafka.topic) {
logger.debug('Logging to kafka');
logger.add(kafkaTransport, {
topic: options.kafka.topic,
connectionString: options.kafka.zkConnectionString,
meta: {
hostn... | [
"_subscribeForLogging() {\n const oThis = this;\n\n oThis.client.on('log', function(level, className, message, furtherInfo) {\n const msg = `cassandra log event: ${level} -- ${message}`;\n\n switch (level) {\n case 'info': {\n break;\n }\n case 'warning': {\n l... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
finds out what type the player one is playing as and finds crit methonds random proper damage output | function doDmgplayerOne(pOneElement,pOneMove){
//fire element character
if(pOneElement == "fire"){
if(pOneMove == 'fire'){
var dmg = Math.floor(Math.random() * (16 - 10 + 1)) + 10;
console.log(critChance(dmg));
}else if (pOneMove == 'earth') {
var dmg = Math.floor(Math.random() * ... | [
"function playerAttack(){\r\n\tif (level = 1){\r\n\t\tvar enemyHp = mob1.mobHp;\r\n\t\tvar playerDmg = champ1.mobDmg[Math.floor(Math.random() * champ1.mobDmg.length)];\r\n\t\tvar newEnemyHp = enemyHp - playerDmg;\r\n\t\tres = 'You hit ' + mob1.mobName + ' for ' + playerDmg + ' damage.';\r\n\t\tenemyDead();\r\n\t\te... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Function name: updateSearchInput Purpose: Function is called when the text in the input search box has changed. The value from the event is put into searchInput variable in class state. Parameters: event Return: true | updateSearchInput(event) {
this.setState({
searchInput: event.target.value
});
return true;
} | [
"function updateInput(e) {\n searchValue = e.target.value;\n}",
"function onChangeInputSearch(event) {\n setSearchInput(event.target.value)\n }",
"search (event) {\n this.props.updateSearchValue(event.target.value);\n }",
"updateSearch(event) {\n this.search = event.target.value;\n }",
"u... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
bottom left half = width: 50%, height: 50%, x: 0, y: 50% | function bottomLeftHalf() {
let window = Window.focused();
if (window) {
let screen = window.screen().flippedVisibleFrame();
let halfScreenHeight = screen.height / 2;
let halfScreenWidth = screen.width / 2;
window.setTopLeft({
x: screen.x,
y: halfScreenHeight + 22,
});
window.... | [
"function bottomHalf() {\n let window = Window.focused();\n\n if (window) {\n let screen = window.screen().flippedVisibleFrame();\n let fullScreenWidth = screen.width;\n let halfScreenHeight = screen.height / 2;\n\n window.setTopLeft({\n x: screen.x,\n y: screen.y + halfScreenHeight,\n })... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Source: Escapes special characters and returns a valid jQuery selector | function jqSelector(str)
{
return str.replace(/([;&,\.\+\*\~':"\!\^#$%@\[\]\(\)=>\|])/g, '\\$1');
} | [
"function f_jQueryEscape(selector) {\n return selector.replace(/([:.\\[])/g, \"\\\\$1\");\n}",
"function selectorEscape(val) {\n\treturn val.replace(/[ !\"#$%&'()*+,.\\/:;<=>?@\\[\\\\\\]^`{|}~]/g, '\\\\$&');\n}",
"function jqSelector(str) {\n return str.replace(/([;&,\\.\\+\\*\\~':\"\\!\\^#$%@\\[\\]\\(\\)... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Generate some random numbers to gaInputData. | function generateRandomNumbersToInputData(count) {
console.log('generateRandomNumbersToInputData: ' + count);
// Pick numbers from -1,000,000 to +1,000,000.
for (i = 0; i < count; i++) {
var num = Math.floor(Math.random() * 2000000) - 1000000;
gaInputData.push(num);
}
updateInputDat... | [
"function RandomData(fromNum,toNum){ \n\t\t\treturn parseInt(Math.random()*(toNum-fromNum) + fromNum); \n\t\t}",
"function RandomData(fromNum,toNum){ \n\t\treturn parseInt(Math.random()*(toNum-fromNum) + fromNum); \n\t}",
"function processRandom (data) {\n setRandom(data)\n}",
"newRandom()\n {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Is this view currently active? | isActiveView( view ) {
return view === this.props.currentView;
} | [
"isActive() {\n return Dashboard.getCurrentPanel() === this && this.getContext().isCurrent()\n }",
"function _isCurrentView(view) {\n return _currentView && _currentView.id === view;\n }",
"function IsActive()\n{\n\treturn m_active;\n}",
"function isActive() {\n if (root.getApplication(this.n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
google api nearby search for gus stations | function searchGus(location) {
hideListings();
var service = new google.maps.places.PlacesService(map);
service.nearbySearch({
location: location,
radius: radius,
type: ['gas_station']
}, callback);
} | [
"nearBySearch() {\n let service = new this.google.maps.places.PlacesService(this.map);\n service.nearbySearch({\n location: { lat: this.state.defaultLat, lng: this.state.defaultLng },\n radius: 5000,\n type: ['resturant']\n }, this.nearByResults);\n }",
"function nearby() {\n var request... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
get first editor options | function initEditor_tinyMCE_GetOptions(objEditorsOptions){
if(objEditorsOptions.length == 0)
throw new Error("no active editors found for options gethering");
for(key in objEditorsOptions){
var options = objEditorsOptions[key];
if(options !== null)
return(options);
}
throw new... | [
"_getEditorOption() {\n return {\n value: this.getValue(),\n language: this.getType(),\n readOnly: !this.getEditable(),\n fontSize: this.getFontSize(),\n theme: this.getTheme(),\n automaticLayout: true,\n wordWrap: \"on\",\n minimap: { enabled: false } // disable minimap t... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This function builds thre form footer which is just a button. however, the two footer options post to different backend routes . | function buildFormFooter() {
//if edit form build edit footer
let ret_val = null;
let invalid_label = (
<label for="submit-button" className="form-text text-danger mx-2">
Invalid form field detected. Correct the mistake and try again.
</label>
);
let valid_label = (
<label ... | [
"createFooter(buttons) {\n let footer = new widgets_1.Widget();\n footer.addClass('jp-Dialog-footer');\n algorithm_1.each(buttons, button => {\n footer.node.appendChild(button);\n });\n styling_1.Styling.styleNode(footer.node);\n retur... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets if the provided structure is a JsxSelfClosingElementStructure. | static isJsxSelfClosingElement(structure) {
return structure.kind === StructureKind_1.StructureKind.JsxSelfClosingElement;
} | [
"static isJsxElement(structure) {\r\n return structure.kind === StructureKind_1.StructureKind.JsxElement;\r\n }",
"static isJsxSelfClosingElement(node) {\r\n return node.getKind() === typescript_1.SyntaxKind.JsxSelfClosingElement;\r\n }",
"static isJsxTagNamed(structure) {\r\n return ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Test if a character has any levels in paladin and returns different values based on whether the character is a multiclassed paladin. If the character is not a multiclassed paladin, returns `true` or `false` if they are or are not a paladin respectively. If the character is a multiclassed paladin, `'multiclass' + ` will... | function charIsPaladin(charID) {
const multiclasses = [];
const classesToCheck = ['class'];
['multiclass1', 'multiclass2', 'multiclass3'].forEach(a => {
multiclasses.push(getAttrByName(charID, a + '_flag'));
});
multiclasses.forEach(a => {
if (a === '1') {... | [
"function charIsPaladin(charID) {\n let levelAttr;\n const classAttr = [\n 'class',\n 'multiclass1',\n 'multiclass2',\n 'multiclass3'\n ].find((a) => {\n return getAttr(charID, a).search(/paladin/i) != -1;\n });\n if (classAtt... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
inject all scripts and pageActions on a tab | function injection(tabId) {
chrome.pageAction.show(tabId);
chrome.tabs.executeScript(tabId, {file: "jquery.min.js"}, function() {
chrome.tabs.executeScript(tabId, {file: "jquery.hotkeys.js"}, function() {
chrome.tabs.executeScript(tabId, {file: "content-script.js"});
... | [
"function inject_scripts() {\n\tif (gsTabs.length > 0) {\n\t\tchrome.tabs.executeScript(gsTabs[0], {'file':'js/jquery-1.4.4.min.js'});\t\t\n\t\tchrome.tabs.executeScript(gsTabs[0], {'file':'js/sharkzapper_contentscript.js'});\n\t\tif (debug) console.log('Injected scripts into existing tab #' + gsTabs[0]);\n\t\t\n\t... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets the state of the game depending on the current object ID | function setGameState() {
if (currentObjectID === objs.length - 1) {
finishGame();
}
else {
currentObjectID++;
}
populatePageContent(currentObjectID);
} | [
"setIdGame(state, id) {\n state.id = id\n }",
"function setGameState(state){\n switch(state) \n {\n case 1:\n if(game_status.state == 2){\n resumeGame();\n }else{\n startGame();\n }\n break;\n case 2:\n pauseGame();\n break;\n }\n game_status.state = s... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Deletes the row from the database with the matching `id1` and `id2`. | deleteRow(id1, id2) {
return new Promise((resolve, reject) => {
const tableName = this._tableName;
const id1Name = this._id1Name;
const id2Name = this._id2Name;
const values = [id1, id2];
let sql = 'DELETE FROM `' + tableName + '` WHERE `' + id1Name + ... | [
"removeRelation(id1, id2) {\n return this.table.delete({\n [this.schema.tables[0]]: id1,\n [this.schema.tables[1]]: id2\n });\n }",
"function deletes(tableName, columnName1, id, columnName2, value2) {\n let query = `DELETE from ${tableName}\n WHERE ${columnName1}=\"${id}\"... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
======================================================================= Set Get Active Mail Module ========================================================================== | function setGetActiveMail() {
var href = window.location.href;
var $onBtn = $('#mail-auto-reload');
var isError = false;
if (href.indexOf("192.168.90.158/") == -1) isError = true;
if (!isError) {
var $iframe = $('#contentIframe').contents();
var INTARVAL = 10000;
var isOnFocus = true;
v... | [
"function read_active_accounts_pref() {\n // See, if this module is active (preference setting 'is_active')\n var prefs = Components.classes['@mozilla.org/preferences-service;1']\n .getService(Components.interfaces.nsIPrefService)\n .getBranch('extensions.mail_sent_notifier.');\n var active_accounts = pref... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This sets the appliedUsers array | setAppliedUsers(users) {
this.appliedUsers = users;
console.log(this.appliedUsers);
} | [
"function setUsers(list) {\n users = list\n }",
"function setCurrentEnterpriseUsers() {\n if (!$rootScope.enterprises.current) {\n console.log('Cannot set users on the current enterprise without a current enterprise');\n return false;\n }\n $rootScope.enterprises.current.set... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns all visits that match the optional `filter'. A filter object can have any of the following properties: maxTime: int minTime: int domain: string url: string category: string (not implemented) visitId: string (not implemented) | function getVisits(filter, visits) {
filter = filter || {}
var filteredVisits = [];
if (!visits) {
visits = _visits;
}
if (filter.url) {
var filterUri = parseUri(filter.url);
}
var filterDomain;
if (filter.domain) {
filterDomain = filter.domain.replace(/www./i, ... | [
"function getSessions(filter) {\n currentSessions = []\n\n var endpoint = \"/session\";\n \n switch (filter.timespan) {\n case \"This month\": endpoint += \"/month\"; break;\n case \"This week\": endpoint += \"/week\"; break;\n case \"Today\": endpoint += \"/today\"; break;\n }\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Composes two 'render functions' to produce a final render function that renders the outer function, passing the inner function as 'default render'. The inner function is then passed the original 'default render' prop. | function composeRenderFunction(outer, inner) {
return memoizer(outer)(inner);
} | [
"function composeRenderFunction(outer, inner) {\n return memoizer(outer)(inner);\n }",
"function render({ first, second }) {\n renderJSX((\n <main>\n <MyButton\n text={first.text}\n disabled={first.disabled}\n />\n <MyButton\n text={second.text}\n disabled=... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
closing a bootstrap modal with submit button: flask post data as json: / this function is called when the user submits the feedback form. it submits a post request to the flask server, which squirrels away the feedback in a file. | function submit_feedback() {
// this function is called when submit button clicked
// algorithm:
// - check if text box has content
// - check if happy/sad filled out
var smile_active = $('#modal-feedback-smile-div').hasClass('smile-active');
var frown_active = $('#modal-feedback-frown-div').ha... | [
"function handleClickSubmit() {\n \n $('.js-question-form').submit(event => {\n event.preventDefault();\n renderFeedbackPage();\n $('.js-question-form').empty();\n })\n}",
"function submitFeedback() {\n feedbackForm.submit();\n}",
"function handleSubmit() {\n hideModal()\n o... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
focuses on search bar on component mount | componentDidMount(){
this.search.focus();
} | [
"componentDidMount() {\r\n this.searchField.focus();\r\n }",
"componentDidMount() {\n this.searchbox.current.focus();\n }",
"componentDidMount(){\n\t\tthis.searchInput.focus();\n\t}",
"handleSearchFilterOnFocus(){}",
"function focus() {\n vm.inSearch = true;\n vm.onFocus();\n }",
... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
this page has a loading spinner that animates for a few seconds, this is a helper method to wait for it to disapear | async waitForLoadingAnimation() {
var i = 0;
var isVisible;
do {
var isVisible = await this.driver
.wait(
until.elementLocated(By.className(this.loader)),
this.defaultTimeout
)
.isDisplayed();
i++;
// the anmiation still needs a second to disapea... | [
"function hideLoadingSpinner() {\n $('.demo-loading').css({'display': 'none'});\n }",
"static waitToLightningBear() {\n browser.$('div[class=\"auraLoadingBox oneLoadingBox loadingHide\"]').waitForExist(EXPLICIT_TIMEOUT);\n }",
"function showLoadingSpinner(){\n loader.hidden = false;\n quoteC... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Serialize the page setup properties. | serializePageSetup(writer, pageSetup) {
if (pageSetup !== undefined) {
this.serializePageSize(writer, pageSetup);
this.serializePageMargins(writer, pageSetup);
}
// // StartElement paperSrc (if any)
// if (pageSetup.FirstPageTray > 0 || pageSetup.OtherPagesTray > ... | [
"serializePageSize(writer, pageSetup) {\n writer.writeStartElement(undefined, 'pgSz', this.wNamespace);\n // tslint:disable-next-line:max-line-length\n writer.writeAttributeString(undefined, 'w', this.wNamespace, this.roundToTwoDecimal(pageSetup.pageWidth * this.twentiethOfPoint).toString());\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Counts number of collisions between range and other_ranges | function countOverlaps(range, other_ranges) {
let count = 0;
other_ranges.forEach(r => {
if (rangesOverlap(range.start_date, range.end_date, r.start_date, r.end_date))
count++;
});
return count;
} | [
"isOverlapping(otherRange) {\n let thisFirst = this.getFirst();\n let thisLast = this.getLast();\n let otherFirst = otherRange.getFirst();\n let otherLast = otherRange.getLast();\n return (thisLast.isGreaterThan(otherFirst) && thisLast.isLessThanOrEquals(otherLast) && thisFirst.is... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Helper to create snippet file array | function createFileArray(file, directory) {
const tempArray = [];
if (file.startsWith(".")) {
return;
}
const fullname = directory + "/" + file;
if (!destination) {
destination = directory + "/output";
}
const stepOutputPath = destination + "/steps";
const codeOutputPath = d... | [
"static createSource(filename) {\n const data = fs_1.default.readFileSync(filename, \"utf-8\");\n return [\n {\n column: 1,\n data,\n filename,\n line: 1,\n offset: 0,\n },\n ];\n }",
"function... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Start the message event interval | startInterval(){
this.stopInterval();
this.interval = setInterval(() => {
this.dispatchMessageEvent();
}, parseInt(this.repeat.value));
} | [
"function start(interval) {\n\t startTracking();\n\t startSending(interval);\n\t }",
"async start() {\n debug('Starting handler');\n this.listener.on('message', async (message) => {\n try {\n await this.monitor.timer('handle-message.time', this.handleMessage(message));\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Put initial y, y after a vowel, and i between vowels into upper case. | handleYI (word) {
// Initial y
let result = word.replace(/^y/, 'Y')
if (DEBUG) {
console.log('handleYI: initial y: ' + result)
}
// y after vowel
result = result.replace(/([aeioué])y/g, '$1Y')
if (DEBUG) {
console.log('handleYI: y after vowel: ' + result)
}
// i between v... | [
"handleYI(word) {\n // Initial y\n var result = word.replace(/^y/, \"Y\");\n if (DEBUG) {\n console.log(\"handleYI: initial y: \" + result);\n }\n // y after vowel\n result = result.replace(/([aeioué])y/g, \"$1Y\");\n if (DEBUG) {\n console.log(\"handleYI: y after vowel: \" + result);\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
A function which clears all HTMLelements from the current shadowroot. | _clearAll () {
while (this.shadowRoot.firstChild) {
this.shadowRoot.removeChild(this.shadowRoot.firstChild)
}
} | [
"clearShadowRoot () {\n for (let i = 0; i < this.shadowRoot.children.length; i++) {\n this.shadowRoot.children[i].remove()\n i--\n }\n }",
"removeChilds( ) {\n if ( !this.dom ) {\n return;\n }\n\n let all = this.flattenChildren( );\n\n all.forEach( ( item ) ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
True if given File[Entry] represents an untitled document | function isUntitled(file) {
var doc = DocumentManager.getOpenDocumentForPath(file.fullPath);
return doc && doc.isUntitled();
} | [
"function isJournalFile(filename) {\n return re.test(filename);\n}",
"function arentFiles(f) {\n return !(f instanceof File);\n }",
"static isAuthor(filePath) {\n // !!!LATER!!! add verification of type URL\n return ['.naf'].indexOf(path.extname(filePath).toLowerCase()) > -1;\n }",
"function... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
sends work experiences to the backend BROKEN, should keep track of work_experiences that are deleted rather than brute forcing ask akshay for a sync function | sendExperiences () {
console.log('deprecated')
} | [
"sendExperiences () {\n var idsToRemove = []\n if (exists(this.state.user.work_experiences)) {\n this.state.user.work_experiences.map(exp => idsToRemove.push(exp.id))\n }\n removeWorkExperiencesFromStudent(idsToRemove).then(r => {\n let exps = this.state.updated_user.work_experiences || []\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Load all entries for a given Content Type from Contentful | function fetchEntriesForContentType (contentType) {
return client.getEntries({ content_type: contentType.sys.id })
.then((response) => {
console.log(chalk.green(`\n ${chalk.cyan(contentType.name)}: ${response.items.length}`))
return response.items
})
.catch((error) => {
console.log(chalk... | [
"function fetchEntriesForContentType (contentType) {\n return client.getEntries({\n content_type: contentType.sys.id\n })\n .then((response) => response.items)\n .catch((error) => {\n console.log(chalk.red(`\\nError occurred while fetching Entries for ${chalk.cyan(contentType)}:`))\n console.er... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
payloadCreator: (params, options) => zkAxios.get('/mock/users', params, options), | payloadCreator({params, options}) {
// redux 中 有错误/成功处理,不需要successTip 和 errorTip,使用 axios;
return axios.get('/mock/users', params, options); // 返回promise
} | [
"customRequest(data) {\n return axios(data);\n }",
"customRequest (data) {\n return axios(data)\n }",
"customRequest(data) {\n return axios_default()(data);\n }",
"function fetchLicenciasUser(){\n const request = axios.get(`${ROOT_URL}/licencias/read_licencias.php`);\n\n return{\n type:'fetch... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Function to map an array of numbers into their ranks e.g. rank([1, 8, 5, 3, 12, 10]) === [1, 4, 3, 2, 6, 5] | function rank(array) {
const sorted = array.slice().sort((a, b) => {return a - b})
return array.map(function findIndex(value) {
// Use average to break ties
return (_.sortedIndex(sorted, value) + 1 + _.sortedLastIndex(sorted, value)) / 2
})
} | [
"function rankUser(arr) {\n \n arr.map(function(e, i){ // Applying mapping in order to apply the same process on all the elements in the array \n e.rank = (i + 1); // Starting top of the sorted array and increase the rank\n return e;\n });\n return arr // Return the array\n}",
"func... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Concatenate along axis id 2. (Both the input0 and input1 will not be disposed. | static Concat_and_keep0_keep1() {
this.inputTensors[ 0 ] = this.input0.realTensor;
this.inputTensors[ 1 ] = this.input1.realTensor;
this.output0.realTensor = tf.concat( this.inputTensors, 2 ); // AxisId = 2
} | [
"function concat(input1, input2) {}",
"static Concat_and_destroy0_keep1() {\n try {\n this.inputTensors[ 0 ] = this.input0.realTensor;\n this.inputTensors[ 1 ] = this.input1.realTensor;\n this.output0.realTensor = tf.concat( this.inputTensors, 2 ); // AxisId = 2\n } finally {\n this.inpu... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Handle a flickr set info call A directory will be asked and created The photo information will be asked at Flickr | function handleSetInfo(data, oAuthData)
{
var setId = data.photoset.id;
var setTitle = data.photoset.title._content;
// save the data
setData[setId].title = setTitle;
// get the photos for this set
if (asyncCalls)
{
FlickrOAuth.flickrCallMethod(oAuthData, "flickr.photosets.getPhotos", {photoset_id:set... | [
"function getInfo() {\n \n log(\"Get Photo Info\");\n \n var data = {\n format: \"json\",\n api_key: API_KEY,\n csrf: CSRF,\n photo_id: PHOTO_ID,\n method: \"flickr.photos.getInfo\",\n cachebust: Number(new Date())\n };\n\n $.getJSON(SAVE_URL, data, function(infoRespo... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This gets the paths of all wikis listed in the settings | function getWikiPaths(settingsObject, outPaths) {
const settingsKeys = Object.keys(settingsObject);
outPaths = outPaths || [];
settingsKeys.forEach(function(thisKey) {
if(thisKey === '__path') {
// its one of the paths we want
outPaths.push(path.resolve(basePath, $tw.settings.wikisPath... | [
"function getWikiPaths(settingsObject) {\n const paths = Object.values(settingsObject);\n let outPaths = [];\n paths.forEach(function(thisPath) {\n if(typeof thisPath === 'object') {\n outPaths = outPaths.concat(getWikiPaths(thisPath));\n } else {\n outPaths.push(path.... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Function to draw the object cursor on the canvas | function drawCursor() {
cursorContext.clearRect(0, 0, cursorCanvas.width, cursorCanvas.height);
cursorContext.beginPath();
cursorContext.arc(mouseX, mouseY, mouseWidth, 0, 2 * Math.PI, true);
cursorContext.fillStyle = '#FF6A6A'
cursorContext.fill();
cursorContext.lineWid... | [
"function drawCursor() {\n // Begin drawing\n context.beginPath();\n \n // If a node could be placed here, draw a green cursor\n if (isInsideCanvas(cursorX, cursorY) && getNearbyNode(cursorX, cursorY, false, 2) == null) {\n context.strokeStyle = \"#008000\";\n }\n // Otherwise, draw a red ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Pref listener handler functions. Both functions assume that observer.domain is set to the pref domain we want to start/stop listening to. | function addPrefListener(observer)
{
try {
Services.prefs.addObserver(observer.domain, observer);
} catch(ex) {
dump("Failed to observe prefs: " + ex + "\n");
}
} | [
"function listen_for_pref_updates(callback, trigger){\n pref_listener = new PrefListener(constants.pref_branch, callback);\n pref_listener.register(trigger);\n }",
"observe() {\n ipcMain.on('read-app-preferences', this._readHandler);\n ipcMain.on('update-app-preference', this._changeHandler... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
function routine to simulate a simple WM provider | function simulateWMProvider() {
console.log("connected to the user's WM provider!");
// set the monetization state
document.monetization.state = 'started';
document.monetization.dispatchEvent(monetizationstartEvent);
console.log("got the first micro-payment from the client!");
... | [
"function wmfr(wmName, wmWidth, wmHeight, wmDiv) {\n\tvar myWm;\n\tmyWm = '<EMBED type=\"application/x-mplayer2/\" pluginspage=\"http://microsoft.com/windows/mediaplayer/en/download/\" id=\"mediaPlayer\" name=\"mediaPlayer\" displaysize=\"4\" autosize=\"-1\" bgcolor=\"darkblue\" showcontrols=\"true\" showtracker=\"... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Bins the generated timestamp into the same itnerval set with var timeGrouping | function binTimestamp(timestamp) {
timestamp = parseInt(timestamp);
var divVal = null
switch (timeGrouping) {
case 'minute':
divVal = 1000 * 60;
break;
case 'second':
divVal = 1000;
break;
case 'millisecond':
divVal = 1;
break;
default:... | [
"function bin_by_time(span) {\n return {\n func: function(datum) {\n let date = new Date(datum/1000);\n return Math.floor((date.getHours() + date.getMinutes()/60) / span);\n },\n count: 24/span\n };\n}",
"joinTimestamp(splitTimestamp) {\n let nl, ns;\n let out = null;\n if (\n s... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Return a prox proxy for a new `obj`. | fork( obj){
const newProx= new (AggroProx())( obj, this)
return newProx.proxied
} | [
"static make( obj= {}, opts){\n\t\tvar p= new Prox( obj, opts)\n\t\treturn p.proxied\n\t}",
"function create(obj) {\n return new Prototypes({ base: obj }).proxy;\n}",
"function createProxy(base) {\n if (isPlainObject(base) || Array.isArray(base)) {\n if (isProxy(base)) return base // avoid ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Plot the selfscore and rstp data | function plot() {
$('#gen-label').text(`Generation ${genPlot}`);
Plotly.newPlot('self-score-data', selfScoreData[genPlot], layout);
Plotly.newPlot('rstp', rstpData[genPlot], {title: 'RSTP'});
console.log('rstpData:');
console.log(rstpData);
} | [
"function PlotRT() {\n options.xaxis.show = true;\n $.plot($(\"#phRT\"), dsRunningTotal, options);\n $(\"#phRT\").UseTooltip();\n}",
"function showScatterPlot(data) {\n $(\"#d3container\").empty();\n\n\t\t//set margins & width\n var margins = {\"left\": 50, \"right\": 30, \"top\": 30,\"bott... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Function that use Gigya Login | function login() {
document.getElementById("errorLogin").style = "display:none";
let myGigya = new MyGigya();
myGigya.showTermsLink = false;
myGigya.headerText = "Please Login using one of the following providers:";
myGigya.height = 300;
myGigya.width = 483;
myGigya.containerID = "loginDiv";... | [
"function GuestLogin() { }",
"function loginUser() \n{\n gapi.auth.authorize(\n {\n 'client_id': CLIENT_ID,\n 'scope': SCOPES.join(' '),\n 'inmediate': true\n },\n function(authResult) \n {\n if (authResult) {\n console.log(... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
compare products by price and color; | function compare_products(product1, product2) {
let price1 = parseInt(product1.getElementsByClassName('price-value')[0].innerText.trim());
let price2 = parseInt(product2.getElementsByClassName('price-value')[0].innerText.trim());
if (price1 === price2) {
let color1 = product1.getElementsByClassName('color-va... | [
"function compareByPrice(prod1, prod2)\n{\n return prod1.price - prod2.price;\n}",
"function calculatePriceColor(color = \"Blue\") {\n // color pricing\n switch (color) {\n case \"Black\":\n objPrice.color = 59.95;\n break;\n case \"Red\":\n objPrice.color = 65.95;\n break;\n case ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
function to display a canvasjs chart about typing speeds | function displayChart() {
var chart = new CanvasJS.Chart("chartContainer", {
animationEnabled: true,
theme: "light2", // "light1", "light2", "dark1", "dark2"
title: {
text: "Typing Speeds"
},
axisY: {
title: "Percentage of Population",
suffix: "%",
includeZero: false
},
axisX: {
... | [
"function displaySpeedUpText()\n{\n if (speedUpText === \"OFF\")\n {\n canvasContext.textAlign = \"center\";\n canvasContext.font = \"40px Comic Sans MS\";\n canvasContext.fillText(\"Game Speeds Up!\", canvas.width/2, canvas.height/2);\n speedUpWaitTimer -= elapsed;\n if (sp... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets the time that given category is disabled until for rate limiting | function disabledUntil(limits, category) {
return limits[category] || limits.all || 0;
} | [
"function disabledUntil(limits, category) {\n return limits[category] || limits.all || 0;\n }",
"function disabledUntil(limits, category) {\n return limits[category] || limits.all || 0;\n}",
"function isRateLimited(limits, category, now = Date.now()) {\n return disabledUntil(limits, category) > now;\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Set process.env from .env | function env() {
var e;
try {
e = fs.readFileSync('.env', { encoding: 'utf-8' }).split('\n');
} catch (b) {
return;
}
for (var i = 0; i < e.length; i++) {
process.env[e[i].split('=')[0].trim()] = e[i].split('=')[1].trim();
}
} | [
"setProcKeys() {\n const env = process.env.NODE_ENV;\n Object.keys(this[env]).forEach((param) => {\n process.env[param.toUpperCase()] = (this[env][param]);\n });\n process.env.NAME = this.name;\n process.env.NAMESPACE = this.namespace;\n process.env.BUNDLEPATH = `http://${process.env.HOST}:${... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
requires a boxObj with the main dialogue window, and a max of 3 dialogue options for the character. Also requires a stringObj with the text for the NPC, and the player object text | function dialogueBoxes(boxObj, string, leftOffset, topOffset, size, ctx, textColor) {
button.render(boxObj)
wrapText(
ctx,
string.toString(),
boxObj.left + leftOffset,
boxObj.top + topOffset,
boxObj.right - boxObj.left - 30,
50,
size,
textColor
);
} | [
"function addDialogues(){\n dialogues={\n\n//npc_name:{font_name, key to press to go to the next 'scene', key to press to exit the dialogue, which face to use(disabled by default)\n gray_critter:{ font:\"small\", skipkey:\"a\", esckey:\"b\", who: faces,\n scenes:[\n//each 'scene' corresponds t... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
make a checkgameover function to know when the game is over replace with the array group in | function checkGameOver() {
if (predatorGroup[0].health <= 1 || predatorGroup[1].health <= 1 || predatorGroup[2].health <= 1) {
playGame = "E";
console.log("game over");
}
} | [
"function checkForGameOver() {\n if (matched === totalPairs) {\n gameOver();\n }\n}",
"function gameOver() { }",
"function gameovercheck(){\n if(faim===0&&soif===0&&fun===0&&gameover===0){\n alert(\"Game Over!\");\n gameover++;\n childYodaHand... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
this function draws the playArea, the shadow and the pixel perfect falling block | function drawPlayAreaWithFallingBlock() {
let x;
let y;
const c = document.getElementById("playAreaCanvas");
const ctx = c.getContext("2d");
ctx.clearRect(0, 0, c.width, c.height);
// copy currentCalculationArea to tempCalculationArea
const numberOfRows = curr... | [
"function drawShadow() {\n\n // let's try to move the block downwards and look for overlap\n\n const numberOfRows = currentCalculationArea.length;\n let shadowCanBeMoved;\n let yModifier = 0;\n let isRectangleFilled;\n do {\n shadowCanBeMoved = true;\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
delete photos from galleries, clears their existence in photo list | function deletePhotosFromGallery(galleryTitle, photos) {
var gallery, galleryPhotos, _iteratorNormalCompletion4, _didIteratorError4, _iteratorError4, _iterator4, _step4, photo;
return regeneratorRuntime.async(function deletePhotosFromGallery$(_context5) {
while (1) {
switch (_context5.prev = _context5.ne... | [
"function removeAllPhotos() {\n del('./storage/photos/*.*').then(() => {\n Photo.remove({}).then((err) => { })\n })\n}",
"async function deletePhotosFromGallery(galleryTitle, photos) {\n const gallery = await galleries.findOne({ galleryTitle: galleryTitle })\n const galleryPhotos = new Set(gall... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
get all favorites for a particular user. | function getFavoritesByUserID(userid){
return db('yfusers as y')
.join('favorites as f', 'f.user_id', 'y.id')
.join('livereviews as m', 'f.review_id', 'm.id')
.select('y.id as loggedInUser', 'y.username', 'm.id as favoriteID', 'm.business_name', 'm.address', 'm.city', 'm.state', 'm.yelp_stor... | [
"function getUserFavorites(user){\n\turl = \"/v1/favorites/user/\" + user + \"/\";\n\tvar items = []; \n\t$.ajax({\n\t\turl: url, \n\t\ttype: 'GET', \n\t\tasync: false, \n\t\tdataType: 'json', \n\t\tsuccess: function (restaurants){\n\t\t\t$.each( restaurants, function( key, data ){\n\t\t\t\titems.push(data.restaura... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Run the maven command to package the project. `package` is a reserved word, so that's why the function is named this way. The tests are skipped because it is assumed that they have already successfully been ran in the script part of the CI build. | async function mvnPackage (logger) {
logger.log('Packaging with maven')
try {
const command = await findCommand()
await exec(
command,
['package', '-DskipTests']
)
} catch (e) {
logger.error('failed to package with maven')
logger.error(e)
throw getError('EMAVENPACKAGE')
}
} | [
"function run_tests(package_name) {\r\n\r\n if (popular_packages_set.has(package_name)) {\r\n fs.writeSync(negatives_log, package_name + '\\n');\r\n return;\r\n }\r\n\r\n let repeated_characters_result = repeated_characters(package_name);\r\n let edit_distance_result = edit_distance(packag... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns either the source argument when it is a `Function`, or the default `NOOP` function constant | function asFunction(source) {
return typeof source === 'function' ? source : exports.NOOP;
} | [
"function isUserFunction(source) {\n return (typeof source === 'function' && source !== exports.NOOP);\n}",
"function _gpfFuncImpl (params, source) {\n _gpfAssert(typeof source === \"string\" && source.length, \"Source expected (or use _gpfEmptyFunc)\");\n /*#ifdef(DEBUG)*/\n try {\n /*#endif*/... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
monitoring function wrapping arbitrary payload code | function handlerWrapper(event, context, payload, callback) {
const child_process = require("child_process");
const v8 = require("v8");
const { performance, PerformanceObserver, monitorEventLoopDelay } = require("perf_hooks");
const [beforeBytesRx, beforePkgsRx, beforeBytesTx, beforePkgsTx] = child_process.execS... | [
"function monitorCodeUse(eventName,data){\"production\"!==process.env.NODE_ENV?invariant(eventName&&!/[^a-z0-9_]/.test(eventName),'You must provide an eventName using only the characters [a-z0-9_]'):invariant(eventName&&!/[^a-z0-9_]/.test(eventName));}",
"function handlerWrapper(event, context, payload, callback)... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Standard removal of a Balloon, called by the link at mouseout. | function hideBalloon( id, event ) {
removeBalloon(id);
if (window.onBalloonHide) window.onBalloonHide(id, event);
} | [
"closeBalloon () {\n this._balloon.hide();\n }",
"function mouseout(e){\n\t\tvar rmlink = document.getElementById(\"mmyPopSummary\");\n\t\tdocument.body.removeChild(rmlink);\n}",
"function clearInfoBubble()\n\t{\n\t\tif(currentLinkInfoBubble)\n\t\t{\n\t\t\tui.removeBubble(currentLinkInfoBubble);\n\t\t... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Function isEmptyWysiwyg(): Checks WYSIWYG control for value | function isEmptyWysiwyg(field)
{
// first remove any HTML tags from the value, then check if it's empty (all spaces or s)
// explicitly adding the unicode non-breaking space and line feed/break since IE and safari
// don't seem to include them in \s
var EMPTY_REGEXP = /^(\s|\u00A0|\u2028|\u2029|&n... | [
"function isEmptyWysiwyg(field)\r\n{\r\n // first remove any HTML tags from the value, then check if it's empty (all spaces or s)\r\n // explicitly adding the unicode non-breaking space and line feed/break since IE and safari\r\n // don't seem to include them in \\s\r\n var EMPTY_REGEXP = /^(\\s|\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |