query stringlengths 9 14.6k | document stringlengths 8 5.39M | metadata dict | negatives listlengths 0 30 | negative_scores listlengths 0 30 | document_score stringlengths 5 10 | document_rank stringclasses 2
values |
|---|---|---|---|---|---|---|
This function enforces max length constraint on text boxes that use numeric keypad data input | function KeyPress()
{
// Workaround to assign max length constraint to field. Max attribute is being used for an inintended purpose.
// Whatever the string length is of the assigned this.max.length value is the maximum allowable field length.
var max_length = this.max != '' ? this.max.length : 9007199254... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function setMaxInputLength(num, dlength) {\n var inputs = document.getElementsByTagName('input');\n Array.prototype.forEach.call(inputs, function(inputField) {\n limitLength(inputField, num);\n });\n limitLength(document.getElementById('description'), dlength); \n}",
"function TextMaxLength(ob... | [
"0.6967244",
"0.6935721",
"0.68745244",
"0.68398947",
"0.68013227",
"0.68013227",
"0.68013227",
"0.68013227",
"0.68004596",
"0.67903286",
"0.6767682",
"0.6760335",
"0.67252314",
"0.6707191",
"0.6706548",
"0.67010343",
"0.667367",
"0.66701895",
"0.6627586",
"0.6615336",
"0.661... | 0.6982485 | 0 |
Checks `checkoutCreate` response data and opens new tab with webUrl | function completeCheckout(response) {
var checkout = response.data.checkoutCreate.checkout;
var checkoutId = checkout.id;
checkoutIds.push(`"${checkoutId}"`);
window.open(checkout.webUrl, "popup", "width=600,height=600");
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"navigateToGpxpressCheckoutResponse(response) {\n this.$refs.spinner.hideSpinner();\n const data = response.data;\n if (data.success) {\n const newRedirectUrl = this.orderSampleRedirectUrl;\n // window.location.href = newRedirectUrl;\n // For Iframe uncomment below code\n ... | [
"0.65818375",
"0.6415641",
"0.63691914",
"0.62700045",
"0.6137873",
"0.6091773",
"0.6056365",
"0.60140544",
"0.5901151",
"0.5871325",
"0.5728631",
"0.57161516",
"0.57118624",
"0.57051075",
"0.56663406",
"0.56394583",
"0.56176853",
"0.5600968",
"0.55921096",
"0.5565635",
"0.55... | 0.68551713 | 0 |
Update purchases information on `game` element | function updatePurchases(response) {
var checkouts = response.data.nodes;
checkouts.forEach(function(checkout) {
if (checkout.completedAt) {
// Remove completed checkout from list of checkout ids
var index = checkoutIds.indexOf(checkout.id);
checkoutIds.splice(index, 1);
v... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"update() {\n if (this.currentGold != characterData.getGold()) {\n this.audio.playSfx(\"purchase\");\n this.displayGold();\n }\n }",
"function updateOwnedPurchases(){\n arrayPurchaseTypes.forEach(function(purchase){\n document.getElementById(\"num_\"+purchase.HTML_... | [
"0.6625401",
"0.6492576",
"0.63308233",
"0.6118308",
"0.5969998",
"0.59496087",
"0.5921913",
"0.5916874",
"0.58996946",
"0.58925074",
"0.589162",
"0.5859162",
"0.58101046",
"0.5804207",
"0.579725",
"0.5774388",
"0.577201",
"0.57629085",
"0.5720831",
"0.5710152",
"0.57045585",... | 0.6810756 | 0 |
function to toggle keyword bar chart of selected topic | function toggleKeywordGraph(cardBody, keywordObj) {
// set the dimensions of the canvas
var margin = {top: 20, right: 20, bottom: 70, left: 52},
width = 600 - margin.left - margin.right,
height = 300 - margin.top - margin.bottom;
// set the ranges
var x = d3.scale.ordinal().rangeRoundBands([0, widt... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function updateActiveTopic(topic) {\n d3.selectAll(\".g-head\").attr(\"class\", topic ? \"g-head g-has-topic\" : \"g-head g-hasnt-topic\");\n if (activeTopic = topic) {\n node.classed(\"g-selected\", function(d) { return d === topic; });\n updateMentions(findMentions(topic));\n d3.selectAll(\".g-head a\... | [
"0.62107193",
"0.62107193",
"0.62107193",
"0.62107193",
"0.62107193",
"0.62107193",
"0.62107193",
"0.62107193",
"0.62107193",
"0.62107193",
"0.62107193",
"0.62107193",
"0.62107193",
"0.62107193",
"0.62107193",
"0.62107193",
"0.62107193",
"0.62107193",
"0.62107193",
"0.62107193"... | 0.6315878 | 0 |
Metodo para editar los nombres de los elementos para ser enviados al controlador | function EditarNombrePreguntasYRespuetas(){
$("#ListaPreguntas").find("div[name=pregunta]").each(function (i,pregunta) {
$(pregunta).find("input[name=TextoPregunta]").attr("name","Enunciado[" + i+ "]");
$(pregunta).find("input[name=TextoRespuesta]").each(function (j,respuesta) {
$(re... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function editName (event) {\n const taskElement = this.parentElement;\n const task = list.getTask(taskElement.id);\n this.remove();\n const input = document.createElement(\"input\");\n taskElement.insertBefore(input,taskElement.firstChild.nextSibling);\n input.type = \"text\";\n input.value = ... | [
"0.66753155",
"0.64953953",
"0.64710784",
"0.64603007",
"0.62862873",
"0.62788916",
"0.62233937",
"0.62089676",
"0.6208714",
"0.6208714",
"0.6180942",
"0.61794025",
"0.6174097",
"0.6150707",
"0.612903",
"0.60903233",
"0.6087555",
"0.60807836",
"0.60419846",
"0.6018315",
"0.60... | 0.7135322 | 0 |
on mount it makes a api call to get all the active listings | componentDidMount() {
fetch(`${config.API_ENDPOINT}/listings`, {
method: 'GET',
headers: {
'content-type': 'application/json'
}
})
.then(res => res.json())
.then(listingsRes => this.setState({ listings: listingsRes }));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function loadListings() {\n fetch_auth_info().then(res => getListings());\n}",
"componentDidMount()\n {\n // Access the default listings endpoint.\n axios.get( 'http://localhost:4000/listings/' )\n .then( response =>\n {\n // I'm guessing we got back an ar... | [
"0.7446197",
"0.6799908",
"0.6798356",
"0.6732586",
"0.6676828",
"0.6676828",
"0.6643795",
"0.6623296",
"0.65857685",
"0.6565182",
"0.6502206",
"0.649268",
"0.6451968",
"0.6424668",
"0.6403554",
"0.63851225",
"0.6364282",
"0.6357049",
"0.6352693",
"0.63503563",
"0.63255316",
... | 0.71286964 | 1 |
Temp endpoint to get geojson data for testing. | function getGeoJson () {
const endpoint = 'geo/roads';
return new Promise((resolve, reject) => {
console.log(`[GET]: ${apiUrl}${endpoint} - Request`);
request.get(`${domain}${apiUrl}${endpoint}`)
.end((err, asyncRes) => {
if (err) {
return reject(err);
}
const result... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"getGeoJson() {\n\treturn API.get('airwaretest', '/').then(geojsonFeaturesCollection => {\n\t\treturn geojsonFeaturesCollection;\n\t});\n }",
"function getGeoJSON(){\n\n\t$.getJSON(geojsonPath,function(data){\n\t\tconsole.log(data)\n\n\t\t// put the data in a global variable\n\t\tgeojson_data = data;\n\n\t\t// c... | [
"0.8327893",
"0.7303613",
"0.7279252",
"0.69233227",
"0.6802513",
"0.67964005",
"0.67388195",
"0.66290843",
"0.6600342",
"0.6579976",
"0.6531977",
"0.6477369",
"0.639582",
"0.63809353",
"0.6370336",
"0.6346509",
"0.6337123",
"0.63113016",
"0.6282069",
"0.62564045",
"0.6239552... | 0.75232667 | 1 |
For poster icons to work, you must go to the site's admin settings and paste this into the search field: public_user_custom_fields Then add these two custom fields to the list, so they are exposed to the client side and made public: directoryopus_link_edition directoryopus_link_version Do not add any of the plugin's ot... | function posterIconCallback(cfs, attrs) {
if (attrs.staff) {
return; // Our staff users have titles via groups that we don't want to mess with.
}
var version = cfs.directoryopus_link_version;
var edition = cfs.directoryopus_link_edition;
if (version || edition) {
if ((new Date() - new Date(attrs.created_at)) >... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function LinkField() { }",
"function addCustomButton(){\n var a = {};\n for (d in attributes) a[attributes[d]] = arguments[d];\n mwCustomEditButtons.push(a);\n}",
"get perm_media () {\n return new IconData(0xe8a7,{fontFamily:'MaterialIcons'})\n }",
"function setupLinkFields() {\n var form = $('#link_p... | [
"0.52999353",
"0.51032275",
"0.49911147",
"0.49589893",
"0.49462938",
"0.49461943",
"0.48579636",
"0.48278955",
"0.47704497",
"0.47704497",
"0.4737723",
"0.46966484",
"0.46853706",
"0.46759057",
"0.46494386",
"0.46264666",
"0.45940003",
"0.45733443",
"0.45733443",
"0.4572011",
... | 0.5753366 | 0 |
Load a list of assets from a config | loadAssets(config) {
if (config === null || !("assets" in config)) {
return;
}
for (let name in config.assets) {
let asset = config.assets[name];
this.assets_[name] = this.load3DAsset_(name, asset);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function loadAssets(items) {\r\n\r\n // Track the assets that we start loading.\r\n var loadingAssets = [];\r\n\r\n each(items, function (item, i) {\r\n if (!isFunction(item)) {\r\n\r\n // Get / parse the asset, adding it to our list.\r\n item = getAsse... | [
"0.63783056",
"0.6340919",
"0.6322429",
"0.6251235",
"0.6195364",
"0.619051",
"0.61514544",
"0.6110854",
"0.6075362",
"0.59470266",
"0.59231424",
"0.5914742",
"0.57958907",
"0.57827365",
"0.5763418",
"0.5751843",
"0.5726743",
"0.57147664",
"0.568004",
"0.5661274",
"0.5661274"... | 0.81327367 | 0 |
Helper function to setup a default material for Sop Override | setDefaultMaterial(asset) {
// Find the material:
let node = asset;
while (!node.material && node.children && node.children.length > 0) {
node = node.children[0];
}
// Make a copy of the material to allow SopStyle to change the color
if (node.material) {
asset.default_material = node... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"generateDefaultMaterial() {\n var materialDefault = new CGFappearance(this.scene);\n materialDefault.setShininess(1);\n materialDefault.setSpecular(1, 0.078, 0.576, 1); // Hot pink, so its noticeable\n materialDefault.setDiffuse(1, 0.078, 0.576, 1);\n materialDefault.setAmbient(1... | [
"0.6952081",
"0.6608707",
"0.6590071",
"0.6516602",
"0.6515432",
"0.6268964",
"0.61623436",
"0.6151918",
"0.6136237",
"0.61069435",
"0.60969055",
"0.60355717",
"0.6029304",
"0.60181683",
"0.6010124",
"0.59762114",
"0.5953367",
"0.59511703",
"0.5940671",
"0.587896",
"0.5875477... | 0.76636213 | 0 |
Remove all the assets | removeAllAssets() {
let list = [];
for (let name in this.assets_) {
list.push(name);
}
for (let name in list) {
this.removeAsset(name);
}
this.assets_ = {};
this.assets_2d_ = {};
this.cached_ = {};
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function assets_clean() {\n return del([dist+'*']);\n }",
"function deleteAssets( vandring ) {\n console.log(globals.assets, \"Assets\");\n var aReader = globals.assetDirectory[vandring].createReader();\n aReader.readEntries(function(results){\n console.log(\"in read entries result\",... | [
"0.79553235",
"0.78732574",
"0.7804423",
"0.7472277",
"0.74160254",
"0.7387537",
"0.73005223",
"0.7265311",
"0.7255569",
"0.702097",
"0.701063",
"0.7003656",
"0.70027375",
"0.6990081",
"0.6984229",
"0.6920526",
"0.67935497",
"0.67831045",
"0.6778714",
"0.6685166",
"0.6683274"... | 0.82151073 | 0 |
Remove the operation from the scene if present, and destruct it | deleteOperation_(obj) {
if (obj === null) return;
if (obj.children !== undefined) {
while (obj.children.length > 0) {
this.deleteOperation_(obj.children[0]);
obj.remove(obj.children[0]);
}
}
if (obj.geometry) {
obj.geometry.dispose();
delete obj.geometry;
}
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"removedFromScene() { }",
"function removeFromScene() {\n scene.remove(plane);\n scene.remove(plane.line);\n scene.remove(mountainLowObject2);\n scene.remove(mountainLowObject1);\n scene.remove(mountainHighObject1);\n scene.remove(mountainHighObject2);\n scene.remove(mountainHighObject3);\n ... | [
"0.7126498",
"0.66635245",
"0.6416453",
"0.6388966",
"0.63615686",
"0.6302816",
"0.6301151",
"0.62673885",
"0.6264179",
"0.62449735",
"0.6231422",
"0.6229564",
"0.61878943",
"0.6174243",
"0.6140154",
"0.6126081",
"0.6107472",
"0.61001927",
"0.6064414",
"0.60611993",
"0.605090... | 0.67134136 | 1 |
Implement a "singleton" of AssetManager | function AssetManager() {
if (asset_manager_ == null) {
asset_manager_ = new AssetManagerImpl();
}
return asset_manager_;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function AssetManager() {\r\n this.successCount = 0;\r\n this.errorCount = 0;\r\n this.cache = {};\r\n this.downloadQueue = [];\r\n}",
"function AssetManager() {\r\n\tthis.successCount = 0;\r\n\tthis.errorCount = 0;\r\n\tthis.imageQueue = [];\r\n\tthis.soundQueue = [];\r\n\tthis.levelQueue = [];\r\n\... | [
"0.802562",
"0.7833528",
"0.6974004",
"0.6716735",
"0.65096855",
"0.6467873",
"0.6467714",
"0.623247",
"0.61846876",
"0.61256605",
"0.6090356",
"0.6089316",
"0.60748184",
"0.60275525",
"0.6015988",
"0.6004549",
"0.5943241",
"0.59326696",
"0.582281",
"0.5796036",
"0.578046",
... | 0.8270495 | 0 |
APIs private section private Add new methods to facade | function addFacadeMethod(name, methodName) {
if (apis[name].facade) {
apis[name].facade[methodName] = function() {
var results = [];
//save debug info
apis[name].lastCall = methodName;
for (var j = 0, k = apis[name].implementations.length; j < k; j += 1)... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function addMethods () {\n\n}",
"attachMethods () {\n for (let action of Object.keys(actions)) {\n if (this[action]) {\n throw new Error(`Trying to add method \"${action}\" to new NameSilo client, but a property with that name already exists`)\n }\n\n let def = actions[action] || {}\n ... | [
"0.6808225",
"0.663202",
"0.6520741",
"0.624476",
"0.6201304",
"0.61671877",
"0.6130527",
"0.61224556",
"0.60277367",
"0.60229284",
"0.6019789",
"0.59653133",
"0.5898675",
"0.58657867",
"0.5854987",
"0.58528554",
"0.58483416",
"0.5831083",
"0.5829313",
"0.57934767",
"0.579267... | 0.6657073 | 1 |
APIs public section optional method to define a strongly typed interface for the api name API name methodList list of methods to implement or a prototype returns value of `stronglyTypedInterface`, so if one puts define call in multiple places not knowing which one runs first he will know that it was correctly defined. ... | function defineInterface(name, methodListOrPrototype) {
if (!apis[name]) {
var strong=false,methodHash = {};
if(methodListOrPrototype){
strong=true;
if (typeof(methodListOrPrototype) == typeof([])) {
for (var i = 0, l = methodListOrPrototype.length; i < ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function register(name, object) {\n if (!apis[name]) {\n defineInterface(name); //auto loosely typed;\n }\n\n if (apis[name].stronglyTypedInterface) {\n for (var iMethod in apis[name].definition) {\n if (apis[name].definition.hasOwnProperty(iMethod) && typeof(objec... | [
"0.657562",
"0.5677007",
"0.5605968",
"0.5464769",
"0.54402375",
"0.5350684",
"0.53097",
"0.52745354",
"0.523602",
"0.51601976",
"0.51201046",
"0.51157594",
"0.50978833",
"0.5084888",
"0.5076785",
"0.5057234",
"0.5036924",
"0.50299317",
"0.5008334",
"0.50004786",
"0.49939734"... | 0.76579905 | 0 |
registers an object to an api if interface was not defined, it creates a loosely typed interface name API name object object to be called with that api | function register(name, object) {
if (!apis[name]) {
defineInterface(name); //auto loosely typed;
}
if (apis[name].stronglyTypedInterface) {
for (var iMethod in apis[name].definition) {
if (apis[name].definition.hasOwnProperty(iMethod) && typeof(object[iMethod]) ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"registerAPI (obj) {\n let funcNames = Object.keys(obj);\n funcNames.forEach((name) => {\n if (typeof obj[name] === 'function') {\n this.on(name, obj[name]);\n }\n });\n return this;\n }",
"function Interface(){}",
"set objectApiName(objectApiName){this._objectApiName=objectApiName... | [
"0.65234226",
"0.6263581",
"0.61684173",
"0.6156136",
"0.61326087",
"0.60809994",
"0.60459405",
"0.6023679",
"0.6023679",
"0.6023679",
"0.6023679",
"0.6023679",
"0.6023679",
"0.59634167",
"0.5931435",
"0.5771068",
"0.568542",
"0.56692356",
"0.5646976",
"0.55581397",
"0.553974... | 0.78697306 | 0 |
Destroys the named api and prevents its facades from trying to work | function drop(name) {
if(apis[name]){
//destroy the facade to be sure - it might be referenced in lots of places and I want it dead no matter what.
apis[name].facade = null;
delete apis[name].facade;
//delete
delete apis[name];
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function apiDestroy() {\n\t\t\treturn destroy();\n\t\t}",
"_clearConversionApi() {\n\t\tdelete this.conversionApi.writer;\n\t\tdelete this.conversionApi.consumable;\n\t}",
"_clearConversionApi() {\n\t\tdelete this.conversionApi.writer;\n\t\tdelete this.conversionApi.consumable;\n\t}",
"_destroy() {\n this... | [
"0.74611866",
"0.65441424",
"0.65441424",
"0.6354455",
"0.63047814",
"0.6301261",
"0.6218939",
"0.6165677",
"0.61585003",
"0.61541724",
"0.6128161",
"0.61087054",
"0.6105585",
"0.6054792",
"0.60306484",
"0.59841746",
"0.59315723",
"0.5930651",
"0.5898479",
"0.5866801",
"0.584... | 0.802203 | 0 |
Returns a facade for a given api name The facade for a name is a singleton New objects registered after the facade was created are added to the facade on the fly | function getFacade(name) {
if (apis[name]) {
if (apis[name].facade) {
return apis[name].facade;
} else {
apis[name].facade = {};
for (var iMethod in apis[name].definition) {
if (apis[name].definition.hasOwnProperty(iMethod)){
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"api() {\n new api_1.Api(this.app);\n }",
"static Api(){\n return Api\n }",
"function addFacadeMethod(name, methodName) {\n if (apis[name].facade) {\n apis[name].facade[methodName] = function() {\n var results = [];\n //save debug info\n apis[... | [
"0.62331235",
"0.61814064",
"0.5810016",
"0.575157",
"0.5678319",
"0.56508917",
"0.56473213",
"0.5644159",
"0.5644159",
"0.5644159",
"0.5644159",
"0.5644159",
"0.5644159",
"0.56398755",
"0.56292105",
"0.5593746",
"0.55889153",
"0.5563227",
"0.55279654",
"0.5478083",
"0.541131... | 0.8010005 | 0 |
returns debug information for the last call to a given API | function getDebugInfo(name) {
if(apis[name]){
return {
errors: apis[name].lastErrors,
method: apis[name].lastCall,
apiObject: apis[name]
}
}else{
return "no such api"; //this should be an error, but it's for debug purposes anyway
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function prepareDebugInfo(){\n \n //If the proxy set an explicit reason for failure, use it. Otherwise, keep defaulting\n var errorReason = context.getVariable(\"flow.myapi.error.debugInfo.reason\") || context.getVariable(\"error.content\")||context.getVariable(\"response.content\")\n \n try{\n ... | [
"0.63334846",
"0.5754581",
"0.5754581",
"0.56844044",
"0.56844044",
"0.56844044",
"0.5683935",
"0.56571364",
"0.5614215",
"0.5576715",
"0.5543443",
"0.5406018",
"0.53884625",
"0.53785664",
"0.5330082",
"0.52967745",
"0.52739227",
"0.5271726",
"0.5240761",
"0.52370405",
"0.523... | 0.7745713 | 0 |
Set focus to email field | function setFocus()
{
$('login_email').focus();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function setFocus()\n {\n $(\"send_and_continue_btn\").focus();\n $(\"form_email_addresses\").focus();\n }",
"function emailFocus(){\n\tvar email=document.getElementById(\"email\");\n\temail.className=\"login_content_input login_content_input_Focus\";\n\t}",
"enterEmail () {\n this.emailFiel... | [
"0.79070795",
"0.7859088",
"0.7133394",
"0.71174717",
"0.70702356",
"0.7050141",
"0.6854562",
"0.68184066",
"0.67398846",
"0.6692243",
"0.6657341",
"0.66329294",
"0.6584462",
"0.6548981",
"0.65198064",
"0.6515664",
"0.6506628",
"0.65030295",
"0.6449277",
"0.6443022",
"0.64335... | 0.8434696 | 0 |
Return a string containing the Irish price | function calculateIrishPrice(gbpPrice) {
var irishVatRate = IRISH_VAT_RATE;
var ukVatRate = UK_VAT_RATE;
// Amazon add on about .03% for something else.
// Waste management charge perhaps (http://www.weeeregister.ie)?
var extraCharge = 0.03;
// Books don't have VAT
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"priceText(num) {\n str = \"\";\n for (var i = 0; i < num; i++){\n str += \"$\";\n }\n\n return str;\n }",
"function priceRating(price) {\n\tif (price == 1) {\n\t\treturn '$';\n\t}\n\telse if (price == 2) {\n\t\treturn '$$';\n\t}\n\telse if (price == 3) {\n\t\treturn '$$$';\n\t}\n\telse if (pric... | [
"0.6364139",
"0.6334401",
"0.61919224",
"0.5945892",
"0.5938549",
"0.58850926",
"0.58734673",
"0.58106863",
"0.5798613",
"0.57879835",
"0.5726315",
"0.5669857",
"0.56441563",
"0.5639721",
"0.56073874",
"0.5598696",
"0.55821556",
"0.55707246",
"0.55630815",
"0.55615306",
"0.55... | 0.70497715 | 0 |
Determine if the product listed on the current page is a book This is done by searching for a node with the text "ISBN:" | function isBook() {
var elems = document.getElementsByTagName("b");
var j = 0;
var k = 0;
var isBook = false;
while (!isBook && j < elems.length) {
var price = elems[j];
k = 0;
while (!isBook && k < price.childNodes.length) {
v... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getISBN(book){\n let isbn;\n if(book.volumeInfo.industryIdentifiers){\n isbn = book.volumeInfo.industryIdentifiers.find((isbn)=>{\n return isbn.type === \"ISBN_13\"\n })\n if(!isbn){\n isbn = \"error\"\n } else {\n isbn = isbn.identifier\n }\n } else ... | [
"0.6753912",
"0.65197074",
"0.6354018",
"0.6101045",
"0.6077348",
"0.60447973",
"0.59706837",
"0.5961793",
"0.58762205",
"0.58581614",
"0.5778292",
"0.5731682",
"0.56466174",
"0.5534848",
"0.553432",
"0.55176693",
"0.5489136",
"0.5464286",
"0.54598254",
"0.54414487",
"0.54318... | 0.8243783 | 0 |
function convertDate(timeInMillis: Number) Receives UNIX timestamp string in format 1550725040858, and returns a UK format date in format | function convertDate(timeInMillis) {
const date = new Date(parseInt(timeInMillis));
return (
("0" + date.getDate()).slice(-2) +
"/" +
("0" + (date.getMonth() + 1)).slice(-2) +
"/" +
date.getFullYear() +
" @ " +
("0" + date.getHours()).slice(-2) +
":" +
("0" + date.getM... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function convertDate(unixTime) {\n\n var date = new Date(unixTime*1000),\n yyyy = date.getFullYear(),\n mm = ('0' + (date.getMonth() + 1)).slice(-2),\n dd = ('0' + date.getDate()).slice(-2),\n\n convertedDate = mm + \"/\" + dd + \"/\" + yyyy\n return convertedD... | [
"0.66405344",
"0.656199",
"0.6488702",
"0.6360334",
"0.6336336",
"0.62474567",
"0.62025464",
"0.6090567",
"0.6054975",
"0.60397494",
"0.60066086",
"0.58701867",
"0.5869863",
"0.5858527",
"0.5857532",
"0.5848427",
"0.5821585",
"0.581631",
"0.57791895",
"0.5772453",
"0.5769603"... | 0.80350584 | 0 |
Collect all titles and their content elements | function collect() {
var title, oldDuration, style;
forEach(element, function (child) {
if (child.classList.contains('title')) {
title = child;
title._accordionInit = false;
titles.push(title);
} else if (child.classList.contains('content')) {
if (title) {
title._accordionContent = child... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"getElements(metadata) {\n let $ = Strategy.$;\n let elements = $('h1,h2,p');\n return _.flatten(_.map(elements, (element) => {\n let tagName = element.tagName;\n let content = helper.getNodeContent($(element));\n let chunks = helper.splitTextBySentence(content);\n return _.map(chunks, ... | [
"0.65628463",
"0.6545695",
"0.6500522",
"0.6464444",
"0.6377436",
"0.6272924",
"0.6251288",
"0.6212983",
"0.61032426",
"0.61019087",
"0.6085821",
"0.6066802",
"0.6030515",
"0.60190254",
"0.6004273",
"0.59255236",
"0.59047836",
"0.5888143",
"0.5795884",
"0.5769313",
"0.5761300... | 0.6660046 | 0 |
Fires when the user clicks on a title | function onTitleClick(e) {
var activeTitle;
e.preventDefault();
if (this.classList.contains('active')) {
closeTitle(this);
} else {
if (!options.allowMultiOpen) {
if (activeTitle = element.querySelector('.active.title')) {
closeTitle(activeTitle);
}
}
openTitle(this);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function onTitleClick(e) {\n var $item = $(this).closest(S_post);\n debug(\"onTitleClick: \" + $item.attr('id'));\n\n toggleItemFolded($item, true);\n //e.stopImmediatePropagation();\n}",
"function _click_title( ev ) {\n\t\t\tif ( 'none' !== _slidein ) {\n\t\t\t\tif ( _visible ) {\n\t\t\t\t\t_me.hide();\n\t\... | [
"0.768023",
"0.7627731",
"0.72791785",
"0.7176169",
"0.71485484",
"0.7025129",
"0.6992864",
"0.69659364",
"0.6929048",
"0.689971",
"0.6857734",
"0.68436253",
"0.6823388",
"0.6692039",
"0.6687992",
"0.6666587",
"0.663606",
"0.6608813",
"0.65923744",
"0.65612286",
"0.65148395",... | 0.78896856 | 0 |
Activates a title and expands its corresponding contents | function openTitle(title) {
var duration;
title.classList.add('active');
if (title._accordionContent) {
title._accordionContent.classList.add('active');
duration = UI.getTransitionDuration(title._accordionContent);
// title._accordionContent.style.transitionDuration = '0';
title._accordionContent.st... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function expand_title(id){\n if (id.css(\"display\") == \"none\"){\n \tid.css(\"display\", \"block\");\n } else {\n\tid.css(\"display\", \"none\");\n }\n}",
"show() {\n this.switchToTitlePage();\n }",
"function toggleTitle(title, show) {\n var companyTitle = $(\".acxm-company-title\", gl... | [
"0.71617085",
"0.7150894",
"0.69977254",
"0.67929816",
"0.6726329",
"0.6663554",
"0.6656264",
"0.6649197",
"0.6623816",
"0.6593194",
"0.6582218",
"0.6570971",
"0.65437955",
"0.6541143",
"0.65108186",
"0.65102535",
"0.64962894",
"0.64952713",
"0.6491867",
"0.6491342",
"0.64442... | 0.7247811 | 0 |
Deactivates a title and collapses its corresponding contents | function closeTitle(title) {
var duration;
title.classList.remove('active');
if (title._accordionContent) {
title._accordionContent.classList.remove('active');
duration = UI.getTransitionDuration(title._accordionContent);
title._accordionContent.classList.add('noanim');
title._accordionContent.style... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"updateVisibilityByTitle() {\n if (this.isEmpty()) {\n this.hide();\n }\n }",
"titleClicked() {\n this.setState({collapsed: !this.state.collapsed});\n }",
"function openTitle(title) {\n\t\tvar duration;\n\n\t\ttitle.classList.add('active');\n\t\tif (title._accordionContent) {\n\t... | [
"0.68451464",
"0.6664171",
"0.6582654",
"0.65824986",
"0.6579741",
"0.6544283",
"0.65234023",
"0.6523099",
"0.6498723",
"0.6389865",
"0.6388011",
"0.6338096",
"0.6212779",
"0.61970466",
"0.6126289",
"0.60045636",
"0.59959024",
"0.5969133",
"0.59336346",
"0.590665",
"0.5904578... | 0.6824289 | 1 |
Constructs a new AddSubscriptionsResponseAllOf. | constructor() {
AddSubscriptionsResponseAllOf.initialize(this);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getAllSubscriptions(callback) {\r\n try {\r\n var configObject = new Configuration();\r\n var instance = new CybersourceRestApi.ReportSubscriptionsApi(configObject);\r\n\r\n console.log(\"****************Get All Subscription****************\")\r\n\r\n instance.getAllSubscrip... | [
"0.54667866",
"0.5160308",
"0.50918543",
"0.4909845",
"0.48128322",
"0.4751241",
"0.47441125",
"0.47390696",
"0.473516",
"0.47316733",
"0.4700111",
"0.46853942",
"0.4656168",
"0.46475738",
"0.4634795",
"0.46237454",
"0.4549683",
"0.4526642",
"0.45263797",
"0.44663268",
"0.439... | 0.76832217 | 0 |
============ dataSiswa ============ [INSTRUCTIONS] dataSiswa adalah sebuah fungsi yang menerima parameter berupa string. String tersebut memiliki format `studentIDnamanilai`. Function akan membaca data siswa dari input dan mengubahnya menjadi array of objects. [NOTES] 1. Apabila tidak ada data tampilkan "tidak ada cata... | function dataSiswa(scoreRecord) {
var arr1 = []
var temp1 = ''
for(var i = 0 ; i < scoreRecord.length; i++){
if (scoreRecord[i] == ',') {
arr1.push(temp1)
temp1 = []
} else {
temp1 += scoreRecord[i]
}
}
arr1.push(temp1)
var arrAkhir = []
for(var i = 0 ; i < arr1.length; i... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function studentsData() {\n return {\n \"GST 101 Use of English and Communication Skill I 2 C\" : [{\n name: \"Adegbola Joel Abiodun\",\n tma1 : 7,\n ... | [
"0.52867156",
"0.5212992",
"0.5195722",
"0.51905453",
"0.51500064",
"0.49499005",
"0.4862161",
"0.4860895",
"0.48332128",
"0.48330486",
"0.48054573",
"0.47886664",
"0.47706398",
"0.47695145",
"0.47261176",
"0.47071582",
"0.4705141",
"0.4653018",
"0.46161488",
"0.4616067",
"0.... | 0.61643386 | 0 |
set default pen color | function setpencolor(pen)
{
pencolor=pen;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function DrawPen(){\r\n style = \"#FF0000\"; \r\n}",
"setDefaultColors(){\n\t\tthis.st.write(\"\\x1b[0m\");\n\t}",
"function paintBlue() {\n brushColor = 'lightblue'\n}",
"function onChangeColor() {\n ctx.strokeStyle = this.value;\n }",
"function updateColor(){\n var r = getNumber(\"red\")... | [
"0.75747824",
"0.71635896",
"0.7102291",
"0.6803899",
"0.67501736",
"0.6568259",
"0.6568259",
"0.6564369",
"0.65263563",
"0.6518399",
"0.6510216",
"0.6497472",
"0.64741224",
"0.6390145",
"0.638603",
"0.6331685",
"0.63239825",
"0.62404144",
"0.62244564",
"0.61541533",
"0.61454... | 0.81537676 | 0 |
This function renders a gold pile with correct gold value up to 1023 currently | function treasure_render_gold(total_value) {
// arranged in treasure pile draw order
if (total_value & 128) treasure_render_gold_icon(7);
if (total_value & 512) treasure_render_gold_icon(9);
if (total_value & 32) treasure_render_gold_icon(5);
if (total_value & 16) treasure_render_gold_icon(4);
if (total_va... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function treasure_render_gold(total_value) {\r\n\r\n // arranged in treasure pile draw order (Heroine Dusk behavior)\r\n\r\n if (total_value & 128) treasure_render_gold_icon(7);\r\n if (total_value & 512) treasure_render_gold_icon(9);\r\n if (total_value & 32) treasure_render_gold_icon(5);\r\n if (total_value... | [
"0.75645405",
"0.6459902",
"0.6422721",
"0.6394518",
"0.6134642",
"0.612455",
"0.61006606",
"0.5875619",
"0.5858036",
"0.58427674",
"0.58394367",
"0.5775739",
"0.57602555",
"0.575771",
"0.57361215",
"0.5735656",
"0.5732769",
"0.57295066",
"0.572322",
"0.5712858",
"0.5711872",... | 0.73854566 | 1 |
get model specified record prototype | function getPrototype(model) {
if (model.__recordPrototype) return model.__recordPrototype;
const mrProto = Object.assign({}, proto);// eslint-disable-line no-use-before-define
const extraProperties = {};
Object.keys(model.def.fields).forEach((fieldName) => {
extraProperties[fieldName] = {
enumerable... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function lookupModel( model ) {\n\t\tswitch ( typeof model ) {\n\t\t\tcase 'string' : return getClass( model ); break;\n\t\t\tcase 'function' : return model.prototype instanceof getClass( 'data.Model' ) ? model : null;\n\t\t}\n\n\t\treturn null;\n\t}",
"_getModel(className) {\n if (!this._models[className])... | [
"0.60747415",
"0.59989285",
"0.5918686",
"0.5833738",
"0.56685066",
"0.5657889",
"0.55993336",
"0.55990195",
"0.5576001",
"0.5575936",
"0.55684096",
"0.54880965",
"0.5469129",
"0.54623663",
"0.54203427",
"0.5397034",
"0.53862077",
"0.53630376",
"0.5354497",
"0.5321401",
"0.53... | 0.67185944 | 0 |
Store the currently selected settings using browser.storage.local. | function storeSettings() {
browser.storage.local.set({
configs: {
isAlert: isAlertBtn[0].checked || false,
isDown: isDownBtn[0].checked || false,
isCopy: isCopyBtn[0].checked || false,
isOpenTab: isOpenTabBtn[0].checked || false,
maxTabNum: tabNumO... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function storeSettings() {\n browser.storage.local.set({\n auth: {\n username: usernameInput.value,\n password: passwordInput.value\n },\n hooks: {\n follow: followInput.value.trim().split(\"\\n\"),\n favorite: favInput.value.trim().split(\"\\n\"),\n ril: rilInput.value.tri... | [
"0.8080616",
"0.7936435",
"0.78445345",
"0.7614016",
"0.756795",
"0.7565356",
"0.7545185",
"0.75433487",
"0.7498168",
"0.7444182",
"0.7437446",
"0.74278915",
"0.73717177",
"0.7360527",
"0.7322188",
"0.73087955",
"0.7303551",
"0.7282401",
"0.7280816",
"0.7233154",
"0.72195876"... | 0.85867506 | 0 |
save value needs to firstly, check if any row is being edited and could have new input, secondly, set the output view (method setOutput()) and thirdly, clear the edit modals (methods rowEditMode() and setOriginalRowValues()) | saveValues () {
if (this.rowInEditMode) {
this.setOutput(this.rowInEditMode);
this.setRowEditMode(null);
this.setOriginalRowValues=null;
$("[id*='tooltip']" ).remove();
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function onRowEdit(e){ \n selectedData = tableList.row(e.closest(\"tr\")).data();\n console.log(selectedData) \n showIDElement(true)\n for(fld in selectedData){\n $(\"#fld-\"+fld).val(selectedData[fld])\n }\n $(\"mode\").text(\"Update\")\n mode = \"edit\"... | [
"0.65433455",
"0.65136796",
"0.6454027",
"0.6402644",
"0.6365725",
"0.63654304",
"0.63455594",
"0.6337788",
"0.6254046",
"0.6188755",
"0.61696714",
"0.61577696",
"0.6157694",
"0.6145925",
"0.61305815",
"0.61265886",
"0.6113118",
"0.60955393",
"0.6073765",
"0.6059797",
"0.6051... | 0.7894493 | 0 |
payDebt pays the borrowed debt by appropriate portion within the capability. | payDebt() {
const debt = global.Bank.Query(this.mountObj);
if (debt === 0) return;
/* Amount here ensures the `borrow` behavior will not be triggered. */
global.Bank.PayBack(this.mountObj, this.cash + this.borrowedMoney);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function bankPay() {\n if (balance != null && pay > 0) {\n if (!loanRepaid) {\n deductLoan(0.1);\n }\n balanceElement.innerText = Number(balance) + Number(pay);\n balance = Number(balance) + Number(pay);\n currentPay.innerText = 0;\n pay=0;\n }\n if(!loanRepaid){\n outstandingLoanUpdat... | [
"0.61701775",
"0.6100032",
"0.595035",
"0.59155387",
"0.58427",
"0.57077014",
"0.5703318",
"0.5666759",
"0.56301874",
"0.5542484",
"0.552958",
"0.5486102",
"0.5426339",
"0.5424736",
"0.541664",
"0.5377045",
"0.533555",
"0.53064257",
"0.53026354",
"0.52896243",
"0.5285746",
... | 0.78564346 | 0 |
Cancel cancels the dealt. After cancellation, `buyer` will pay fine. | Cancel() {
if (this.state === TRANSACTION_STATE.DEAD) return false;
if (this.state === TRANSACTION_STATE.WAITING_FOR_CONFIRM) {
this.state = TRANSACTION_STATE.DEAD;
return true;
} else if (this.state === TRANSACTION_STATE.WORKING) {
this.Buyer.account.Ou... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function Cancel(args) {\n args.hiPayState = \"cancel\";\n HiPayProcess.Decline(args);\n}",
"function onCanceled(cancelSender, cancelReason) {\n cancel = true;\n }",
"cancel() {\n this.#cancelled = true;\n if (this.#started) {\n this.#eventTarget.trigger('forceStopAd');\n }\n }",
... | [
"0.63560987",
"0.6126479",
"0.6033653",
"0.5996241",
"0.59853417",
"0.5976216",
"0.5936184",
"0.58994406",
"0.58750474",
"0.5857765",
"0.5831848",
"0.582756",
"0.5812933",
"0.580693",
"0.580693",
"0.579158",
"0.5746888",
"0.5736384",
"0.5697173",
"0.5686937",
"0.5684839",
"... | 0.66498375 | 0 |
Get season and winner information organised into their rows and column titles | function getSeasonsProducts() {
const years = Object.keys(seasons);
return years.map(year => ({
id: year,
winnerId: seasons[year].winner.driverId,
season: <a href={seasons[year].url}>{year}</a>,
winner: (
<a href={seasons[year].winner.url}>
{`${seasons[year].win... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function handleSeasonInfo(req) {\n\tvar json;\n\ttry {\n\t\tjson = JSON.parse(req.responseText);\n\t} catch (error) {\n\t\tconsole.log(\"Unable to parse response:\\n\" + req.responseText);\n\t\treturn;\n\t}\n\tvar season = json['season']\n\tvar episode_row = gebi('episode_row');\n\t// Reset UI\n\tsetInactive('seas... | [
"0.5975011",
"0.5783266",
"0.57702863",
"0.5563776",
"0.5556794",
"0.55510485",
"0.55287105",
"0.5479653",
"0.5473069",
"0.5440809",
"0.5428607",
"0.5415866",
"0.54112786",
"0.5405862",
"0.54040635",
"0.54006845",
"0.5337511",
"0.53355265",
"0.5306057",
"0.52981424",
"0.52794... | 0.5858472 | 1 |
Changes the display settings for either the "recenter" or "testCase" state | function setStateDisplay(state) {
assert(state == "recenter" || state == "testCase" || state == "practiceFinished", "State is set to " + state + "not recenter, testCase, practiceFinished as expected");
switch (state) {
case "recenter":
// Things to hide
$("#task-instructions").c... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function changeSettings() {\n\n let elem = document.getElementById(\"anovadisplay\");\n let sets = document.getElementById(\"settings\");\n let button = document.getElementById(\"activate_settings\");\n\n if ( elem.style.display == \"none\" ) {\n elem.style.display = \"block\";\n sets.sty... | [
"0.6438614",
"0.6128977",
"0.6119997",
"0.60522413",
"0.5967709",
"0.5948424",
"0.5936808",
"0.58617634",
"0.5855316",
"0.5812975",
"0.5812212",
"0.57824826",
"0.574549",
"0.5726647",
"0.5726388",
"0.5712829",
"0.5692568",
"0.56912476",
"0.5659642",
"0.56540585",
"0.5649746",... | 0.6764102 | 0 |
Starts the filling timer | function startFillingTimer() {
if (!fillingTimer) {
fillingTime = 0;
setCenterFilling(0);
fillingTimer = setInterval(fillingTick, 25);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function fillingTick() {\n if (fillingTime < 10) {\n fillingTime++;\n setCenterFilling(fillingTime);\n } else {\n stopFillingTimer();\n setStateDisplay(\"testCase\");\n }\n}",
"function fill() {\n if (startTime === null) {\n startTime = Date.now();\n }\n const e... | [
"0.765713",
"0.70454407",
"0.6889108",
"0.6738691",
"0.6738691",
"0.65134186",
"0.6506961",
"0.6497535",
"0.64818585",
"0.6390275",
"0.638236",
"0.6381198",
"0.63721746",
"0.6322508",
"0.63094455",
"0.63071406",
"0.6297725",
"0.6297332",
"0.6283322",
"0.6273157",
"0.6249104",... | 0.84324855 | 0 |
Stops the filling timer | function stopFillingTimer() {
clearInterval(fillingTimer);
fillingTimer = null;
setCenterFilling(0);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function stopTime(){\n\ttimeBarFull2.stop();\n}",
"function end() {\n setTime(0);\n stopTimer();\n }",
"function stopTimer () {\n active = false;\n console.log('the clock has been stopped');\n}",
"function stopDraw()\n{\nclearTimeout(t);\n}",
"function stopTimer() {\n secondsElapsed = 0... | [
"0.71911156",
"0.6940972",
"0.68758667",
"0.6790129",
"0.67707086",
"0.67668813",
"0.67454517",
"0.67165077",
"0.67106885",
"0.66796696",
"0.66728973",
"0.666688",
"0.665661",
"0.6628326",
"0.66278934",
"0.6626924",
"0.6622372",
"0.66062653",
"0.6593493",
"0.6585714",
"0.6557... | 0.82401866 | 0 |
Starts the trial timer | function startTrialTimer() {
if (!trialTimer) {
trialTime = 0;
trialTimer = setInterval(function() { trialTime += 0.1 }, 100); // Increments the trial time every tenth of a second
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"startTimer() {\n\t\tvar self = this;\n\t\tself.seconds = 0;\n\t\tself.testTime = setInterval(function () {\n\t\t\tself.seconds++;\n\t\t}, 1000);\n\t}",
"startTimer() {\n Timing.start(CONST.TIMING.SWITCH_REPORT);\n }",
"startTimer(){\n timer = setTimeout(this.timerSystem, this.temps);\n }",
... | [
"0.7417299",
"0.7359802",
"0.71968585",
"0.7093216",
"0.7011607",
"0.6994655",
"0.6960646",
"0.69547987",
"0.6937724",
"0.6912484",
"0.68767065",
"0.6857257",
"0.6809366",
"0.67970324",
"0.67949015",
"0.6782738",
"0.6749998",
"0.6749673",
"0.67490935",
"0.67153484",
"0.670708... | 0.7661262 | 0 |
Stops the trial timer | function stopTrialTimer() {
clearInterval(trialTimer);
trialTimer = null;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function stopTimer() {\n\n clearTimeout(t);\n}",
"function stopTimer() {\n\ttime.delete();\n\tdoTransition(\"stop\");\n}",
"stop() {\n if (!this.timer) return;\n\n clearInterval(this.timer);\n this.timer = null;\n }",
"stop() {\n clearInterval(this._timer);\n }",
"function stopTimer() {\n ... | [
"0.75999814",
"0.7577318",
"0.753365",
"0.7520925",
"0.75199795",
"0.74961764",
"0.74744666",
"0.7461281",
"0.7455351",
"0.74163175",
"0.7370556",
"0.73660713",
"0.73342466",
"0.7310723",
"0.7305527",
"0.7304876",
"0.727851",
"0.7275774",
"0.72752446",
"0.72659975",
"0.726246... | 0.848648 | 0 |
We call this when preloading is done, to set the landing views | function onPreloadFinished() {
canvasManager.setView('particleDrift');
overlayManager.setView('home');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function init() {\n if ($('.scheduled-page').length > 0) {\n setPageUrl();\n bindEvents();\n renderSwitcher();\n renderActions();\n switchPage(data.currentView);\n }\n }",
"landing() {\n controller.view.set('viewName', 'login')\n ... | [
"0.64764327",
"0.64636034",
"0.63319474",
"0.6293439",
"0.6257859",
"0.6251561",
"0.61904097",
"0.6184354",
"0.6118532",
"0.60525",
"0.6028444",
"0.60039777",
"0.5993337",
"0.598191",
"0.59659094",
"0.59470737",
"0.59405506",
"0.5939476",
"0.59029174",
"0.5900538",
"0.5881846... | 0.6980035 | 0 |
opens bottom filter if row cols >= 10 | function filter_2_open(){
$('.table_itseft').each(function(){
if (($(this).find('table:first tr').length >= 10) && ($(this).css('display') == 'block')){
$(this).parents().filter('.in').find('.filter_2').show();
}
})
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function wjfilter() {\n\tif ($(wjGridconfig.grid.getTopPanel()).is(\":visible\")) {\n\t\twjGridconfig.grid.hideTopPanel();\n\t} else {\n\t\twjGridconfig.grid.showTopPanel();\n\t}\n}",
"function filterToggle() {\n if (window.innerWidth < 600 || document.body.clientWidth < 600) {\n // Scr... | [
"0.62683344",
"0.5772689",
"0.56255674",
"0.5575324",
"0.5522148",
"0.5485279",
"0.5357687",
"0.53446156",
"0.5340306",
"0.5338008",
"0.5330632",
"0.5325924",
"0.52728873",
"0.52500415",
"0.5245419",
"0.5234695",
"0.52227485",
"0.5196037",
"0.51619107",
"0.5139672",
"0.512588... | 0.6148741 | 1 |
if the plugin is active register processDatapoints method | function processOptions(plot, options) {
if (options.series.curvedLines.active) {
plot.hooks.processDatapoints.unshift(processDatapoints);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function processOptions(plot, options) {\n if (options.series.curvedLines.active) {\n plot.hooks.processDatapoints.unshift(processDatapoints);\n }\n }",
"function dataSet(){\n console.log(\"on time\");\n\n}",
"startDataLogger() {\n this.liveFunc.startDataLo... | [
"0.55943245",
"0.5518572",
"0.55163777",
"0.5510834",
"0.5510834",
"0.5510834",
"0.5510834",
"0.5510834",
"0.5510834",
"0.5395663",
"0.52830654",
"0.51750076",
"0.5154225",
"0.5154225",
"0.5154225",
"0.5154225",
"0.5154225",
"0.5154225",
"0.51400983",
"0.5136881",
"0.5068843"... | 0.5540182 | 1 |
Add boxshadow style to button (depending on its chosen bgcolor) | function setFocusStyle($button, bgColor) {
var rgbColor = hexToRgb(bgColor);
$button.style.boxShadow = '0 0 2px rgba(' + rgbColor +', 0.8), inset 0 0 0 1px rgba(0, 0, 0, 0.05)';
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function setFocusStyle($button, bgColor) {\n\t\tvar rgbColor = hexToRgb(bgColor);\n\t\t$button.style.boxShadow = '0 0 2px rgba(' + rgbColor +', 0.8), inset 0 0 0 1px rgba(0, 0, 0, 0.05)';\n\t}",
"function buttonDown() {\n\tbutton.style.boxShadow = '0px 0px 0px 0px rgba(0,0,0,0.0)';\n}",
"function colorThemOwn(... | [
"0.6977609",
"0.6490161",
"0.6397532",
"0.63096493",
"0.6293637",
"0.628501",
"0.61718106",
"0.603477",
"0.5971142",
"0.597085",
"0.59153813",
"0.5875034",
"0.5831308",
"0.57671756",
"0.5733027",
"0.5681661",
"0.5674655",
"0.5668583",
"0.56590456",
"0.56495833",
"0.5642839",
... | 0.7087258 | 1 |
Return a list of all currenly monitored public videos | function getPublicVideos(){
return getVideos('PublicVideos');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getVideos() {\n\t\treturn tedxWilmingtonVideos;\n\t}",
"function getUserVideos(){\n return getVideos('UserChannelVideos');\n}",
"function listVideos( callback ) {\n\n\tvar folder = nconf.get( 'rackspace:videoFolder' );\n\tvar len = folder.length;\n\n\tclient.getFiles( nconf.get( 'rackspace:container'... | [
"0.7176289",
"0.7108198",
"0.69826055",
"0.672124",
"0.6659632",
"0.6633392",
"0.6567664",
"0.6553791",
"0.65180385",
"0.6454146",
"0.64437616",
"0.6318016",
"0.63118225",
"0.619701",
"0.6182161",
"0.61089706",
"0.6095295",
"0.6065462",
"0.60572016",
"0.60463613",
"0.6040356"... | 0.7552689 | 0 |
Return stats for a given video id | function videoStats(id){
return getStats(id);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function videoDetails(id) {\r\n let options = {\r\n part: \"snippet, statistics\",\r\n id: id\r\n };\r\n return gapi.client.youtube.videos.list(options).then(\r\n function(response) {\r\n let stats = response.result.items[0].statistics;\r\n let desc = response.result.items[0].snippet.descript... | [
"0.75778127",
"0.70101327",
"0.6947674",
"0.6916527",
"0.6911514",
"0.6761472",
"0.6716358",
"0.65355295",
"0.65355295",
"0.64923894",
"0.6429727",
"0.6369924",
"0.6341169",
"0.6325538",
"0.63065034",
"0.6270846",
"0.6260368",
"0.6229602",
"0.6228205",
"0.62124836",
"0.613602... | 0.9103292 | 0 |
Add all user uploaded videos to the database | function addUserVideos(){
try{
var resultArray = [];
var channelId = YouTube.Channels.list('id', {mine: true}).items[0].id;
var videoIdList = getVideoIds(channelId);
for (let i =0 ; i<videoIdList.length ; i++){
var result = addNewVideo(videoIdList[i],'user','');
resultArray.push(result);
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"saveVideos(videos){\n\t this._VideoService.saveVideos(videos);\n\t alert('Videos saved to local storage!');\n }",
"function addNewLocalVideoPost() {\n\tvar formData = getLocalVideoPostData();\n\t\n\t$.ajax({\n url: \"/localVideo\",\n\t\ttype: \"POST\",\n\t\tdata: formData, // The form with the file inputs.... | [
"0.63372123",
"0.61689544",
"0.6130742",
"0.60304034",
"0.6024456",
"0.6003159",
"0.5980201",
"0.597571",
"0.5848446",
"0.5813445",
"0.57881314",
"0.57825667",
"0.57823163",
"0.5709265",
"0.5693351",
"0.5678592",
"0.5677855",
"0.5672002",
"0.5667927",
"0.5655547",
"0.56209034... | 0.6705457 | 0 |
Get all user uploaded videos currently in the database | function getUserVideos(){
return getVideos('UserChannelVideos');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function listVideos( callback ) {\n\n\tvar folder = nconf.get( 'rackspace:videoFolder' );\n\tvar len = folder.length;\n\n\tclient.getFiles( nconf.get( 'rackspace:container' ), function(err, files) {\n\n\t\tvar output = [];\n\n\t\tif ( err ) {\n\t\t\tcallback( err );\n\t\t\treturn;\n\t\t}\n\n\t\tfiles.forEach( func... | [
"0.6504086",
"0.6498253",
"0.6480349",
"0.64298886",
"0.6413322",
"0.6343139",
"0.6284992",
"0.6284812",
"0.6089478",
"0.6072527",
"0.60671157",
"0.60311353",
"0.60167944",
"0.6015655",
"0.59033847",
"0.5837333",
"0.5786941",
"0.57667047",
"0.57308936",
"0.5713563",
"0.570995... | 0.6848258 | 0 |
returns encrypted value of the plaintext password, with the given salt | function encryptPassword(password, salt) {
if (!password || !salt)
return '';
salt = new Buffer(salt, 'base64');
return crypto.pbkdf2Sync(password, salt, 10000, 64, 'sha1').toString('base64'); //at least 640000 times is suggested, will see later
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getPasswordHash(password, salt) {\n if (!password) {return '';}\n try {\n return crypto\n .createHmac('sha1', salt)\n .update(password)\n .digest('hex');\n } catch (err) {\n return '';\n }\n }",
"function g... | [
"0.6553714",
"0.6542936",
"0.6483942",
"0.647663",
"0.6464527",
"0.64238244",
"0.63295925",
"0.6319377",
"0.62986153",
"0.6285991",
"0.6278815",
"0.6246121",
"0.62234664",
"0.6204788",
"0.60378224",
"0.6017353",
"0.6011183",
"0.5999828",
"0.59569854",
"0.593168",
"0.5905628",... | 0.7611578 | 0 |
compares db password with the password that the client sends, by encryting it with the db salt | function authenticate(plainTextPassword, salt, dbPassword) {
if(encryptPassword(plainTextPassword, salt) === dbPassword){
return true;
}
else{
return false;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function encryptPassword(password, salt) {\n if (!password || !salt)\n return '';\n salt = new Buffer(salt, 'base64');\n return crypto.pbkdf2Sync(password, salt, 10000, 64, 'sha1').toString('base64'); //at least 640000 times is suggested, will see later\n}",
"function testPasswordEncryption(req, ... | [
"0.73779285",
"0.7062287",
"0.68553066",
"0.67921495",
"0.675864",
"0.6737806",
"0.67278",
"0.6713991",
"0.6644148",
"0.6638624",
"0.6614318",
"0.66027796",
"0.66027796",
"0.66027796",
"0.6529405",
"0.6508131",
"0.6472345",
"0.64467746",
"0.63872236",
"0.63649005",
"0.6351196... | 0.7622756 | 0 |
Get the Authorization header from request object. | function getAuthorization (req) {
if (!req.headers || typeof req.headers !== 'object') {
throw new TypeError('argument req is required to have headers property');
}
return req.headers.authorization;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getAuthorization (req) {\n if (!req.headers || typeof req.headers !== 'object') {\n throw new TypeError('argument req is required to have headers property')\n }\n\n return req.headers.authorization\n}",
"function getAuthorization (req) {\n if (!req.headers || typeof req.headers !== 'object') {\n ... | [
"0.75873315",
"0.75873315",
"0.75873315",
"0.72896314",
"0.6946573",
"0.6644365",
"0.6579246",
"0.6494141",
"0.6455295",
"0.6443306",
"0.63727236",
"0.63507366",
"0.6338562",
"0.6335019",
"0.62411904",
"0.623825",
"0.6212615",
"0.61683947",
"0.6164865",
"0.6100567",
"0.609470... | 0.7747191 | 0 |
Create feature name from name. | _calcFeatureName() {
const featurePathParts = this.options[this._name].split('/');
featurePathParts.pop();
const featureName = featurePathParts.map(BaseSubGenerator.camelize).join('/');
const FeatureName = featurePathParts.map(BaseSubGenerator.pascalize).join('/');
this.options.featureName = feat... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function formatName(name) {\r\n\t\t\t\tvar regEx = /-/g;\r\n\t\t\t\tvar tName = String(name).replace(regEx,\"_\");\r\n\t\t\t\treturn tName;\r\n\t\t\t}",
"function makeName(name) {\n switch (name.autoGenerateKind) {\n case 1 /* Auto */:\n return makeTempVar... | [
"0.67468375",
"0.6522615",
"0.63065785",
"0.6296254",
"0.62918377",
"0.6177211",
"0.6161135",
"0.6157577",
"0.6157577",
"0.6136181",
"0.6132559",
"0.61105573",
"0.610438",
"0.60670525",
"0.60463095",
"0.6030976",
"0.6025957",
"0.6021767",
"0.59946483",
"0.59797853",
"0.596597... | 0.6965979 | 0 |
Make available decades stored as the LSB of a binary number where bit 7 correspond to the 1950's and bit 0 the 2010's | function getAvailableDecades() {
var decades = 0;
var albums = $("#albums-display").children(".album-container");
for (var i = 0; i < albums.length; i++) {
var id = $(albums[i]).attr("data-year");
if (id < 1950) continue;
if (id >= 1950 && id <= 1959)
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function calcAge1(birthyear) {\n return 2037 - birthyear;\n}",
"function y2k(number) { return (number < 1000) ? number + 1900 : number; }",
"function y2k(number)\r\n{ \r\n\treturn (number < 1000) ? number + 1900 : number; \r\n}",
"function y2k(number) { return (number < 1000) ? number + 1900 : number; ... | [
"0.5309916",
"0.5303908",
"0.52717566",
"0.5268385",
"0.5259951",
"0.5259951",
"0.52339375",
"0.5224118",
"0.5140064",
"0.50780314",
"0.5062024",
"0.50176835",
"0.50036323",
"0.49883547",
"0.49805975",
"0.49525088",
"0.49514374",
"0.49326202",
"0.49142304",
"0.49070084",
"0.4... | 0.71028125 | 0 |
override fill to limit size | fill(value, start = 0, end = this.length) {
return super.fill(value, start, Math.min(MAX_CREEP_SIZE, end));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async _fill() {\n // Slide existing data to beginning.\n if (this.r > 0) {\n this.buf.copyWithin(0, this.r, this.w);\n this.w -= this.r;\n this.r = 0;\n }\n if (this.w >=... | [
"0.6098963",
"0.6004305",
"0.5993887",
"0.5832562",
"0.5822991",
"0.5800388",
"0.5750711",
"0.5747354",
"0.5747328",
"0.5707018",
"0.5695791",
"0.56853944",
"0.56738186",
"0.5662203",
"0.5628898",
"0.5601773",
"0.5576377",
"0.55201334",
"0.5485122",
"0.5449483",
"0.5444459",
... | 0.6310548 | 0 |
Passes a click on a `` to the contained ``, enabling it to handle the editing... | function passClick() {
let $span = $("span.editorClickable", this).first();
if ($span.exists()) {
startEdit.call($span, $span);
return false;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function onClick(e){\n e.preventDefault();\n attrs.$set('contenteditable', 'true');\n return originalElement.focus();\n }",
"function editClicked() {\n toggleEditButton();\n toggleContentEditable();\n toggleBorder();\n}",
"_clickEditButton(e) {\n this.toggle();\n ... | [
"0.68405765",
"0.67842114",
"0.6656826",
"0.6610418",
"0.65291786",
"0.64114314",
"0.6403246",
"0.64031816",
"0.6353271",
"0.62880534",
"0.62569654",
"0.6255704",
"0.62552965",
"0.6241489",
"0.6213252",
"0.6187306",
"0.61850977",
"0.6180817",
"0.61763287",
"0.6158114",
"0.614... | 0.71596456 | 0 |
Insert the image into a shape. | function insertImage(paint, bytes) {
return __awaiter(this, void 0, void 0, function* () {
if (paint.type === 'IMAGE' || paint.type === 'SOLID') {
// Create a new paint for the new image.
const newPaint = JSON.parse(JSON.stringify(paint));
newPaint.imageHash = figma.creat... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"addShape(shape) {\n this.shapes.push(shape);\n this.draw();\n }",
"function insertImage(elm, attrs) {\n const image = new ContentEdit.Image(attrs)\n let [node, index] = ContentTools.Tool._insertAt(elm)\n node.parent().attach(image, index)\n image.focus()\n}",
"function insertShape(... | [
"0.61435694",
"0.6006172",
"0.59576",
"0.5937435",
"0.58055454",
"0.5805443",
"0.5804147",
"0.57294846",
"0.57279515",
"0.5582757",
"0.5577946",
"0.5567715",
"0.5553587",
"0.552902",
"0.5519791",
"0.55016",
"0.54820335",
"0.54669476",
"0.54601204",
"0.54327506",
"0.5410246",
... | 0.6095069 | 1 |
input: an array of meshes. Meshes must all be in the same space, and the bbox is computed in that space. | function computeMeshesBBox(meshes)
{
var bbox = {min: new THREE.Vector3(Infinity, Infinity, Infinity),
max: new THREE.Vector3(-Infinity, -Infinity,-Infinity)};
for (var i = 0; i < meshes.length; i++)
{
var mesh = meshes[i];
mesh.geometry.computeBoundingBox();
var meshBBox =... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"boundingBox(container) {\n var maxSize = new BABYLON.Vector3(0,0,0);\n for ( var i = 0; i < container.meshes.length; i++ ) {\n // have to recompute after scaling\n //container.meshes[i].computeWorldMatrix(true);\n container.meshes[i].refreshBoundingInfo();\n var boundingInfo = container.m... | [
"0.667752",
"0.64645386",
"0.64433664",
"0.6329989",
"0.63167244",
"0.63143927",
"0.61276263",
"0.60257894",
"0.58846897",
"0.58759964",
"0.5848302",
"0.58353174",
"0.5774385",
"0.5739473",
"0.57383215",
"0.5730945",
"0.5689478",
"0.5657613",
"0.56414723",
"0.5612386",
"0.557... | 0.76173824 | 0 |
Decorator that injects a `linkState` method into the class which can take a dotseparated path and get/set values deep in state. | function NestedValueLink(klass) {
klass.prototype.linkState = function(name) {
const nameParts = name.split(".");
const currentValue = nameParts.reduce((acc, part) => {
return acc[part];
}, this.state);
const setNewValue = newValue => {
const newState = __set(this.state, nameParts, newVal... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"link (change, report) {\n if (!this.ready) console.error('nav.link called before ready')\n \n let newState = Object.assign({}, this.state)\n if (typeof change === 'function') {\n newState = change(newState)\n } else {\n Object.assign(newState, change)\n }\n // make copy, because enco... | [
"0.5471864",
"0.5460698",
"0.5429462",
"0.51565355",
"0.51384896",
"0.5123057",
"0.499577",
"0.49659067",
"0.4962221",
"0.49299818",
"0.48966348",
"0.48896855",
"0.48823914",
"0.48077762",
"0.47857973",
"0.4732121",
"0.47118115",
"0.46929657",
"0.46766785",
"0.46766785",
"0.4... | 0.6664188 | 0 |
Searches for items in a container with a given xtype This method works just like Ext.Component.query, but escapes all dots in the xtype string before calling the query method | function findByXType$static(container/*:Container*/, xtype/*:String*/)/*:Array*/ {
return container.query(xtype.split(".").join("\\."));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function search_by_type(where, query) {\n var res = new Array();\n set_result(where, res);\n var len = instances.length;\n var patt = new OCaml_type(query);\n for (var i = 0; i < len; i++) {\n var inst = instances[i];\n if (same_type(patt, inst.type)) {\n res.push(inst);\n ... | [
"0.4922703",
"0.4795054",
"0.47550502",
"0.47546342",
"0.4743719",
"0.47056505",
"0.4669453",
"0.46522883",
"0.46444073",
"0.46444073",
"0.46444073",
"0.46444073",
"0.45916098",
"0.45763332",
"0.4575219",
"0.45690787",
"0.45319754",
"0.45310953",
"0.4512607",
"0.44863796",
"0... | 0.77437085 | 0 |
Execute the given callback once the given component has been rendered. Execute the callback before returning from the call if the component is already rendered. | function afterRenderOrNow$static(component/*:Component*/, callback/*:Function*/)/*:void*/ {
if (component.rendered) {
callback();
} else {
component.on("afterrender", callback, null, {
single: true
});
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async renderedCallback() {\n if (this._hasRendered) {\n return;\n }\n try {\n this._hasRendered = true;\n //await showSpinner(this);\n await this.init();\n } catch (e) {\n //processError(this, e);\n } finally {\n /... | [
"0.6843979",
"0.6424671",
"0.60232455",
"0.60232455",
"0.60232455",
"0.59298927",
"0.5868034",
"0.5831273",
"0.58198965",
"0.58198965",
"0.58198965",
"0.57577974",
"0.57160246",
"0.56891143",
"0.5661656",
"0.5659654",
"0.56323385",
"0.56203794",
"0.55826664",
"0.5573596",
"0.... | 0.7248192 | 0 |
Clone the given component from its xtype and initialConfig. | function cloneComponent$static(component/*:Component*/)/*:Component*/ {
if (!component) {
return component;
}
return Ext.ComponentManager.create(component.initialConfig, component.xtype);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"clone(withSpec) {\n const builder = new ComponentBuilder();\n builder.spec = {\n ...this.spec,\n ...(withSpec || {})\n };\n return builder;\n }",
"cloneConfig(config) {\n\t\treturn Object.assign({}, config);\n\t}",
"function configFullClone( config, configType ) {\n\tif ( !config.has( co... | [
"0.5654441",
"0.5488278",
"0.5410655",
"0.531544",
"0.5250813",
"0.5137836",
"0.5137836",
"0.5137836",
"0.5088344",
"0.50277525",
"0.50277525",
"0.50277525",
"0.50277525",
"0.50277525",
"0.50277525",
"0.50277525",
"0.50277525",
"0.50277525",
"0.50277525",
"0.50277525",
"0.502... | 0.6861439 | 0 |
Clone the given array of components from their xtypes and initialConfigs. | function cloneComponents$static(components/*:Array*/)/*:Array*/ {
if (!components) {
return components;
}
return components.map(ComponentUtil.cloneComponent);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function deepClone(state){\n // Initiate the new state which will be returned to the\n var new_state = [];\n // Loop over each of the arrays which are acting as the X axis for the board\n for(var x = 0; x < state.length; x++){\n new_state.push(state[x].slice(0));\n }\n return new_state;\n}",
"clone(with... | [
"0.5460521",
"0.527063",
"0.51582503",
"0.5120878",
"0.50994563",
"0.5075439",
"0.5022628",
"0.49925354",
"0.4971399",
"0.4960407",
"0.4923227",
"0.48958737",
"0.48581764",
"0.48552108",
"0.48520976",
"0.48385182",
"0.48094106",
"0.47723132",
"0.47610795",
"0.47418368",
"0.47... | 0.607096 | 0 |
relation in the draw context. | function draw_relation(draw_context, mei_graph, g_elem) {
var added = [];
// Where are we drawing, and with what prefix?
var svg_elem = draw_context.svg_elem;
var id_prefix = draw_context.id_prefix;
// ID and type
var id = id_prefix + g_elem.getAttribute("xml:id");
var type = relation_type(g_elem);
// W... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function RelationLeg(relationControl, canvas, model) {\n this._relation = relationControl;\n this._canvas = relationControl.getCanvas();\n this._entity = null;\n this._model = model;\n this._view = null;\n this.draw();\n\n var name = model.getName();\n if (na... | [
"0.609213",
"0.60722333",
"0.57330084",
"0.56731033",
"0.5658002",
"0.5655865",
"0.5605732",
"0.5605732",
"0.5564212",
"0.5460685",
"0.5450601",
"0.5431856",
"0.541503",
"0.541503",
"0.5405667",
"0.53709936",
"0.53682625",
"0.53677493",
"0.53518826",
"0.53458756",
"0.5333303"... | 0.68619597 | 0 |
Helper for generating async actions (these are promisebased). Provide two params: `type`: the action type constant `fetcher`: the function object to run (args will be relayed automatically) This returns an action function you can use. | function createAsyncAction(type, fetcher) {
return function () {
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
return {
type: type,
payload: {
promise: fetcher.apply(void 0, args),
args: args,
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function generateActionCreator(requestType, actionType, id, onSuccess = () => {}) {\n return function actionCreator(id = '', par = {}, onSuccess) {\n const url = `${ROOT_URL}/posts/${id}?key=${API_KEY}`;\n const request = axios[requestType](url, par);\n const action = Object.keys(actionType... | [
"0.6244903",
"0.62099916",
"0.57707256",
"0.5753717",
"0.5716283",
"0.5710298",
"0.5553656",
"0.55233514",
"0.5452984",
"0.5452984",
"0.5416298",
"0.534585",
"0.53435946",
"0.5229724",
"0.5229303",
"0.5168772",
"0.5151287",
"0.5088506",
"0.5072717",
"0.50442004",
"0.5030559",... | 0.8790439 | 0 |
Helper to stich together any defined params into a string suitable for url arg submission | function generateParamStr(params) {
var cleanedParams = {};
Object.keys(params).forEach(function (key) {
if ({}.hasOwnProperty.call(params, key)) {
var value = params[key];
if (value !== null && value !== undefined) {
var valueStr = value;
if (value instanceof Array) {
va... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function paramsToString(params) {\n // TODO escape values as they come from user input\n return _.map(params, (val, key) => key + '=' + val).join('&');\n}",
"function BuildParamString(params)\n{\n var i = 0;\n var paramArray = [];\n for (var j = 0; j < params.length; ++j)\n {\n if (params[j]... | [
"0.7304916",
"0.69261914",
"0.68089616",
"0.6805413",
"0.66723984",
"0.6670441",
"0.6668203",
"0.6624254",
"0.6593584",
"0.6521679",
"0.65114886",
"0.65006673",
"0.6499697",
"0.64928746",
"0.6487882",
"0.6475354",
"0.6461588",
"0.6439776",
"0.6439776",
"0.6439776",
"0.6430341... | 0.71295434 | 1 |
Helper to create a promise that calls the API on the server. Pass in the endpoint url, with params encoded on it already, and this will return a promise to call it with the appropriate headers and such. It also parses the json response for you. | function createApiPromise(url, params) {
var httpMethod = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'get';
var fullUrl = url;
if (params !== undefined && params !== null) {
fullUrl = "".concat(url, "?").concat(generateParamStr(params));
}
return isomorphic_fetch__WEBPACK_IMPORT... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function requestToApi(endpointUrl) {\n return requestAccessToken()\n .then((token) => constructRequestOptions(token))\n .then((reqOptions) => fetch(endpointUrl, reqOptions))\n .then((response) => {\n if (response.ok) {\n return response.json();\n }\n throw new Error(`Server response... | [
"0.7134116",
"0.6838013",
"0.65436524",
"0.6380374",
"0.6320621",
"0.6286761",
"0.62114096",
"0.6156416",
"0.6106241",
"0.6102985",
"0.60848284",
"0.60653716",
"0.6036516",
"0.60238206",
"0.601618",
"0.5979243",
"0.59684646",
"0.596838",
"0.5957425",
"0.59196895",
"0.5893692"... | 0.69735074 | 1 |
Helper to create a promise that calls the API on the server with some POST'd data. Pass in the endpoint url, and a data object to encode and POST, and this will return a promise to call it with the appropriate headers and such. It also parses the json response for you. TODO: rename this to createFormBasedApiPromise or ... | function createPostingApiPromise(url, params) {
var httpMethod = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'post';
var formData = objectToFormData(params);
return isomorphic_fetch__WEBPACK_IMPORTED_MODULE_0___default()(url, {
method: httpMethod,
credentials: 'include',
body: ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"makeRequestPostToAPI(jsonData, endPoint) {\n return new Promise((resolve, reject) => {\n return fetch(this.api_url + endPoint, {\n body: JSON.stringify(jsonData),\n method: \"POST\",\n headers: this.headers\n })\n .then((response) => {\n return resolve(resp... | [
"0.6891231",
"0.6794437",
"0.6654315",
"0.66434896",
"0.65591645",
"0.65432733",
"0.65423733",
"0.6499629",
"0.640806",
"0.64057875",
"0.6360644",
"0.63568735",
"0.6315866",
"0.6315772",
"0.6305372",
"0.6271219",
"0.62509376",
"0.6240991",
"0.6234834",
"0.62338144",
"0.621500... | 0.7147817 | 0 |
Filter the params for a list of acceptableKeys | function acceptParams(params, acceptableKeys) {
if (params === undefined || params === null) {
return '';
}
var accepted = {};
Object.keys(params).forEach(function (key) {
if (acceptableKeys.includes(key)) {
var valueToSend = params[key] === undefined ? null : params[key];
accepted[key] = v... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function _filterParams (body) {\n let params = {};\n permittedParams.forEach(param => {\n if (body[param]) {\n params[param] = body[param];\n }\n });\n\n return params;\n}",
"function filter_params(args) {\r\n var k,\r\n len = args.length,\r\n filtered_para... | [
"0.635224",
"0.6206174",
"0.6160614",
"0.61509365",
"0.6133313",
"0.6051935",
"0.5910213",
"0.5890665",
"0.58830476",
"0.5874856",
"0.58252925",
"0.5778418",
"0.5472418",
"0.54434466",
"0.54036254",
"0.5390975",
"0.5353465",
"0.5308069",
"0.5287338",
"0.5273095",
"0.52392936"... | 0.7046484 | 0 |
Returns the list of the user's roles, or NO_ROLES if they are not logged in | function getUserRoles(user) {
if ('profile' in user && 'auth_roles' in user.profile) {
// need to check this carefully because if they aren't logged in these sub-objects won't exist
return user.profile.auth_roles;
}
return NO_ROLES;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getRoles() {\n var post = getParams();\n PermissionApi.roles({}, post).then(function (response) {\n vm.roleListing = [];\n if (!response.error) {\n _.each(response.data, function (v) {\n vm.roleListing.push(getObjectRole(v));\n });\n vm.totalItems = response.d... | [
"0.7132099",
"0.70806134",
"0.6798907",
"0.66964185",
"0.66956097",
"0.66816556",
"0.66461015",
"0.66298884",
"0.6578271",
"0.65734327",
"0.64824003",
"0.6449279",
"0.6433875",
"0.6433588",
"0.63996",
"0.63499653",
"0.63234496",
"0.6301346",
"0.6253753",
"0.6206759",
"0.61834... | 0.7625116 | 0 |
Create intl formatters and populate cache | function createFormatters(cache = createIntlCache()) {
const RelativeTimeFormat = Intl.RelativeTimeFormat;
const ListFormat = Intl.ListFormat;
return {
getDateTimeFormat: Object(intl_format_cache__WEBPACK_IMPORTED_MODULE_2__[/* default */ "a"])(Intl.DateTimeFormat, cache.dateTime),
getNumber... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function createFormatters(cache) {\n if (cache === void 0) { cache = createIntlCache(); }\n var RelativeTimeFormat = Intl.RelativeTimeFormat;\n var ListFormat = Intl.ListFormat;\n var DisplayNames = Intl.DisplayNames;\n var getDateTimeFormat = (0, fast_memoize_1.default)(function () {\n var _... | [
"0.6748534",
"0.6242551",
"0.58817714",
"0.56414557",
"0.56414557",
"0.56414557",
"0.56414557",
"0.56414557",
"0.56414557",
"0.56414557",
"0.5618062",
"0.5618062",
"0.5618062",
"0.56066763",
"0.56066763",
"0.56035686",
"0.5598032",
"0.5598032",
"0.5598032",
"0.5598032",
"0.55... | 0.6850078 | 0 |
return the URL to the favicon for a website domain | function googleFavIconUrl(domain) {
return "https://www.google.com/s2/favicons?domain=".concat(domain);
} // return our best guess for the domain name of a story | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"get faviconURI() {\n if (this.humanURI) {\n try {\n // Due to private browsing changes, the favicon will only be in places\n // if the page has been bookmarked.\n return this.faviconSvc.getFaviconForPage(this.humanURI);\n }\n catch(ex) {\n // Not bookmarked.\n i... | [
"0.730093",
"0.6781899",
"0.6777275",
"0.59975904",
"0.5946047",
"0.591525",
"0.5894322",
"0.5821849",
"0.57355326",
"0.5719617",
"0.5699441",
"0.56500494",
"0.5631691",
"0.56256187",
"0.5440171",
"0.5439846",
"0.5414365",
"0.5406482",
"0.5400747",
"0.53520983",
"0.5337956",
... | 0.75251603 | 0 |
Trim a string to a max length, adding '...' if it is too long | function trimToMaxLength(originalString, maxLength) {
if (originalString === undefined || originalString === null) {
return originalString; // is this right, or should we return empty string?
}
if (originalString.length < maxLength) {
return originalString;
}
return "".concat(originalString.substrin... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function truncate(string, max_len=50) {\r\n if (string == null) string = \"\"\r\n return string.length > max_len ? (string.substring(0, max_len) + '...') : string\r\n}",
"function trim(str, size) {\r\n return str.length > size ?\r\n str.length > 3 ? str.slice(0, size - 3).concat('...') :\r\n ... | [
"0.7921763",
"0.78657335",
"0.77585506",
"0.77339387",
"0.76881087",
"0.76774704",
"0.7665576",
"0.7632247",
"0.7632247",
"0.7629929",
"0.76251245",
"0.76141506",
"0.76141506",
"0.7601922",
"0.75423676",
"0.75322914",
"0.75281525",
"0.7370029",
"0.7344748",
"0.7319298",
"0.72... | 0.82306504 | 0 |
Use this to intl a variable when you don't know if it is a string or a message object. Important that this return the raw object if it is neither a string, nor an intl object. | function intlIfObject(formatter, value) {
if (value) {
if (typeof value === 'string') {
return value;
}
if (isIntlMessage(value)) {
return formatter(value);
}
}
return value; // it is some kind of null, so return it as is for caller to deal with (ie. render empty or cause error)
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function get(msg) {\n let input = rs.question(msg);\n if (!input || !Number.isInteger(Number(input))) {\n input = get('Integer pls.\\n');\n }\n return input;\n}",
"function getMessageVal(obj) {\n\t\t\t\treturn obj.d[1];\n\t\t\t}",
"function treatAs(value) {\r\n var s = typeof value;\r\n ... | [
"0.53909063",
"0.5263269",
"0.5208878",
"0.5153046",
"0.5153046",
"0.49786544",
"0.49786544",
"0.49227202",
"0.4899502",
"0.4899502",
"0.4899502",
"0.48953313",
"0.4892123",
"0.48786268",
"0.48786268",
"0.48737267",
"0.48679852",
"0.484622",
"0.47985888",
"0.47820935",
"0.478... | 0.55900294 | 0 |
Use this with the JS Composition pattern to make a Container that has a help button. Clicking that button brings up a dialog with the title and text from the message key that you specify. `contentHTMLTextMsg` can be a intl message or an array of intl message s. | function withHelp(contentTitleMsg, contentHTMLTextMsg, showHelpSidebar) {
return function (ChildComponent) {
var HelpfulContainer = /*#__PURE__*/function (_React$Component) {
_inherits(HelpfulContainer, _React$Component);
var _super = _createSuper(HelpfulContainer);
function HelpfulContainer()... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function callMessageDialog(title, messageContent){\n\t\t$(\"#messageDialog\").find(\"#messageContent\").text(messageContent);\n\t\t$(\"#messageDialog\").dialog({\n\t\t\tmodal: true,\n\t\t\tshow:{\n\t\t\t\teffect:\"blind\",\n\t\t\t\tduration: 500\n\t\t\t},\n\t\t\ttitle: title,\n\t\t\theight: 200,\n\t\t\twidth: 350,... | [
"0.61185205",
"0.61072725",
"0.60840106",
"0.60417545",
"0.6037534",
"0.58765644",
"0.58584857",
"0.58424866",
"0.57999945",
"0.5799498",
"0.57271194",
"0.5674412",
"0.5671008",
"0.5668213",
"0.56601095",
"0.5644325",
"0.5631326",
"0.56193084",
"0.5608464",
"0.55997646",
"0.5... | 0.6290457 | 0 |
This handles downloading a single query (samples or usergenerated) for you. To handle quotes and utf and such, we do this via a form submission (after trying lots of other options). | function postToDownloadUrl(url, query, otherData) {
// figure out if it is sample or user-created query
var data = {
index: query.index
};
if (parseInt(query.searchId, 10) >= 0) {
data.sampleId = query.searchId;
} else {
data.q = JSON.stringify(generateQueryParamObject(query, true)); // don't enc... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function doQueries (url) {\n processFile(cidadesFile, (data) => {\n const queriedUrl = replace(url, data[0])\n request.get(queriedUrl)\n .end(function (err, res) {\n if (err) console.log(err)\n else {\n console.log('queried url: ' + queriedUrl)\n console.log(eval('(' + r... | [
"0.6086394",
"0.6038018",
"0.58052266",
"0.577413",
"0.5675526",
"0.55373424",
"0.55264753",
"0.5494924",
"0.544834",
"0.54295605",
"0.54153055",
"0.5382037",
"0.53684366",
"0.53051573",
"0.52876157",
"0.52091646",
"0.5206906",
"0.5196057",
"0.51777357",
"0.51735896",
"0.5172... | 0.67021465 | 0 |
Fill gaps between days. | function fillDayGaps(data) {
var filledData = [];
var mostRecent = data[0];
data.forEach(function (d) {
if (d.date !== mostRecent.date && !Object(_lib_dateUtil__WEBPACK_IMPORTED_MODULE_11__[/* isTomorrow */ "p"])(mostRecent.date, d.date)) {
var tomorrow = Object(_lib_dateUtil__WEBPACK_IMPORTED_MODULE_11... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function fillForWeekList(days) {\n const nullDiffFilled = _.fill(_.range(7 - days.length), null);\n return _.concat(days, nullDiffFilled);\n }",
"function fillGaps(chart, start, end, step, options) {\r\n let minStep = options.timeRange.minStep || step;\r\n minStep = minStep >= step ? min... | [
"0.62503505",
"0.6099489",
"0.58246815",
"0.5663486",
"0.5574007",
"0.5531882",
"0.54526484",
"0.54407245",
"0.5433685",
"0.53824776",
"0.5350791",
"0.5303492",
"0.5234825",
"0.5172302",
"0.51099604",
"0.5107782",
"0.5066459",
"0.504159",
"0.5027379",
"0.50161254",
"0.5013727... | 0.6804149 | 0 |
wrapper to make sure we only initialize the highcharts component once | function initHighcharts() {
if (!hasBeenInitialized) {
highcharts_modules_treemap__WEBPACK_IMPORTED_MODULE_1___default()(highcharts__WEBPACK_IMPORTED_MODULE_0___default.a);
highcharts_modules_exporting__WEBPACK_IMPORTED_MODULE_2___default()(highcharts__WEBPACK_IMPORTED_MODULE_0___default.a);
highcharts_mo... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"_initHighchart() {\n // disable highcharts sorting requirement\n // gets rid of annoying \"highcharts error 15\" messages\n (function (H) {\n H.seriesTypes.line.prototype.requireSorting = false;\n })(Highcharts);\n\n // call highcharts setup function\n this.grap... | [
"0.7164426",
"0.70617956",
"0.691255",
"0.68728185",
"0.6815731",
"0.66387147",
"0.65346366",
"0.65288436",
"0.6495659",
"0.6423516",
"0.63753325",
"0.6352714",
"0.63334274",
"0.63114065",
"0.62858856",
"0.626697",
"0.62648666",
"0.62481695",
"0.6224606",
"0.62184685",
"0.617... | 0.72552186 | 0 |
Helper to download SVG files that have been rendered in the browser filename the filename you want to use, without the timestamp or .svg domIdOrElement a DOM id, or DOM element, that contains a inside of it | function downloadSvg(filename, domIdOrElement) {
var element;
if (typeof domIdOrElement === 'string') {
element = document.getElementById(domIdOrElement);
} else {
element = domIdOrElement;
}
var svgText = "".concat(SVG_HEADER).concat(element.innerHTML).concat(SVG_FOOTER);
Object(_lib_apiUtil__WEB... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function downloadSVG(name, realtime) {\n function filter(node) {\n return (node.tagName !== 'i');\n }\n let tmddown = document.getElementById(\"visualization\")\n const svgDocument = elementToSVG(tmddown)\n let svgString = new XMLSerializer().serializeToString(svgDocument)\n const blob = n... | [
"0.72205657",
"0.71314275",
"0.7128328",
"0.7033329",
"0.6978071",
"0.68007845",
"0.67208785",
"0.66865784",
"0.6531911",
"0.6531377",
"0.6489463",
"0.6474733",
"0.6462972",
"0.6450597",
"0.6409863",
"0.638636",
"0.638636",
"0.6308794",
"0.628062",
"0.62056845",
"0.6159336",
... | 0.769373 | 0 |
unused harmony export TEMP const CDN_HOSTNAME = ' Pass in an absolute path to an asset, and this will return that, or a CDN hosted version of it (in production mode). `assetPath` should be something like "/static/img/logo.png". | function assetUrl(assetPath) {
/*
if (process.env.NODE_ENV === 'production') {
return CDN_HOSTNAME + assetPath;
}
*/
return assetPath;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"get 'asset-path'() { return process.env.PUBLIC_URL ? `\"${process.env.PUBLIC_URL}\"` : '\"/\"'; }",
"function getAssetUrl(assetUrl) {\n assetUrl = relativeUrlPrefix + assetUrl;\n if (!(lang.relative_url_prefix == \"/\" || lang.host)) {\n assetUrl = lang.relative_u... | [
"0.71983176",
"0.69291073",
"0.68050236",
"0.66989964",
"0.65826476",
"0.6549128",
"0.65423167",
"0.61367303",
"0.59839475",
"0.5974621",
"0.5965842",
"0.5928487",
"0.58682156",
"0.58173716",
"0.57746553",
"0.5732404",
"0.5705926",
"0.5689351",
"0.5583399",
"0.55568546",
"0.5... | 0.8493127 | 0 |
Merge Utility Allows consumers to extend a base Select with additional styles | function mergeStyles(source, target) {
if (target === void 0) {
target = {};
}
// initialize with source styles
var styles = Select_9fdb8cd0_browser_esm_extends$3({}, source); // massage in target styles
Object.keys(target).forEach(function (key) {
if (source[key]) {
styles[key] = function (r... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function mergeOptions(parent,child,vm){{checkComponents(child);}if(typeof child==='function'){child=child.options;}normalizeProps(child,vm);normalizeInject(child,vm);normalizeDirectives(child);// Apply extends and mixins on the child options,\n// but only if it is a raw options object that isn't\n// the result of ... | [
"0.6090439",
"0.60731286",
"0.60620993",
"0.5954592",
"0.58736104",
"0.5840437",
"0.5784077",
"0.5653116",
"0.5609351",
"0.55855924",
"0.5576254",
"0.5576254",
"0.5574168",
"0.5546986",
"0.5534894",
"0.55244964",
"0.55244964",
"0.55223256",
"0.55114985",
"0.5508595",
"0.55064... | 0.6371273 | 0 |
Compare two lists of platforms (ie. topic_seed_queries) to see if there are any differences. This is needed to see if there are any changes (between the latest snapshot and the topic) that require a new version to be run. | function checkForAnyPlatformChanges(currentPlatforms, newPlatforms) {
// if different amount of platforms
var differentAmount = currentPlatforms.length !== newPlatforms.length;
if (differentAmount) {
return true;
} // new platform doesn't exist in current
var newOneThere = newPlatforms.filter(function ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function checkForAnyPlatformChanges(currentPlatforms, newPlatforms) {\n // if different amount of platforms\n const differentAmount = currentPlatforms.length !== newPlatforms.length;\n if (differentAmount) {\n return true;\n }\n // new platform doesn't exist in current\n const newOneThere = newPlatforms.f... | [
"0.7559503",
"0.5873516",
"0.5712992",
"0.5692494",
"0.5645033",
"0.55847687",
"0.55309635",
"0.5483484",
"0.5458147",
"0.5361083",
"0.5301681",
"0.5301681",
"0.5301681",
"0.5301681",
"0.5301681",
"0.5301681",
"0.5301681",
"0.5301681",
"0.5301681",
"0.5301681",
"0.5301681",
... | 0.769788 | 0 |
so we enforce that apps don't accidently use another apps reducer | function getRootReducer(appName) {
var appReducers;
if (LIMIT_REDUCERS) {
// only load the reducer for the appropriate app
switch (appName) {
case _config__WEBPACK_IMPORTED_MODULE_3__[/* APP_TOPIC_MAPPER */ "d"]:
appReducers = {
topics: _topics_topics__WEBPACK_IMPORTED_MODULE_6__[/*... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function AppReducer(state = initialState, action) {\n //eventually adding logic to handle create, update, and delete\n return state\n}",
"reducers(value) {\r\n customReducers = combineReducers(value);\r\n return app;\r\n }",
"function mapReducer() {}",
"function appReducer(state={}, action) {\... | [
"0.6281888",
"0.6232194",
"0.61008507",
"0.6042558",
"0.6034613",
"0.60019624",
"0.5943315",
"0.5769262",
"0.57645315",
"0.57271856",
"0.57271135",
"0.5703654",
"0.5701544",
"0.56582594",
"0.5632023",
"0.5619534",
"0.5605369",
"0.5592992",
"0.5563992",
"0.5553454",
"0.5542668... | 0.66899467 | 0 |
Use this with the JS Composition pattern to make a Container that has paging controls. Your container MUST expost a `links` property. Your container MUST do one of the following: (a) expose `previousPage` and `nextPage` event handler methods. (b) pass in a onPageChange handler function that accepts (dispatch, props, li... | function withPaging(onPageChange) {
function withPagingInner(ComposedContainer) {
// eslint-disable-next-line react/prefer-stateless-function
var PagedContainer = /*#__PURE__*/function (_React$Component) {
_inherits(PagedContainer, _React$Component);
var _super = _createSuper(PagedContainer);
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"render() {\n const before = this.props.limit\n ? (this.props.limit - 1) / 2\n : this.props.pages\n const after = this.props.limit\n ? (this.props.limit - 1) / 2\n : this.props.pages\n let firstPage = this.props.current - before\n firstPage = constrain(firstPage, 1, this.props.pages)... | [
"0.59167784",
"0.5900018",
"0.5876272",
"0.5856058",
"0.5800735",
"0.5791828",
"0.5773995",
"0.57739466",
"0.57169926",
"0.5680087",
"0.5660533",
"0.5645102",
"0.56236696",
"0.5613564",
"0.5595123",
"0.55719393",
"0.5565793",
"0.55516243",
"0.55489147",
"0.55450547",
"0.55433... | 0.7060534 | 0 |
Initiate a new DomHandler. | function DomHandler(callback,options,elementCB){/** The constructed DOM */this.dom=[];/** Indicated whether parsing has been completed. */this._done=false;/** Stack of open tags. */this._tagStack=[];/** A data node that is still being written to. */this._lastNode=null;/** Reference to the parser instance. Used for loca... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function DomHandler(callback,options,elementCB){/** The constructed DOM */this.dom=[];/** Indicated whether parsing has been completed. */this._done=false;/** Stack of open tags. */this._tagStack=[];/** A data node that is still being written to. */this._lastNode=null;/** Reference to the parser instance. Used for... | [
"0.61516356",
"0.60738325",
"0.60738325",
"0.6052532",
"0.6052532",
"0.6052532",
"0.59789807",
"0.5972444",
"0.5972444",
"0.59645426",
"0.59499496",
"0.5942172",
"0.5942172",
"0.58535606",
"0.5836946",
"0.58330566",
"0.57972014",
"0.57935804",
"0.5729525",
"0.570052",
"0.5687... | 0.6116017 | 1 |
Given an array of nodes, remove any member that is contained by another. | function removeSubsets(nodes){var idx=nodes.length;// Check if each node (or one of its ancestors) is already contained in the
// array.
while(--idx>=0){var node=nodes[idx];// Remove the node if it is not unique.
// We are going through the array from the end, so we only
// have to check nodes that preceed the node und... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function removeSubsets(nodes){var idx=nodes.length;// Check if each node (or one of its ancestors) is already contained in the\n\t// array.\n\twhile(--idx>=0){var node=nodes[idx];// Remove the node if it is not unique.\n\t// We are going through the array from the end, so we only\n\t// have to check nodes that pre... | [
"0.67381585",
"0.670268",
"0.670268",
"0.670268",
"0.670268",
"0.670268",
"0.670268",
"0.670268",
"0.670268",
"0.670268",
"0.66819376",
"0.64706516",
"0.64706516",
"0.64311445",
"0.63336796",
"0.6238685",
"0.6095349",
"0.58873034",
"0.5850233",
"0.5834181",
"0.5818088",
"0.... | 0.6726328 | 1 |
Helper methods Parses data, returns the resulting DOM. | function parseDOM(data,options){var handler=new domhandler_1.DomHandler(void 0,options);new Parser_1.Parser(handler,options).end(data);return handler.dom;} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function domParse(data) {\n var parser = new DOMParser();\n var httpDoc = parser.parseFromString(data, \"text/html\");\n\n return httpDoc;\n}",
"function parseDOM(data, options) {\n var handler = new lib.DomHandler(void 0, options);\n new Parser_1.Parser(handler, options).end(data);\n return handler.dom;\n... | [
"0.7264533",
"0.70590436",
"0.7004261",
"0.7001255",
"0.7001255",
"0.7001255",
"0.7001255",
"0.6972198",
"0.6734323",
"0.6734323",
"0.6734323",
"0.6734323",
"0.6734323",
"0.6734323",
"0.66199094",
"0.6578646",
"0.6549873",
"0.6445328",
"0.6445328",
"0.6445328",
"0.6445328",
... | 0.73538655 | 1 |
Creates a parser instance, with an attached DOM handler. | function createDomStream(cb,options,elementCb){var handler=new domhandler_1.DomHandler(cb,options,elementCb);return new Parser_1.Parser(handler,options);} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function createDomStream(cb, options, elementCb) {\n\t var handler = new domhandler_1.DomHandler(cb, options, elementCb);\n\t return new Parser_js_1.Parser(handler, options);\n\t}",
"function createDomStream(cb, options, elementCb) {\n var handler = new domhandler_1.DomHandler(cb, options, elementCb);\n... | [
"0.68423414",
"0.67687184",
"0.6690787",
"0.6690787",
"0.6690787",
"0.6690787",
"0.6690787",
"0.6690787",
"0.6690787",
"0.6690787",
"0.6690787",
"0.6657298",
"0.66325444",
"0.66152513",
"0.6614588",
"0.6435295",
"0.6425893",
"0.6327359",
"0.6327359",
"0.63180363",
"0.63180363... | 0.6927361 | 1 |
An instance of the SourceMapGenerator represents a source map which is being built incrementally. You may pass an object with the following properties: file: The filename of the generated source. sourceRoot: A root for all relative URLs in this source map. | function SourceMapGenerator(aArgs){if(!aArgs){aArgs={};}this._file=util.getArg(aArgs,'file',null);this._sourceRoot=util.getArg(aArgs,'sourceRoot',null);this._skipValidation=util.getArg(aArgs,'skipValidation',false);this._sources=new ArraySet();this._names=new ArraySet();this._mappings=new MappingList();this._sourcesCon... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function SourceMapGenerator(aArgs) {\n if (!aArgs) {\n aArgs = {};\n }\n this._file = util.getArg(aArgs, 'file', null);\n this._sourceRoot = util.getArg(aArgs, 'sourceRoot', null);\n this._skipValidation = util.getArg(aArgs, 'skipValidation', false);\n this._sources = new ArraySet$1();\n ... | [
"0.8153387",
"0.8152567",
"0.8152567",
"0.8152567",
"0.8142479",
"0.81411785",
"0.81330556",
"0.81216246",
"0.81216246",
"0.81216246",
"0.81216246",
"0.81216246",
"0.81216246",
"0.81216246",
"0.81216246",
"0.81216246",
"0.81216246",
"0.81216246",
"0.81216246",
"0.81216246",
"... | 0.82451296 | 1 |
SourceNodes provide a way to abstract over interpolating/concatenating snippets of generated JavaScript source code while maintaining the line and column information associated with the original source code. | function SourceNode(aLine,aColumn,aSource,aChunks,aName){this.children=[];this.sourceContents={};this.line=aLine==null?null:aLine;this.column=aColumn==null?null:aColumn;this.source=aSource==null?null:aSource;this.name=aName==null?null:aName;this[isSourceNode]=true;if(aChunks!=null)this.add(aChunks);} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function SourceNode(aLine, aColumn, aSource, aChunks, aName) {\n this.children = [];\n this.sourceContents = {};\n this.line = aLine == null ? null : aLine;\n this.column = aColumn == null ? null : aColumn;\n this.source = aSource == null ? null : aSource;\n this.name = aName == null ? null : aName;\n this[... | [
"0.65509343",
"0.65509343",
"0.65509343",
"0.65509343",
"0.65509343",
"0.65509343",
"0.65509343",
"0.65509343",
"0.65509343",
"0.65509343",
"0.65509343",
"0.65509343",
"0.65509343",
"0.65509343",
"0.65509343",
"0.65509343",
"0.65509343",
"0.65509343",
"0.65509343",
"0.65509343"... | 0.65965164 | 1 |
Normalizes a path, or the path portion of a URL: Replaces consecutive slashes with one slash. Removes unnecessary '.' parts. Removes unnecessary '/..' parts. Based on code in the Node.js 'path' core module. | function normalize(aPath){var path=aPath;var url=urlParse(aPath);if(url){if(!url.path){return aPath;}path=url.path;}var isAbsolute=exports.isAbsolute(path);var parts=path.split(/\/+/);for(var part,up=0,i=parts.length-1;i>=0;i--){part=parts[i];if(part==='.'){parts.splice(i,1);}else if(part==='..'){up++;}else if(up>0){if... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function normalize(path) {\n // /a/b/./c/./d ==> /a/b/c/d\n path = path.replace(DOT_RE, \"/\")\n // a//b/c ==> a/b/c\n path = path.replace(DOUBLE_SLASH_RE, \"$1/\")\n return path\n }",
"function normalize(aPath){var path=aPath;var url=urlParse(aPath);if(url){if(!url.path){... | [
"0.8609352",
"0.8152441",
"0.8135088",
"0.8135088",
"0.81276447",
"0.81276447",
"0.8113973",
"0.8113973",
"0.8113973",
"0.8113973",
"0.8113973",
"0.8113973",
"0.8113973",
"0.8113973",
"0.8113973",
"0.8113973",
"0.8113973",
"0.8113973",
"0.8113973",
"0.8113973",
"0.8113973",
... | 0.81668717 | 1 |
Comparator between two mappings with inflated source and name strings where the generated positions are compared. | function compareByGeneratedPositionsInflated(mappingA,mappingB){var cmp=mappingA.generatedLine-mappingB.generatedLine;if(cmp!==0){return cmp;}cmp=mappingA.generatedColumn-mappingB.generatedColumn;if(cmp!==0){return cmp;}cmp=strcmp(mappingA.source,mappingB.source);if(cmp!==0){return cmp;}cmp=mappingA.originalLine-mappin... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function compareByGeneratedPositionsDeflated(mappingA,mappingB,onlyCompareGenerated){var cmp=mappingA.generatedLine-mappingB.generatedLine;if(cmp!==0){return cmp;}cmp=mappingA.generatedColumn-mappingB.generatedColumn;if(cmp!==0||onlyCompareGenerated){return cmp;}cmp=strcmp(mappingA.source,mappingB.source);if(cmp!=... | [
"0.7715092",
"0.7715092",
"0.756622",
"0.756622",
"0.75287753",
"0.75217044",
"0.7515233",
"0.7515233",
"0.7514998",
"0.7514998",
"0.7514998",
"0.7514998",
"0.7514998",
"0.7514998",
"0.7514998",
"0.7514998",
"0.7514998",
"0.7514998",
"0.7514998",
"0.7514998",
"0.7514998",
"... | 0.7879163 | 1 |
Strip any JSON XSSI avoidance prefix from the string (as documented in the source maps specification), and then parse the string as JSON. | function parseSourceMapInput(str){return JSON.parse(str.replace(/^\)]}'[^\n]*\n/,''));} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function parseSourceMapInput(str) {\n return JSON.parse(str.replace(/^\\)]}'[^\\n]*\\n/, \"\"));\n}",
"function parseSourceMapInput(str) {\n return JSON.parse(str.replace(/^\\)]}'[^\\n]*\\n/, \"\"));\n}",
"function parseSourceMapInput(str) {\n return JSON.parse(str.replace(/^\\)]}'[^\\n]*\\n/, \"\"));\n}",
... | [
"0.66820216",
"0.66820216",
"0.66820216",
"0.667522",
"0.66441756",
"0.66441756",
"0.66441756",
"0.6631018",
"0.6631018",
"0.6631018",
"0.6631018",
"0.6631018",
"0.6631018",
"0.6631018",
"0.6631018",
"0.6631018",
"0.6631018",
"0.6631018",
"0.6631018",
"0.6631018",
"0.6631018"... | 0.66999775 | 1 |
If the request has a `query` object, merge it into the request.url, and delete the object If file and/or multipart, also create FormData instance | function mergeInQueryOrForm() {var req = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};var _req$url =
req.url,url = _req$url === void 0 ? '' : _req$url,query = req.query,form = req.form;
var joinSearch = function joinSearch() {for (var _len = arguments.length, strs = new Array(_len), _key =... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"_getFormData(file) {\n let formData = new FormData();\n formData.append(this.paramName, file, file.name);\n Object.keys(this.paramsHash || {}).forEach(key => {\n formData.append(key, this.paramsHash[key]);\n });\n return formData;\n }",
"createFormData(update = false) {\n ... | [
"0.5464325",
"0.54614717",
"0.54513264",
"0.54513264",
"0.52602965",
"0.52393824",
"0.5225009",
"0.5191932",
"0.51833224",
"0.51833224",
"0.51833224",
"0.5182195",
"0.5175178",
"0.51020044",
"0.5069409",
"0.5029042",
"0.5020635",
"0.50099874",
"0.49932146",
"0.49930304",
"0.4... | 0.60907406 | 0 |
Wrap a http function ( there are otherways to do this, consider this deprecated ) | function makeHttp(httpFn, preFetch, postFetch) {
postFetch = postFetch || function (a) {return a;};
preFetch = preFetch || function (a) {return a;};
return function (req) {
if (typeof req === 'string') {
req = { url: req };
}
http_self.mergeInQueryOrForm(req);
req = preFetch(req);
return... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function http_http(_x) {return _http.apply(this, arguments);}",
"function HttpWithFallback() { }",
"function XmlHttp() {}",
"function requestHttpsToHttp () {\n\n }",
"function https_handler (request, response)\r\n{\r\n default_handler (response, 0, 0);\r\n}",
"function HTTP(obj) {\n return $.aja... | [
"0.81495655",
"0.6371431",
"0.63406295",
"0.6324237",
"0.62949723",
"0.6290931",
"0.61854297",
"0.6168916",
"0.61149055",
"0.61044896",
"0.6091538",
"0.60868376",
"0.6067579",
"0.6061063",
"0.6059132",
"0.59955394",
"0.5956958",
"0.5956197",
"0.5939444",
"0.5925931",
"0.59257... | 0.6929368 | 1 |
========================= Utilities ========================= Resolves a path and its base to an abolute URL. | function absoluteify(path, basePath) {
if (!ABSOLUTE_URL_REGEXP.test(path)) {
if (!basePath) {
throw new JSONRefError("Tried to resolve a relative URL, without having a basePath. path: '".concat(path, "' basePath: '").concat(basePath, "'"));
}
return external_url_default.a.resolve(basePath, path);
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function resolve(input, base) {\n\tif (!base) base = \"\";\n\t// Absolute URLs are very easy to resolve right.\n\tif (isAbsoluteUrl(input)) return new Url(input).href;\n\tif (base) {\n\t\t// Absolute URLs are easy...\n\t\tif (isAbsoluteUrl(base)) return new Url(input, base).href;\n\t\t// If base is protocol relati... | [
"0.71831596",
"0.70089597",
"0.69636256",
"0.68387824",
"0.66592926",
"0.6575586",
"0.6575586",
"0.6575586",
"0.6575586",
"0.6569271",
"0.6540612",
"0.6508034",
"0.6490484",
"0.64879674",
"0.6456926",
"0.6440653",
"0.6330484",
"0.63232136",
"0.6287247",
"0.6286479",
"0.627171... | 0.7060651 | 1 |
Converts a JSON pointer to array. | function jsonPointerToArray(pointer) {
if (typeof pointer !== 'string') {
throw new TypeError("Expected a string, got a ".concat(typeof_default()(pointer)));
}
if (pointer[0] === '/') {
pointer = pointer.substr(1);
}
if (pointer === '') {
return [];
}
return pointer.split('/').map(unescapeJ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function jsonPointerToArray(pointer) {\n if (typeof pointer !== 'string') {\n throw new TypeError(`Expected a string, got a ${typeof pointer}`);\n }\n\n if (pointer[0] === '/') {\n pointer = pointer.substr(1);\n }\n\n if (pointer === '') {\n return [];\n }\n\n return pointer.split('/').map(unescape... | [
"0.7442582",
"0.6855165",
"0.68071026",
"0.6607126",
"0.61762744",
"0.6107058",
"0.6071763",
"0.6068713",
"0.60295236",
"0.5930716",
"0.5831046",
"0.5706586",
"0.557974",
"0.55571723",
"0.5542787",
"0.55176765",
"0.55160964",
"0.548554",
"0.54392505",
"0.54377025",
"0.543767"... | 0.7502609 | 0 |
Unescapes a JSON pointer. | function unescapeJsonPointerToken(token) {
if (typeof token !== 'string') {
return token;
}
return external_querystring_browser_default.a.unescape(token.replace(/~1/g, '/').replace(/~0/g, '~'));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function unescapeJsonPointerToken(token) {\n if (typeof token !== 'string') {\n return token;\n }\n\n const params = new URLSearchParams(`=${token.replace(/~1/g, '/').replace(/~0/g, '~')}`);\n return params.get('');\n}",
"function dereferenceJSON (source) {\n\treturn JSON.parse(JSON.stringify(source))\n}"... | [
"0.65569234",
"0.57884943",
"0.5777714",
"0.57734394",
"0.57136947",
"0.5638722",
"0.5638722",
"0.5638722",
"0.56062394",
"0.5552433",
"0.5525625",
"0.548214",
"0.53601897",
"0.53404605",
"0.531142",
"0.5279748",
"0.5257071",
"0.52476746",
"0.5175148",
"0.51673037",
"0.510905... | 0.6921209 | 0 |
Escapes a JSON pointer. | function escapeJsonPointerToken(token) {
return external_querystring_browser_default.a.escape(token.replace(/~/g, '~0').replace(/\//g, '~1'));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function _egw_json_escape_string(input)\n{\n\tvar len = input.length;\n\tvar res = \"\";\n\n\tfor (var i = 0; i < len; i++)\n\t{\n\t\tswitch (input.charAt(i))\n\t\t{\n\t\t\tcase '\"':\n\t\t\t\tres += '\\\\\"';\n\t\t\t\tbreak;\n\n\t\t\tcase '\\n':\n\t\t\t\tres += '\\\\n';\n\t\t\t\tbreak;\n\n\t\t\tcase '\\r':\n\t\t\... | [
"0.70060617",
"0.69494665",
"0.63517493",
"0.6330846",
"0.6159306",
"0.61563504",
"0.61506164",
"0.6148916",
"0.6102614",
"0.60536873",
"0.60536873",
"0.5999643",
"0.58899796",
"0.5878594",
"0.5878594",
"0.5878594",
"0.5878594",
"0.5878594",
"0.5878594",
"0.5878594",
"0.58785... | 0.75410473 | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.