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 |
|---|---|---|---|---|---|---|
score = ( number of reviews rating ) / (number of reviews + 1) | function calcScore(numReviews, rating) {
var numer = numReviews * rating;
var denom = numReviews + 1;
var score = numer / denom;
score = score.toPrecision(2);
return score;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function calculateAverage(reviews) {\n if (reviews.length === 0) {\n return 0;\n }\n var sum = 0;\n reviews.forEach(function (element) {\n sum += element.rating;\n });\n return sum / reviews.length;\n}",
"function computeAvgRatings (ratings) {\n const avgRating = ratings.reduce((... | [
"0.78664",
"0.74277973",
"0.7209175",
"0.72054803",
"0.71542597",
"0.7148711",
"0.71197426",
"0.71196187",
"0.7051686",
"0.70420295",
"0.7034782",
"0.7002945",
"0.696121",
"0.6932748",
"0.69278216",
"0.68983334",
"0.6884919",
"0.6883367",
"0.6815063",
"0.67935693",
"0.6792536... | 0.8639463 | 0 |
Use the "tap" event handler of the component for handling navigation item taps. The "tap" event handler of the app drawer item is used to navigate the app based on the tapped navigationItem's route. | function onNavigationItemTap(args) {
console.log('onNavigationItemTap');
const component = args.object;
const componentRoute = component.route;
frameModule.topmost().navigate({
moduleName: componentRoute,
transition: {
name: "fade"
}
});
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"onItemClick() {\n this.navigateTo(this.item.path);\n }",
"handleNavItemClick() {\n\t\tthis.props.updateCurrentView( this.props.viewName );\n\t}",
"onMenuItemClick(item) {\n const { dispatch } = this.props;\n dispatch(setActiveNavigationItem(item));\n }",
"handleTap(){\n\n }",
"handleClick... | [
"0.6261262",
"0.6256491",
"0.6201025",
"0.610407",
"0.60982764",
"0.60555166",
"0.60519254",
"0.557158",
"0.5557174",
"0.54677474",
"0.54491526",
"0.54386073",
"0.5426428",
"0.5413189",
"0.5405001",
"0.53524125",
"0.5345178",
"0.527995",
"0.52754945",
"0.52748996",
"0.5274688... | 0.65180796 | 0 |
get package info from pom.xml | async function getPomInfo (logger) {
const pomXmlFilePath = './pom.xml'
const stats = await fs.stat(pomXmlFilePath)
if (!stats) {
throw getError('ENOPOMXML')
}
let pomXml
try {
const pomContents = await fs.readFile(pomXmlFilePath, 'utf8')
pomXml = await xml2js(pomContents)
} catch (e) {
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getPackageInfo(installPackage) {\n if (installPackage.match(/^.+\\.(tgz|tar\\.gz)$/)) {\n return getTemporaryDirectory()\n .then(obj => {\n let stream;\n if (/^http/.test(installPackage)) {\n stream = hyperquest(installPackage);\n ... | [
"0.61985064",
"0.5854253",
"0.58208483",
"0.57492214",
"0.5673441",
"0.5620701",
"0.5571061",
"0.5529123",
"0.55232114",
"0.5477973",
"0.5470815",
"0.543275",
"0.53859407",
"0.5365534",
"0.5364066",
"0.53601044",
"0.53500533",
"0.53245306",
"0.531249",
"0.53052604",
"0.528407... | 0.6420138 | 0 |
This function checks if the given schema matches a single constant value. | function isConstant(schema) {
return (0, _isArray["default"])(schema["enum"]) && schema["enum"].length === 1 || schema.hasOwnProperty("const");
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function schemaRequiresTrueValue(schema) {\n // Check if const is a truthy value\n if (schema[\"const\"]) {\n return true;\n } // Check if an enum has a single value of true\n\n\n if (schema[\"enum\"] && schema[\"enum\"].length === 1 && schema[\"enum\"][0] === true) {\n return true;\n } // If anyOf has ... | [
"0.6726368",
"0.5912697",
"0.5905577",
"0.58811414",
"0.58121395",
"0.58000904",
"0.5716442",
"0.56722945",
"0.5618011",
"0.5544796",
"0.54840726",
"0.5440377",
"0.54260695",
"0.5308825",
"0.52884924",
"0.52884924",
"0.528243",
"0.52821594",
"0.52545154",
"0.5227057",
"0.5212... | 0.7606965 | 0 |
Get a filtered TreeNode list by provided treeNodes. [Legacy] Since `Tree` use `key` as map but `key` will changed by React, we have to convert `treeNodes > data > treeNodes` to keep the key. Such performance hungry! We pass `Component` as argument is to fix eslint issue. | function getFilterTree(treeNodes, searchValue, filterFunc, valueEntities, Component) {
if (!searchValue) {
return null;
}
function mapFilteredNodeToData(node) {
if (!node) return null;
var match = false;
if (filterFunc(searchValue, node)) {
match = true;
}
var children = Object(__... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getFilterTree(treeNodes, searchValue, filterFunc, valueEntities, Component) {\n if (!searchValue) {\n return null;\n }\n\n function mapFilteredNodeToData(node) {\n if (!node) return null;\n var match = false;\n\n if (filterFunc(searchValue, node)) {\n match = true;\n }\n\n var ch... | [
"0.688036",
"0.6815801",
"0.6760713",
"0.6736912",
"0.63426703",
"0.5966326",
"0.5734314",
"0.5732805",
"0.55946356",
"0.5449772",
"0.54170376",
"0.5351878",
"0.5287094",
"0.52427256",
"0.5239438",
"0.52393925",
"0.52256596",
"0.52180034",
"0.52180034",
"0.5208018",
"0.511203... | 0.68338037 | 1 |
==================== Node ==================== [Legacy] Find the same children in both prev & next list. Insert not find one before the find one, otherwise in the end. For example: prev: [1,2,3] next: [2,4] > [1,2,4,3] | function mergeChildren(prev, next) {
var prevList = Object(__WEBPACK_IMPORTED_MODULE_0_rc_util_es_Children_toArray__["a" /* default */])(prev);
var nextList = Object(__WEBPACK_IMPORTED_MODULE_0_rc_util_es_Children_toArray__["a" /* default */])(next);
// Skip if is single children
if (prevList.length === 1 && n... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function mergeChildren(prev, next) {\n var prevList = Object(rc_util_es_Children_toArray__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(prev);\n var nextList = Object(rc_util_es_Children_toArray__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(next);\n\n // Skip if is single children\n if (prevList.length === 1 && nextL... | [
"0.668817",
"0.668817",
"0.6362047",
"0.6361122",
"0.63567376",
"0.62974787",
"0.62687546",
"0.6221984",
"0.6210521",
"0.6204076",
"0.62003595",
"0.61851114",
"0.6167853",
"0.61570287",
"0.6114251",
"0.6105475",
"0.6067923",
"0.60540813",
"0.60515004",
"0.6042494",
"0.6007321... | 0.6701061 | 1 |
Transforming the error output from ajv to format used by jsonschema. At some point, components should be updated to support ajv. | function transformAjvErrors() {
var errors = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
if (errors === null) {
return [];
}
return errors.map(function (e) {
var dataPath = e.dataPath,
keyword = e.keyword,
message = e.message,
params = e.params,
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"convertSchemaToAjvFormat (schema) {\n if (schema === null) return\n\n if (schema.type === 'string') {\n schema.fjs_type = 'string'\n schema.type = ['string', 'object']\n } else if (\n Array.isArray(schema.type) &&\n schema.type.includes('string') &&\n !schema.type.includes('object... | [
"0.62088877",
"0.61880153",
"0.61071205",
"0.57839525",
"0.5701948",
"0.559439",
"0.55288374",
"0.5457478",
"0.5441245",
"0.5424859",
"0.54214114",
"0.54195905",
"0.5409236",
"0.530148",
"0.530148",
"0.52443224",
"0.5218722",
"0.5207756",
"0.5179554",
"0.5171845",
"0.5121539"... | 0.7598042 | 0 |
This function processes the formData with a user `validate` contributed function, which receives the form data and an `errorHandler` object that will be used to add custom validation errors for each field. | function validateFormData(formData, schema, customValidate, transformErrors) {
var additionalMetaSchemas = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : [];
var customFormats = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : {};
// Include form data with undefined values,... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function validateFormData(formData, schema, customValidate, transformErrors) {\n var _jsonValidate = (0, _jsonschema.validate)(formData, schema),\n errors = _jsonValidate.errors;\n\n if (typeof transformErrors === \"function\") {\n errors = transformErrors(errors);\n }\n var errorSchema = toErrorSchema... | [
"0.67677426",
"0.6363769",
"0.6268387",
"0.6146168",
"0.6119599",
"0.60997343",
"0.60464555",
"0.6031148",
"0.60148215",
"0.59942466",
"0.59906805",
"0.59537417",
"0.5930448",
"0.5868682",
"0.58547825",
"0.58386046",
"0.5806425",
"0.5736761",
"0.5728059",
"0.57253784",
"0.571... | 0.7031203 | 0 |
Validates data against a schema, returning true if the data is valid, or false otherwise. If the schema is invalid, then this function will return false. | function isValid(schema, data) {
try {
return ajv.validate(schema, data);
} catch (e) {
return false;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function valid_schema(schema) {\n\t\tif (typeof schema !== \"object\") {\n\t\t\tvar help = \"\";\n\t\t\tif (typeof schema == \"function\") help = \" It is a function, did you forget to use new?\"\n\t\t\tthrow new Error(\"schema '\" + schema + \"' is not an object.\" + help);\n\t\t}\n\n\t\tif (schema.__proto__['_sc... | [
"0.67133814",
"0.6671363",
"0.6510813",
"0.6501773",
"0.6438881",
"0.6361112",
"0.62942237",
"0.6264621",
"0.624692",
"0.6243214",
"0.6242907",
"0.61889046",
"0.61505216",
"0.6146425",
"0.6146425",
"0.6109037",
"0.60533065",
"0.60395736",
"0.591254",
"0.588941",
"0.58643097",... | 0.7537206 | 0 |
AnimateChild only accept one child node. `transitionSupport` is used for none transition test case. Default we use browser transition event support check. | function genAnimateChild(transitionSupport) {
var AnimateChild = function (_React$Component) {
__WEBPACK_IMPORTED_MODULE_4_babel_runtime_helpers_inherits___default()(AnimateChild, _React$Component);
function AnimateChild() {
__WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_classCallCheck___default()(t... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function genAnimateChild(transitionSupport) {\n var AnimateChild = function (_React$Component) {\n __WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_inherits___default()(AnimateChild, _React$Component);\n\n function AnimateChild() {\n __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_classCallCheck___d... | [
"0.7053865",
"0.69116277",
"0.69116277",
"0.57502353",
"0.57206935",
"0.55016637",
"0.55016637",
"0.55016637",
"0.55016637",
"0.54007214",
"0.51266724",
"0.50819546",
"0.5056912",
"0.5034974",
"0.4999975",
"0.49841255",
"0.49691612",
"0.49046695",
"0.4877449",
"0.48595542",
"... | 0.7040217 | 1 |
Check to see if a schema specifies that a value must be true | function schemaRequiresTrueValue(schema) {
// Check if const is a truthy value
if (schema["const"]) {
return true;
} // Check if an enum has a single value of true
if (schema["enum"] && schema["enum"].length === 1 && schema["enum"][0] === true) {
return true;
} // If anyOf has a single value, evalua... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function validate(value, schemas) {\n return !schemas.every(function (schema) { return validateValueForSchema(value, schema); });\n }",
"function valid(schema, object) {\n\t\ttry {\n\t\t\tcheck(schema, object);\n\t\t\treturn true;\n\t\t} catch (e) {\n\t\t\treturn false;\n\t\t}\n\t}",
"function isOk(val) {\... | [
"0.654824",
"0.63285756",
"0.63018054",
"0.62980527",
"0.6256043",
"0.6131992",
"0.6130684",
"0.6115924",
"0.6115924",
"0.6115924",
"0.6115924",
"0.6115924",
"0.6102087",
"0.60609156",
"0.604144",
"0.60409933",
"0.60259074",
"0.59910035",
"0.5977621",
"0.59274614",
"0.5913737... | 0.7954529 | 0 |
Default use `AnimateChild` as component. Here can also pass customize `ChildComponent` for test usage. | function genAnimate(ChildComponent) {
var Animate = function (_React$Component) {
__WEBPACK_IMPORTED_MODULE_4_babel_runtime_helpers_inherits___default()(Animate, _React$Component);
function Animate() {
var _ref;
var _temp, _this, _ret;
__WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_cla... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function genAnimate(ChildComponent) {\n var Animate = function (_React$Component) {\n __WEBPACK_IMPORTED_MODULE_3_babel_runtime_helpers_inherits___default()(Animate, _React$Component);\n\n function Animate() {\n var _temp, _this, _ret;\n\n __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_classCal... | [
"0.76944137",
"0.7689539",
"0.7689539",
"0.71203995",
"0.71203995",
"0.709238",
"0.7054959",
"0.704163",
"0.6783017",
"0.6762539",
"0.6762539",
"0.6762539",
"0.6762539",
"0.58438575",
"0.5783108",
"0.5571973",
"0.55382687",
"0.54242146",
"0.54242146",
"0.53893375",
"0.5295383... | 0.7754593 | 0 |
Export Higher Order Sortable Container Component | function sortableContainer(WrappedComponent) {
var _class, _temp;
var config = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : { withRef: false };
return _temp = _class = function (_Component) {
_inherits(_class, _Component);
function _class(props) {
_classCallCheck(this, _cla... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function sortableContainer(WrappedComponent) {\n\t var _class, _temp;\n\t\n\t var config = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : { withRef: false };\n\t\n\t return _temp = _class = function (_Component) {\n\t _inherits(_class, _Component);\n\t\n\t function _class(props) {\n\t... | [
"0.6384996",
"0.6231242",
"0.62144434",
"0.62144434",
"0.6147314",
"0.60877043",
"0.60877043",
"0.60877043",
"0.60877043",
"0.6072532",
"0.6071221",
"0.6040356",
"0.60323554",
"0.5941488",
"0.5909487",
"0.5904997",
"0.5832268",
"0.5809144",
"0.57978445",
"0.5772332",
"0.57690... | 0.62758803 | 1 |
To be called as method of a parameter area with componentId and entryId attribute | function loadParamsFromServer() {
var paramArea = this;
var $this = $(this);
var componentId = $this.attr('componentId');
var entryId = $(this).attr('entryId');
CREEDO.core.requestData(componentId, entryId, function(result) {
PARAMETERS.renderParameters($this, result);
});
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function enterArea(location){\n area(location, \"encounter\");\n}",
"function updateAreaList() {\n\n}",
"constructor(area) {\n this.area = area\n }",
"function fun_getID(componente){ \n id_imagem = componente.target.id;\n}",
"function getDivHandler(cardFromButton) {\n console.log(\"TileArea.j... | [
"0.54234535",
"0.5231028",
"0.5128045",
"0.51023287",
"0.50465226",
"0.5010236",
"0.49555632",
"0.49406126",
"0.4912508",
"0.48762825",
"0.4870834",
"0.48681527",
"0.48665133",
"0.48261693",
"0.48106718",
"0.4801688",
"0.47832748",
"0.47749585",
"0.47740802",
"0.4773529",
"0.... | 0.52803725 | 1 |
Build list of entire staff by passing in a staff objects array | function buildStaffList(staff) {
cleanContainer();
$.each(staff, function(index, value) {
createStaffCard(value);
});
$('#loadingMessage').remove();
$('#directory').removeClass('hidden');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function buildStaffList(staff) {\n cleanContainer();\n $.each(staff, function(index, value) {\n createStaffCard(value);\n });\n $('#loadingMessage').remove();\n $('#directoryContainer').removeClass('hidden');\n }",
"function getDetails(staff) {\n var persons = [],\n i;\n\n var s... | [
"0.7409901",
"0.6941387",
"0.64922625",
"0.6169858",
"0.5873299",
"0.5870552",
"0.57805586",
"0.57573843",
"0.56947875",
"0.5630768",
"0.5608479",
"0.5596101",
"0.5528989",
"0.5442931",
"0.5399555",
"0.5366196",
"0.5338892",
"0.53329515",
"0.5331012",
"0.53242403",
"0.5305812... | 0.7115938 | 1 |
Function threeCut cut up a quote in three suitable parts and returns them as an array of three strings | function threeCut(str) {
var oneStr = "",
twoStr = "",
threeStr = "";
var one = 0,
two = 0,
three = 0;
one = str.indexOf(' ', (str.length * 0.33));
two = str.indexOf(' ', (str.length * 0.60));
return [str.slice(0, one), str.slice(one, two), str.slice(two, str.length)];
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function splitByThree(string){\n let new_array = [];\n\n for(let i = 0; i < string.length; i+=3){\n new_array.push(string.slice(i, i + 3));\n }\n\n return new_array;\n}",
"function divideByThree (string) {\r\n const arr = string.split(' ')\r\n const result = [];\r\n arr.map(el => {\r\... | [
"0.6459904",
"0.64156264",
"0.6075391",
"0.5464296",
"0.5452689",
"0.5402572",
"0.5388807",
"0.5360239",
"0.5349234",
"0.5321567",
"0.52972364",
"0.52723837",
"0.5261113",
"0.52375555",
"0.51951104",
"0.51895064",
"0.51661026",
"0.5164378",
"0.5148616",
"0.5134919",
"0.506316... | 0.7302963 | 0 |
Function fixQuote fixes the "e problem | function fixQuote(stru) {
return stru.split(""").join("\"");
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function fixQuotes(text) {\n return text.replace(/&(quot|#39|amp);/g,function unEscape(match){\n return entities.decodeHTML(match);\n });\n}",
"_checkQuotes() {\n const str = aStr.string;\n if (str.length >= 2\n && str[0] == str[str.length - 1]\n && (str[0] == \"'\" || str[0] == '\"')) {... | [
"0.73660237",
"0.71055657",
"0.6754023",
"0.66806155",
"0.6652267",
"0.6532637",
"0.64897263",
"0.64373296",
"0.64328563",
"0.63967013",
"0.6351323",
"0.6311212",
"0.6263778",
"0.62631977",
"0.62411696",
"0.62411696",
"0.62411696",
"0.6231436",
"0.6231436",
"0.62309265",
"0.6... | 0.7576059 | 0 |
adds the hero section to the dom for the given hero and updates hero display array | function addHeroSection(hero) {
var context = { hero: hero };
var newSection = Handlebars.partials.heroSummary(context);
document.getElementById("hero-multiple-parent").insertAdjacentHTML("beforeend", newSection);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function drawHero() {\n // Draw the hero's current stats on the screen\n let healthText = \"Health: \" + hero.health;\n $(\"#health\").width(PIXELS_PER_UNIT * hero.health).text(healthText);\n let magicText = \"Magic: \" + hero.magic;\n $(\"#magic\").width(PIXELS_PER_UNIT * hero.magic).text(magicText... | [
"0.68560743",
"0.6571089",
"0.65635186",
"0.6532761",
"0.6516195",
"0.6399821",
"0.63829315",
"0.6299632",
"0.62689346",
"0.618981",
"0.61801225",
"0.6159917",
"0.6143947",
"0.612916",
"0.6124287",
"0.6107778",
"0.6067569",
"0.6054945",
"0.59679604",
"0.5928726",
"0.5914965",... | 0.7661486 | 0 |
deletes the hero section from the dom for the given hero and updates hero display array | function removeHeroSection(hero) {
var heroSection = document.getElementById(hero.normalizedName);
// fadeout hero section
heroSection.classList.add("fade-out");
// wait for css fadeout to end, then delete hero-section
setTimeout(function() {
heroSection.innerHTML = "";
heroSection.parentNode.removeCh... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async function getData() {\n var response = await fetch(api);\n var data = await response.json();\n var hero = data.heroes;\n\n var heroId = parseInt(document.getElementById('hero-id').value);\n\n for (var i = hero.length - 1; i >= 0; --i) {\n i... | [
"0.6891366",
"0.6677036",
"0.63397586",
"0.6296601",
"0.62880147",
"0.62862927",
"0.62846076",
"0.61048037",
"0.6050246",
"0.5997294",
"0.5939272",
"0.5936301",
"0.5916658",
"0.5831624",
"0.57861996",
"0.5764082",
"0.5742631",
"0.57090825",
"0.57046926",
"0.5686258",
"0.56749... | 0.7048061 | 0 |
este metodo cambia el estado de la interfaz. en el estado "agregar", que es el default, se pueden agregar nuevas publicaciones en el estado "editar", se actualizan las publicaciones. el cambio de estado se hace creando un nuevo boton (volver) y cambiando texto y color del boton ya existente | cambiarEstado(tipo){
if (tipo === "editar"){
this.btnEnviar.textContent = "Actualizar Publicación";
this.btnEnviar.classList ="btn btn-block btn-warning";
const btnVolver = document.createElement("button");
btnVolver.className = "btn btn-block btn-sec... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function agregar() {\n let color = menu.color;\n let fig = menu.figuras;\n if(fig == \"ESFERA\"){\n geometria = new THREE.SphereGeometry(1.5,32,32);\n }\n if(fig == \"TOROIDE\"){\n geometria =new THREE.TorusGeometry(1.5,0.5,32,100 );\n ... | [
"0.5912023",
"0.577363",
"0.574187",
"0.56788707",
"0.56694305",
"0.56512237",
"0.561144",
"0.5581836",
"0.5581836",
"0.55764264",
"0.5562498",
"0.5542867",
"0.5519321",
"0.55082095",
"0.5494149",
"0.5483851",
"0.54735214",
"0.54605204",
"0.5450404",
"0.5448989",
"0.54316115"... | 0.6596184 | 0 |
testREST(); A function to trigger an XMLHttpRequest | function testREST(sessionID) {
if (!!sessionID == false) {
console.log("QUITTING TESTREST");
return;
}
console.log('start testREST')
let request = new XMLHttpRequest();
request.open("GET", `https://opn-boxfusion-uk.rightnowdemo.com/services/rest/connect/v1.3/PTIBUI.Session/... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function testGet(){\n // Ajax expects an object with configuration \n $.ajax({\n\n //This Url is where the server is AT/Located \n url: 'http://restclass.azurewebsites.net/api/test',\n // You must specifiy type\n type: 'GET',\n\n //Paramater is the 'response' from the s... | [
"0.6446471",
"0.6415284",
"0.6316891",
"0.6312731",
"0.6309376",
"0.63017005",
"0.62768847",
"0.6208606",
"0.62020534",
"0.6193359",
"0.6170681",
"0.6168777",
"0.6160387",
"0.6118129",
"0.61048293",
"0.61043984",
"0.6064854",
"0.60631204",
"0.60445714",
"0.6035975",
"0.601545... | 0.6960258 | 0 |
instantiate controllers from jQuery Array | function instantiateControllers(ui,attrSelector){
$.each(ui,function(){
var context=window.$$.elliptical.context;
var controller= $(this).attr(attrSelector);
if(controller !==undefined){
controller=controller.toCamelCase();
}
var camelC... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"_initializeControllers()\n {\n this._controllerContextMenu = new ControllerContextMenu();\n this._controllerModal = new ControllerModal();\n this._controllerProject = new ControllerProject();\n this._controllerResource = new ControllerResource();\n this._controllerRunJob = new... | [
"0.64472276",
"0.6140326",
"0.59269977",
"0.58564043",
"0.57440686",
"0.55506074",
"0.5414506",
"0.5397528",
"0.53923225",
"0.53672296",
"0.5342874",
"0.5339439",
"0.5335191",
"0.53240126",
"0.52558494",
"0.52546954",
"0.5220339",
"0.5217016",
"0.51858026",
"0.5182652",
"0.50... | 0.67104477 | 0 |
const initialState Updates an entity cache in response to any action with response.entities. | function entities(
state = {
attempts: {},
courses: {},
terms: {},
people: {},
users: {},
repos: {},
assignments: {},
groups: {},
session: {}
},
action
) {
if (action.response && action.response.entities) {
return merge({}, state, action.response.entities);
}
return ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function entities(state = defaultState, action) {\n if (action.response && action.response.entities) {\n return merge({}, state, action.response.entities)\n }\n\n return state\n}",
"function entities(state = {users: {}, repos: {}}, action) {\n if (action.response && action.response.entities) {\n ... | [
"0.7032639",
"0.67122537",
"0.6673254",
"0.66262907",
"0.6579922",
"0.5874085",
"0.57304984",
"0.5594827",
"0.5592721",
"0.5551753",
"0.5551753",
"0.5551753",
"0.5533257",
"0.5532099",
"0.5502916",
"0.5481165",
"0.5441047",
"0.539597",
"0.5369721",
"0.53594744",
"0.5354581",
... | 0.6995683 | 1 |
Based on current state update subtotal display. | function calcSubtotal() {
const sub = Object.keys(lineStates)
.reduce((acum, lineKey) => {
if (lineKey === 'shippingState') {
return acum;
} else {
const {liveQuantity, unitPrice} = lineStates[lineKey].getState();
const nextAcum = acum + (liveQuantity * unitPrice);
retu... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function update() {\n $(\"#subtotal\").html(total);\n }",
"refreshTotalCalories() {\n UISelectors.totalCaloriesDisplay.textContent = ItemCtrl.getTotalCalories();\n }",
"function totalPriceUpdate() {\n var subTotal = currentPrice.reduce((a, b) => a + b, 0);\n var tax = (subTotal * 15... | [
"0.7394835",
"0.6956682",
"0.68971264",
"0.68655455",
"0.68630016",
"0.6820694",
"0.67764896",
"0.66879004",
"0.6676346",
"0.6670477",
"0.6667746",
"0.66618824",
"0.6642411",
"0.6642231",
"0.66366225",
"0.66340894",
"0.6625123",
"0.6624715",
"0.6602089",
"0.6597541",
"0.65614... | 0.7133374 | 1 |
function to delete the parent li | function deleteListItem(element){
element.parentNode.remove("li");
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function deleteListItem(){\n \t\t$(this).parent().remove();\n \t}",
"function deleteListItem() {\n\tthis.parentNode.remove();\n}",
"function deleteItem(){\n\tul.removeChild(this.parentElement);\n}",
"function removeListItem() {\n\t\t\t\t$(this).parent().remove();\n\t\t\t}",
"function deleteItem(){ \n ... | [
"0.8222878",
"0.78978544",
"0.78463054",
"0.78273153",
"0.77041936",
"0.76322985",
"0.7607547",
"0.75030226",
"0.7469818",
"0.7426458",
"0.7373215",
"0.7310038",
"0.730735",
"0.7267324",
"0.7182692",
"0.7180833",
"0.71725935",
"0.7129922",
"0.7117068",
"0.7059371",
"0.7026622... | 0.792749 | 1 |
Draws all of the active AnimationJobs. | function drawJobs() {
var i, count;
for (i = 0, count = animator.jobs.length; i < count; i += 1) {
animator.jobs[i].draw();
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function drawAll() {\n //refreshes canvas everyone to give the animation effect\n ctx.clearRect(0, 0, canvas.width, canvas.height);\n if (optionScreen) {\n clickOption();\n return;\n }\n \n //calling functions to draw objects\n drawNet();\n ... | [
"0.6775523",
"0.6598354",
"0.64733666",
"0.64659894",
"0.6401177",
"0.62791455",
"0.6190796",
"0.6146551",
"0.61268365",
"0.61267954",
"0.60957336",
"0.60886484",
"0.6069742",
"0.6065775",
"0.60594416",
"0.6036564",
"0.60331404",
"0.6015751",
"0.60039014",
"0.5993086",
"0.597... | 0.8674891 | 0 |
Starts the animation loop if it is not already running | function startAnimationLoop() {
animator.isPaused = false;
if (!animator.isLooping) {
animator.isLooping = true;
window.hg.util.requestAnimationFrame(firstAnimationLoop);
}
// --- --- //
/**
* The time value provided by requestAnimationFrame appears to be the number o... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function start () {\n animationInt = window.setInterval(animationManager, animatorIntervalTime);\n }",
"function start(_running) {\n\t\t//console.log(\"cog1.app.start()\");\n\n\t\tif(!initDone) {\n\t\t\tinit();\n\t\t}\n\t\tif(running) {\n\t\t\t//console.log(\"Animation loop is already running.\");\n\t\... | [
"0.7506681",
"0.7495349",
"0.7473517",
"0.734231",
"0.7330588",
"0.7297623",
"0.72603965",
"0.7191637",
"0.7190803",
"0.71661085",
"0.7124021",
"0.7089526",
"0.7065925",
"0.7049179",
"0.70215094",
"0.6967051",
"0.6952581",
"0.69170094",
"0.69170094",
"0.69004536",
"0.6890231"... | 0.7503039 | 1 |
Cancels all running AnimationJobs. | function cancelAll() {
while (animator.jobs.length) {
cancelJob(animator.jobs[0]);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"cancelAllAnimations() {\n\t\tthis._cameraAnimationQueue.clear();\n\t\tthis._currentAnimation = null;\n\t}",
"function cancelAllJobs() {\n for (var job in scheduler.scheduledJobs) {\n if (scheduler.scheduledJobs.hasOwnProperty(job)) {\n scheduler.scheduledJobs[job].cancel();\n }\n }\n updateJobs = [... | [
"0.7630864",
"0.76259303",
"0.68920255",
"0.6768932",
"0.6658912",
"0.66561764",
"0.6644546",
"0.6550324",
"0.6541305",
"0.6480471",
"0.6475399",
"0.64724696",
"0.641442",
"0.63360596",
"0.6327625",
"0.6278376",
"0.62108886",
"0.6207414",
"0.6207414",
"0.61990035",
"0.6187676... | 0.85232013 | 0 |
function to transpose a voice from any key to another based on the two different scales. will use this extensively. | function transposeVoice(voice, oldKey_steps_from_c, newKey_steps_from_c, oldScale_major_or_minor, newScale_major_or_minor) { //start here tomorrow!!
//takes the notes of the voice, converts them to scale degrees, and spits back the scale degrees in the new voice,
// converted back to notes
//single measure... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function rotor_transcribe(){\n\tfor(element in input.transcribed){\n\t\tinput.rotortranscribed = rotor.master[input.transcribed[element]];\n\t}\n\trotor.dial1 += 1;\n \tif (rotor.dial1 == 26) {\n rotor.dial1 = 0;\n \trotor.dial2 += 1;\n\t}\n if (rotor.dial2 == 26) {\n rotor.dial2 = 0;\n \trotor.dial3 += 1... | [
"0.5888459",
"0.585925",
"0.5614412",
"0.551813",
"0.5425026",
"0.5364741",
"0.5328143",
"0.5321192",
"0.52570444",
"0.5174695",
"0.516125",
"0.5140038",
"0.51340204",
"0.50930625",
"0.50886625",
"0.5045592",
"0.4973244",
"0.49658448",
"0.49640697",
"0.49594438",
"0.49323952"... | 0.80570567 | 0 |
Creates a test for a privilege set | function testPrivilege(name, privileges, expected) {
test(name, function() {
var calendar = Factory('calendar', {
remote: {
privilegeSet: privileges
}
});
var result = subject.calendarCapabilities(
calendar
);
assert.hasProperties... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function test_candu_collection_tab() {}",
"function CreateSet() {\n return new std_Set;\n}",
"function buildTestset() {\n //testset_ID = object_ID; // ERROR: this randomized object_ID because it was a \"shallow copy\": it made both variables refer to the same thing\n testset_ID = ownRange(object_ID.lengt... | [
"0.5120992",
"0.50530475",
"0.49891454",
"0.49624488",
"0.49240893",
"0.49207646",
"0.48958808",
"0.4841904",
"0.48189345",
"0.4810903",
"0.48101678",
"0.4800642",
"0.47745436",
"0.47571656",
"0.4733288",
"0.47282845",
"0.47174639",
"0.47115338",
"0.47108385",
"0.47093466",
"... | 0.6446825 | 0 |
Clone head and merge PR (base) in | function cloneAndMerge() {
if (!which('git')) {
echo('!!! Botio error: Could not find git');
exit(1);
}
if (!jobInfo.base_url || !jobInfo.head_url || !jobInfo.head_sha) {
echo('!!! Botio error: Missing head/base information');
exit(1);
}
execWrap('git clone '+jobInfo.base_url+' .'); // clone... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function forkRepo() {\n const repo = 'learn-co-curriculum/js-ajax-fetch-lab';\n //use fetch to fork it!\n fetch(`${baseURL}/repos/${repo}/forks`,{\n method: 'POST',\n headers: {\n Authorization: `token ${getToken()}`\n }\n })\n .then(response => response.json())\n .then(json => showResults(json))... | [
"0.5852513",
"0.58291745",
"0.57654816",
"0.5545052",
"0.53431654",
"0.53409815",
"0.5323973",
"0.5319847",
"0.53021437",
"0.5216701",
"0.5216701",
"0.5216701",
"0.5216701",
"0.515342",
"0.5142146",
"0.5113465",
"0.51026624",
"0.51023585",
"0.51023585",
"0.51023585",
"0.51023... | 0.64952624 | 0 |
Creating new table called [dbo].[test_transact] | function createTable() {
const sql = `CREATE TABLE ${table} (c1 int UNIQUE) `;
const request = new Request(sql, (err, rowCount) => {
if (err) {
console.log('error occured!');
throw err;
}
console.log(`'${table}' created!`);
createTransaction();
});
connection.execSql(request);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function transactionTable() { }",
"function createTableRecord(tx) {\n\t\n\t console.log(\"Entering createTableRecord\");\n\t \n\t var sqlStr = 'CREATE TABLE IF NOT EXISTS records (type TEXT, date DATE)';\n\t console.log(sqlStr);\n\t \n\t tx.executeSql(sqlStr, [], onSqlSuccess, onSqlError);\n\t console.log... | [
"0.6159478",
"0.60244995",
"0.59766746",
"0.595985",
"0.59292626",
"0.592825",
"0.59221107",
"0.5917315",
"0.5808698",
"0.57915026",
"0.5740056",
"0.57067096",
"0.5694302",
"0.5688825",
"0.56819093",
"0.5657662",
"0.56558233",
"0.56421185",
"0.5639984",
"0.56291187",
"0.56108... | 0.6077335 | 1 |
SQL: Commit Transaction (if no errors) | function commitTransaction() {
connection.commitTransaction((err) => {
if (err) {
console.log('commit transaction err: ', err);
}
console.log('commitTransaction() done!');
console.log('DONE!');
connection.close();
});
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"commit() {\n if (this.transactions.length === 0) {\n return 'TRANSACTION NOT FOUND';\n }\n \n this.db = this.applyTransactions();\n this.transactions = [];\n this.currentTransactionIndex = -1;\n }",
"async commitTransaction() {\n const sqlStatement = `commit transaction`\n\n\n if (... | [
"0.7335428",
"0.6972239",
"0.678261",
"0.67789847",
"0.6766179",
"0.6762629",
"0.6762629",
"0.6762629",
"0.67430145",
"0.6742975",
"0.6632527",
"0.6632527",
"0.66283756",
"0.6485706",
"0.6485706",
"0.6414689",
"0.6378538",
"0.63361436",
"0.63056344",
"0.63056344",
"0.62926936... | 0.7160139 | 1 |
create res message when 'accountRegistration' end point is hit | function accountCreationMessage (req, res, next) {
let registeredUser = req.registeredUser
let status = registeredUser.admin ? 'admin' : registeredUser.company.host ? 'staff' : 'user'
req.resJson.message = !registeredUser.hashedPassword
? `Contact record for '${registeredUser.email}' without login privilege i... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"registerAccount(traderName, traderEmail, traderPassword) {\n var registration = new Registration(traderName, traderEmail, traderPassword);\n\n // Validate Credentials\n let obj = registration.validateCredentials(traderEmail, traderName, traderPassword);\n if (obj.Bool == false)\n ... | [
"0.66232574",
"0.65816855",
"0.654811",
"0.6531342",
"0.64758885",
"0.64719754",
"0.63950676",
"0.6383665",
"0.6366002",
"0.63358396",
"0.63270503",
"0.63213634",
"0.62326294",
"0.6193277",
"0.61789376",
"0.6174487",
"0.6148232",
"0.6147281",
"0.61292803",
"0.61198294",
"0.61... | 0.75123465 | 0 |
triggers token validation if req.body.admin is true | function activateAdminPrivilegeCheck (req, res, next) {
return (
('admin' in req.body && req.body.admin === 'true') ||
!('password' in req.body)
) ? validateJwt({ admin: true })(req, res, next) : next()
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"static isAdmin(req, res, next) {\n // get the token from the header\n const token = req.headers['x-access-token'];\n\n // check if there is a token\n if (!token || token === '') {\n return res.status(403).json({ status: 403, error: 'Unauthorized Access token not found' });\n }\n\n // check i... | [
"0.7274345",
"0.7108276",
"0.7096956",
"0.69537127",
"0.6836894",
"0.67044705",
"0.6698565",
"0.6672359",
"0.65986186",
"0.6597238",
"0.6588642",
"0.6535254",
"0.65343946",
"0.6520055",
"0.65134346",
"0.6502926",
"0.649752",
"0.6489991",
"0.6474881",
"0.64620185",
"0.64597946... | 0.71997714 | 1 |
find target contact record indicated by the request route.param() with :contactId | function autoFindTarget (req, res, next, contactId) {
let targetContactId = contactId.toUpperCase()
return db.Contacts
.findById(targetContactId)
.then(targetContact => {
req.targetContactId = targetContactId
req.targetContact = targetContact
next()
return Promise.resolve()
})
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getContactByContactId(contactId) {\n\n var deferred = new $.Deferred();\n \n var contactList = window.Compass.Helm.LoanContacts;\n var contact = null;\n\n for (var i = 0; i < contactList.length; i++) {\n if (contactList[i] !== null && contactList[i].ContactId === c... | [
"0.68446445",
"0.6736591",
"0.6484376",
"0.6341117",
"0.6276041",
"0.61165404",
"0.6035286",
"0.59185785",
"0.5913978",
"0.5799781",
"0.57681453",
"0.5766176",
"0.57158935",
"0.5694569",
"0.5667476",
"0.563256",
"0.56234324",
"0.55851436",
"0.55811834",
"0.5522578",
"0.539792... | 0.76202464 | 0 |
filter req.body and return an object containing only editable fields | function filterBodyData (req, res, next) {
// return a list of editable fields for respective access privilege
let editableList = req.userPrivilege === 3
? ['email', 'name', 'mobile', 'password', 'companyId', 'admin'] // admins
: req.userPrivilege === 2
? ['email', 'name', 'mobile'] // staffs
: ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function filterModelFields(doc) {\n return {\n '_id': doc._id,\n 'date_added': doc.date_added,\n 'hyperparameter': doc.hyperparameter,\n 'name': doc.name,\n 'description': doc.description,\n 'measurements': doc.measurements\n };\n }... | [
"0.58101165",
"0.575716",
"0.5608632",
"0.5537814",
"0.5509096",
"0.54657674",
"0.5447753",
"0.5423997",
"0.52902174",
"0.5232753",
"0.5231983",
"0.522697",
"0.5208449",
"0.5189072",
"0.515867",
"0.51546824",
"0.5137889",
"0.5133249",
"0.51256084",
"0.50947696",
"0.5093842",
... | 0.77591413 | 0 |
create res message when '\login' end point is hit | function loginMessage (req, res, next) {
let status = req.registeredUser.admin ? 'admin' : req.registeredUser.company.host ? 'staff' : 'user'
req.resJson.message = `account token with ${status} privilege is supplied for 24 hours`
return next()
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"handleLogin(req, res) {\n self.services.getUser(req.validBody.username)\n .then(data => {\n if (!data) {\n self.sendError(res, self.CODES.UNAUTHORIZED, \"No such username: \" + req.validBody.username);\n } else if (data.password !== req.validBody.password) {\n ... | [
"0.7056465",
"0.6880186",
"0.68237704",
"0.6795843",
"0.67279196",
"0.6714099",
"0.66110474",
"0.6605321",
"0.6592178",
"0.6588839",
"0.65865517",
"0.65800035",
"0.6558534",
"0.6510909",
"0.65097046",
"0.64981335",
"0.64783853",
"0.6472994",
"0.6466283",
"0.64107203",
"0.6408... | 0.72489464 | 0 |
parsing purchase order data | function parsePurchaseOrderData (req, res, next) {
// skipped if no product inquiry is found
if (!req.body.productIdList) return next()
// product inquiry (purchase order) creation
let productIdList = JSON.parse(JSON.stringify(req.body.productIdList))
// check if products inquries are being submitted
if (pr... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function parseOrderData() {\n let orders = [];\n return new Promise(async (resolve, reject) => {\n try {\n const rawData = await getRawData();\n const rows = rawData.split('\\r\\n');\n rows.forEach(row => {\n let col = row.split(',');\n if... | [
"0.614692",
"0.6031592",
"0.57966536",
"0.55922955",
"0.5508869",
"0.5508869",
"0.546939",
"0.5450765",
"0.5449095",
"0.5406523",
"0.5374933",
"0.5363193",
"0.52895355",
"0.5263571",
"0.52528554",
"0.52528554",
"0.5171323",
"0.5166933",
"0.5156859",
"0.51548976",
"0.5145484",... | 0.6457491 | 0 |
send contact data in the server response 'data' property | function sendTargetData (req, res, next) {
req.resJson = { data: req.targetContact }
return next()
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getContactData() {\n return contactData;\n }",
"function sendReContactRequest(cb, data) {\n data.to = data.email;\n data.toName = data.name;\n data.subject = 'RE: Contact Request';\n data.originalSubject = 'Contact Request';\n\n if (/east/.test(data.from)) {\n getSignature('jack.... | [
"0.66993874",
"0.62656075",
"0.622607",
"0.6188489",
"0.61064863",
"0.6098914",
"0.6044852",
"0.6036054",
"0.6031123",
"0.6023927",
"0.6023768",
"0.60109055",
"0.59684473",
"0.59544224",
"0.5948004",
"0.59237653",
"0.5920138",
"0.5849982",
"0.5827465",
"0.57768404",
"0.577599... | 0.6630591 | 1 |
check if user has proper privilege to access the target contact information | function verifyContactInfoAccessPrivilege (req, res, next) {
let targetContact = req.targetContact
let isAdminOrStaff = req.userPrivilege >= 2
let userIsContact = req.registeredUser.id === targetContact.id
if (isAdminOrStaff || userIsContact) {
return next()
} else {
res.status(403)
let error = ne... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"checkPermission (target, propertyKey, receiver) {\n return true // FIXME\n }",
"function checkContactGrants() {\r\n AppController.serverController.getRepoInterface().search(new EcContactGrant().getSearchStringByType(), function (encryptedValue) {\r\n EcRepository.get(encryptedValue.shortId(... | [
"0.6404027",
"0.602334",
"0.5914964",
"0.58085656",
"0.5776521",
"0.5652465",
"0.56520295",
"0.5633965",
"0.56228524",
"0.56220776",
"0.55659616",
"0.5549544",
"0.5505168",
"0.5487109",
"0.5484427",
"0.54646224",
"0.54578334",
"0.54391754",
"0.5428679",
"0.54254586",
"0.54182... | 0.7791786 | 0 |
Generate the output directory from the `coverageReporter.dir` and `coverageReporter.subdir` options. | function generateOutputDir (browserName, dir, subdir) {
dir = dir || 'coverage'
subdir = subdir || browserName
if (_.isFunction(subdir)) {
subdir = subdir(browserName)
}
return path.join(dir, subdir)
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"setResultsDir() {\n const { reporterOptions } = this.options;\n if (reporterOptions && reporterOptions.outputDir) {\n this.resultsDir = reporterOptions.outputDir;\n } else {\n let testDir = 'tests';\n if (fs.existsSync(path.join(process.cwd(), 'test'))) {\n testDir = 'test';\n }... | [
"0.6397781",
"0.5813774",
"0.5367376",
"0.5262509",
"0.5249353",
"0.5244765",
"0.5171973",
"0.5091823",
"0.4956825",
"0.48810902",
"0.48061872",
"0.47528645",
"0.47426996",
"0.46254492",
"0.4618333",
"0.4604905",
"0.45906654",
"0.45659274",
"0.45544994",
"0.45071808",
"0.4500... | 0.75621736 | 0 |
NOTICE:check() :do link wrap data going here: | function anlyobj.check(input,source_data){
var check_result=[];
for(var i in source_data){
if(source_data[i].toLowerCase().indexOf(input.toLowerCase())!=-1){
//NOTICE:do link wrap data going here:
//var tip = source_data[i].split(':')[2].link('/localehost/query_via_item_name?table=pregood&id=' + source_data[i].s... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getLinkData(obj,collection){\n var content = \"\";\n var options = httpOptions;\n options.path = obj.link;\n options.followAllRedirects = true;\n\n var req = http.request(options, function (res) {\n res.on('data', function (chunk) {\n content += chunk;\n });\n ... | [
"0.59091467",
"0.56895536",
"0.56527257",
"0.55576044",
"0.5525001",
"0.5504246",
"0.550138",
"0.55005497",
"0.5491038",
"0.54892856",
"0.5466592",
"0.54557025",
"0.5443171",
"0.5441207",
"0.5437166",
"0.54236877",
"0.5418934",
"0.5400833",
"0.539112",
"0.53752077",
"0.537311... | 0.61152047 | 0 |
Rebirth popId,Prevent id from repeating | function creatPopId(){
var i = "pop_" + (new Date()).getTime()+parseInt(Math.random()*100000);//Popup Index
if($("#" + i).length > 0){
return creatPopId();
}else{
return i;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function resetId(){\n\n\t\tID = 0;\n\n\t}",
"function resetLastId() {\n\t\t lastId = 0;\n\t\t}",
"function clearNextId(){\n NextId = undefined;\n}",
"function getNewId(){\n return healthInfos[healthInfos.length -1].id + 1;\n}",
"function duplicateMenuID () {\n $('#nav-left.jPanelMenu-menu').f... | [
"0.6502252",
"0.635923",
"0.62114674",
"0.61847353",
"0.61290956",
"0.59822017",
"0.59822017",
"0.59822017",
"0.5956967",
"0.58945066",
"0.58238184",
"0.57505244",
"0.575033",
"0.57498187",
"0.5746267",
"0.5743574",
"0.57370543",
"0.5732474",
"0.5704198",
"0.56969166",
"0.569... | 0.7001824 | 0 |
return the DR indicated by the Hit Location | get DR() {
if (this._userEnteredDR !== null) return this._userEnteredDR
if (this._hitLocation === 'Random') return 0
// if (this._hitLocation === 'User Entered') return this._userEnteredDR
if (this._hitLocation === 'Large-Area') {
let lowestDR = Number.POSITIVE_INFINITY
let torsoDR = 0
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"get effectiveDR() {\n let dr = this.DR\n\n if (this._isShotgun && this._shotgunRofMultiplier > 1) {\n dr = dr * this.shotgunDamageMultiplier\n }\n\n if (this._useArmorDivisor && !!this._armorDivisor) {\n // -1 divisor means \"Ignore DR\"\n let armorDivisor = this.effectiveArmorDivisor\n ... | [
"0.62565804",
"0.55402017",
"0.53531533",
"0.5328014",
"0.5236112",
"0.51663077",
"0.51415324",
"0.5133668",
"0.5118197",
"0.5090502",
"0.5052354",
"0.49962872",
"0.49867532",
"0.49710906",
"0.4970366",
"0.4945003",
"0.49433637",
"0.49347743",
"0.4927208",
"0.49092826",
"0.49... | 0.7792565 | 0 |
figure out the current DR modified by armor divisor, if necessary | get effectiveDR() {
let dr = this.DR
if (this._isShotgun && this._shotgunRofMultiplier > 1) {
dr = dr * this.shotgunDamageMultiplier
}
if (this._useArmorDivisor && !!this._armorDivisor) {
// -1 divisor means "Ignore DR"
let armorDivisor = this.effectiveArmorDivisor
if (armorDiv... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"get DR() {\n if (this._userEnteredDR !== null) return this._userEnteredDR\n\n if (this._hitLocation === 'Random') return 0\n\n // if (this._hitLocation === 'User Entered') return this._userEnteredDR\n\n if (this._hitLocation === 'Large-Area') {\n let lowestDR = Number.POSITIVE_INFINITY\n let ... | [
"0.64594454",
"0.59327394",
"0.5706033",
"0.55019706",
"0.5327076",
"0.53228927",
"0.525101",
"0.5249095",
"0.5235892",
"0.52252954",
"0.52150804",
"0.52117896",
"0.5207777",
"0.5046626",
"0.5020281",
"0.5011659",
"0.5005839",
"0.49944258",
"0.49944258",
"0.49833542",
"0.4949... | 0.80522203 | 0 |
DAMAGE CALCULATION Basic Damage = Number rolled on the dice. Effective Damage = Basic Damage, unless this is a ranged attack and the range is beyond the weapon's 1/2D range, in which case we divide the damage by 2. DR = The DR of the Hit Location. Effective DR = DR adjusted for armor divisor, if any. Hardened DR reduce... | get effectiveDamage() {
if (this._parent.isRangedHalfDamage) {
return Math.floor(this._basicDamage / 2)
} else if (this._parent.isShotgun) {
return this._basicDamage * this._parent.shotgunDamageMultiplier
} else if (this._parent.isExplosion) {
return Math.floor(this._basicDamage / this._pa... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function calcDamage(_minDps, _maxDps, _power, _weaponSpeed, _mastery){ \r\r\n //(weaponDPS + AttackPower/3,5 ) * weapon speed = DPS\r\r\n let coefficient = 1 + (_mastery * 0.01);\r\r\n \r\r\n // Calculating Upper Limit\r\r\n character.stats.attack.dmg_high = (_maxDps + _power/3.5) * _weaponSpeed... | [
"0.7262258",
"0.72266173",
"0.7090479",
"0.69910043",
"0.69586843",
"0.69245046",
"0.69032145",
"0.68276215",
"0.67217624",
"0.6707505",
"0.67062974",
"0.6702728",
"0.6698805",
"0.6671361",
"0.666056",
"0.6655146",
"0.66315985",
"0.6620325",
"0.6616109",
"0.6612864",
"0.65764... | 0.7291122 | 0 |
Injury is equal to penetrating damage x total wounding modifiers. | get injury() {
this._maxInjuryForDiffuse = null
let injury = Math.floor(this.penetratingDamage * this._parent.totalWoundingModifier)
if (this._parent._damageReductionLevel !== null && this._parent._damageReductionLevel != 0) {
// Injury Tolerance (Damage Reduction) can't reduce damage below 1
i... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"lifeExpectancyVenus() {\n let venusianLifeExpectancy = Math.floor(this.lifeExpectancy/0.62);\n return venusianLifeExpectancy;\n }",
"getDamageAmount() {\n return 0.1 + this.operators.reduce((acc, o) => (acc + o.experience), 0);\n }",
"get stealChance() {\n return (this.Dexterity + this.... | [
"0.6266466",
"0.6083549",
"0.6033385",
"0.60176677",
"0.6002777",
"0.58648604",
"0.58566165",
"0.58346975",
"0.5803646",
"0.57836324",
"0.5778958",
"0.57714397",
"0.57374877",
"0.57347584",
"0.5652666",
"0.5641786",
"0.5631217",
"0.5625973",
"0.56124824",
"0.56068116",
"0.557... | 0.6873265 | 0 |
Draw layers in Canvas | function drawCanvas() {
// Erase everything currently on the canvas
context.clearRect(0, 0, canvas.width, canvas.height);
// Loop through each layer in the list and draw it to the canvas
layer_list.forEach(function(layer, index) {
// If the layer has a blend mode set, use that blend mode, otherwise use nor... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function paint() {\n\n\t\t// Number of layers in total\n\t\tvar layersLength = layers.length;\n\n\t\t// Draw the overlap layers\n\t\tfor( var i = layersLength - layerOverlap, len = layersLength; i < len; i++ ) {\n\n\t\t\tcontext.save();\n\t\t\tcontext.globalCompositeOperation = 'destination-over';\n\t\t\tpaintLaye... | [
"0.72030795",
"0.7173118",
"0.69003123",
"0.6877766",
"0.6859861",
"0.6809778",
"0.6759782",
"0.6741603",
"0.67383075",
"0.6697196",
"0.6642054",
"0.6638311",
"0.6638311",
"0.6638311",
"0.6638311",
"0.6607878",
"0.66064715",
"0.66057426",
"0.65976506",
"0.6592505",
"0.6585654... | 0.771319 | 0 |
This will be used to filter out the non relevant links when the user types into the search bar | function filterSearchLinks() {
const filter = searchBar.value.toUpperCase();
const searchList = document.getElementById("searchLinks");
const searchListLi = searchList.getElementsByTagName("li");
let searchListA;
let searchTxtVal;
for (searchI = 0; searchI < searchListLi.length; sea... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function filterLinks() {\n var filterValue = document.getElementById('filter').value;\n if (document.getElementById('regex').checked) {\n visibleLinks = allLinks.filter(function(link) {\n return link.match(filterValue);\n });\n } else {\n var terms = filterValue.split(' ');\n visibleLinks = all... | [
"0.77038664",
"0.68130106",
"0.65455514",
"0.6543981",
"0.64214957",
"0.6399391",
"0.63580656",
"0.6304802",
"0.62328637",
"0.6210927",
"0.61719424",
"0.6170751",
"0.61426383",
"0.61291116",
"0.6124272",
"0.61048347",
"0.6077842",
"0.60049224",
"0.5985497",
"0.5978311",
"0.59... | 0.7513764 | 1 |
This will be used to detect whether or not the dev or user is in localhost or live(hosting server) mode | function checkingHosting() {
if (window.location.hostname === "localhost") {
//checkingLocalHostURLS();
console.log("User is on LOCALHOST");
}
if (window.location.hostname === "127.0.0.1") {
//checkingLocalHostURLS();
console.log("User is on LOCALHOST");
}
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function devMode() {\n return location.hostname === \"localhost\" || location.hostname === \"127.0.0.1\";\n}",
"function isDevEnv() {\n var scripts = document.getElementsByTagName('script'),\n localhostTests = [\n /^localhost$/,\n /\\b(25[0-5]|2[0-4][0-9]|[01]?[... | [
"0.832831",
"0.73127145",
"0.72539365",
"0.7146979",
"0.70295197",
"0.666672",
"0.65405244",
"0.6491723",
"0.64609414",
"0.6447921",
"0.6447921",
"0.6447921",
"0.6441787",
"0.6441787",
"0.64052963",
"0.64013827",
"0.64013827",
"0.64013827",
"0.64013827",
"0.64013827",
"0.6401... | 0.74652815 | 1 |
Adds check/checkmate colour to the appropriate king | function DrawCheck(boardData) {
if (whiteTurn) {
//White have check
if (SpaceIsAttacked(boardData, "white", blackKing.currentPos).length > 0) {
$(".square#" + blackKing.currentPos + " img").addClass('check');
if (CheckForCheckmate(boardData, "white", blackKing)) {
$(".square#" ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function isKing(checker){\n if(((checker.getAttribute('player') === 'red') && (parseInt(checker.getAttribute('position')[0]) === 8)) || ((checker.getAttribute('player') === 'black') && (parseInt(checker.getAttribute('position')[0]) === 1))){\n checker.classList.add('king');\n }\n}",
"function setCol... | [
"0.68510365",
"0.65609896",
"0.6263423",
"0.6204209",
"0.61220276",
"0.6075234",
"0.6057059",
"0.59635425",
"0.59597147",
"0.5945823",
"0.5929296",
"0.59165066",
"0.5883575",
"0.5869466",
"0.586656",
"0.5841367",
"0.58396465",
"0.5830386",
"0.582844",
"0.5803882",
"0.57900685... | 0.6733064 | 1 |
end tab setup get counts of the stations for each group in each tab | function getStationCounts(thisTab) {
staTab = staGeoJSON.features.filter( tabs[thisTab].tabSelect );
tabs[thisTab].tabCountGCN = staTab.filter(
function(sta) { return sta.properties.gloss_core }
).length;
if (thisTab === "sta_uhslc") {
tabs[thisTab].special[0] = staTab.filter... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function num_availHouses(ndx, group) {\n dc.dataCount('.dc-data-count')\n .crossfilter(ndx)\n .groupAll(group)\n .transitionDuration(500);\n}",
"function count() {\n // Local helper function\n var overview = dom.datum().filter(function(l) { return l.Overview; })\n , details = dom... | [
"0.64243436",
"0.58924115",
"0.569703",
"0.5658298",
"0.5496483",
"0.5481063",
"0.5373776",
"0.5367276",
"0.5338737",
"0.53180283",
"0.53020084",
"0.52096695",
"0.5192507",
"0.51896197",
"0.51081264",
"0.5102987",
"0.5086473",
"0.5037666",
"0.50265104",
"0.49879017",
"0.49735... | 0.7911142 | 0 |
assign colors based on groups in this tab | function assignColors(sta) {
for (var k = 0; k < tab.group.length; k++) {
if (tab.groupSelect[k](sta)) { return tab.groupColor[k]; }
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function change_groups(inst_index) {\n d3.selectAll('.' + dom_class)\n .style('fill', function(d) {\n return group_colors[d.group[inst_index]];\n });\n }",
"setup_group_ui(self, groups) {\n self.setup_filters(self,groups,\"Groups\");\n var defaultScheme = { hmin: 0, hmax: 360, cmin: 30... | [
"0.71821046",
"0.68398976",
"0.654043",
"0.64166915",
"0.6308003",
"0.6296873",
"0.62595665",
"0.6188539",
"0.61178595",
"0.6100094",
"0.6060117",
"0.6045814",
"0.6026501",
"0.6015272",
"0.60125744",
"0.598741",
"0.5972162",
"0.59606814",
"0.59587383",
"0.5938463",
"0.5930611... | 0.7673776 | 0 |
IS TIME VALID FORMAT? | function valid_time(time) {
time = time.split(':');
if (time[0] >= 0 && time[0] <= 24
&& time[1] >= 0 && time[1] <= 59) {
return true;
} else {
return false;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function checkTime(time){\r\n\tvar re = /^(([01][0-9])|(2[0-3])):[0-5][0-9]$/;\r\n\tif (re.test(time)) return true;\r\n\telse return false;\r\n}",
"function validTime(time, id) \n\t\t{\n\t\t\tvar isValid = false;\n\t\t\t\n\t\t\tif (time === \"\")\n\t\t\t\tisValid = true;\n\t\t\telse \n\t\t\t\tisValid = /([0-1]\\... | [
"0.80095917",
"0.79197437",
"0.78987384",
"0.7641964",
"0.76109403",
"0.7587056",
"0.7583503",
"0.75679",
"0.7554869",
"0.7549598",
"0.74403816",
"0.74066037",
"0.7359024",
"0.73414063",
"0.7294133",
"0.7294133",
"0.7294133",
"0.7294133",
"0.7294133",
"0.7294133",
"0.7275294"... | 0.8056607 | 0 |
RETURN TRUE IF THE TIME IS WITHIN THE RANGE OF THE PICO Y PLACA | function horario(time) {
time = time.split(':');
if (time[0] >= 7 && time[0] <= 8) {
return true;
}
if (time[0] >= 16 && time[0] <= 18) {
return true;
}
if (time[0] == 9 || time[0] == 19) {
if (time[1] >= 0 && time[1] <= 30) {
return true;
}
}
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function FiveFieldTimeIsContinuous(arrA, arrB) {\n \t// time should be 23:59 vs 0:0\n \tif (arrA[3]!=23 || arrA[4]!=59 || arrB[3]!=0 || arrB[4]!=0) return false;\n \t\n \t// increase arrA by one\n \tvar arrAInc = [arrA[0], arrA[1], arrA[2]];\n \tFiveFieldTimeIncrease(arrAInc, 1);\n \t\n \treturn arrAInc[0]... | [
"0.66341317",
"0.66156864",
"0.66032374",
"0.65940225",
"0.6489693",
"0.63524246",
"0.6351805",
"0.6330121",
"0.6296433",
"0.6279739",
"0.6266942",
"0.62322557",
"0.62130517",
"0.62124336",
"0.6192402",
"0.6191681",
"0.61873585",
"0.61870617",
"0.6165046",
"0.61627996",
"0.61... | 0.6954361 | 0 |
/ get selected element object | function get_selected_element() {
return iframe.find(".yp-selected");
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"getSelection(){\n return this.element;\n }",
"get selectedElement() {\n return this._selectedElement && this._selectedElement.get();\n }",
"function getSelected() {\n\t\t\t\treturn angular.element(document.getElementById(scope.selected.id));\n\t\t\t}",
"function getSelection() {\r\n\tvar select... | [
"0.75466",
"0.7473397",
"0.714954",
"0.7050807",
"0.7025487",
"0.6851887",
"0.6836184",
"0.6657112",
"0.6613561",
"0.65750784",
"0.65617263",
"0.6482806",
"0.64361393",
"0.6418768",
"0.63246536",
"0.63024026",
"0.63024026",
"0.62864906",
"0.6264966",
"0.62341774",
"0.6217775"... | 0.76669395 | 0 |
/ check if content selected | function is_content_selected() {
return body.hasClass("yp-content-selected");
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function checkSelectedText() {\n var parentEl = getSelectionParentElement();\n article_text = document.getElementById('article-text'),\n body = document.getElementsByTagName('body')[0];\n if (parentEl === null) {\n return false;\n }\n while (parentEl !== body) {\n var classL... | [
"0.6899226",
"0.6876001",
"0.6833596",
"0.6773934",
"0.6601618",
"0.63238794",
"0.61978304",
"0.6158277",
"0.61467797",
"0.60195506",
"0.60174996",
"0.59896684",
"0.59896684",
"0.59811485",
"0.5975211",
"0.59636676",
"0.5948405",
"0.5948405",
"0.59363824",
"0.59262025",
"0.58... | 0.83999056 | 0 |
/ Check if is anim creator mode | function is_animate_creator() {
return body.hasClass("yp-anim-creator");
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"isAnimating() {\n return animationFrame > 1;\n }",
"function isAnimate(obj){\r\n\t\treturn obj.is(\":animated\") ? false : true;\r\n\t}",
"isAnimating() {\n return this.animations.length &&\n this.animations.some((anim) => anim.blocksGameLoop());\n }",
"isMoving () {\n return this... | [
"0.65404624",
"0.6382348",
"0.6319298",
"0.6315561",
"0.6285649",
"0.61885935",
"0.604129",
"0.60307235",
"0.6011868",
"0.6008874",
"0.59368384",
"0.59325385",
"0.59007365",
"0.5837412",
"0.58278346",
"0.58206147",
"0.5794991",
"0.5783901",
"0.5695074",
"0.56865513",
"0.56814... | 0.81140286 | 0 |
/ Updating Design information section | function update_design_information(type) {
// Was wireframe?
var washaveWireFrame = false;
// Check wireframe
if (body.hasClass("yp-wireframe-mode")) {
washaveWireFrame = true;
body.removeClass("yp-wireframe-mode");
}
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function updateDefinition(def) {\n def.name = $('#form-modinfo-name').val();\n def.description = $('#form-modinfo-description').val();\n def.author = $('#form-modinfo-author').val();\n def.changelog = $('#form-modinfo-changelog').val();\n def.contest = $('#form-modinfo-contest').prop('checked');\n ... | [
"0.65140104",
"0.60617405",
"0.5990083",
"0.59589666",
"0.5915359",
"0.58318293",
"0.58293736",
"0.5824523",
"0.57870936",
"0.5776189",
"0.5770634",
"0.575642",
"0.57433915",
"0.57391983",
"0.57364994",
"0.5611903",
"0.5611011",
"0.5603011",
"0.5597536",
"0.55904025",
"0.5587... | 0.6973989 | 0 |
/ YP_SET_SELECTOR / / Creating tooltip, borders. Set as selected element. | function set_selector(selector, selected) {
clean();
window.setSelector = selector;
var element = iframe.find(get_foundable_query(selector, true, false, false));
body.attr("data-clickable-select", selector);
if (iframe.find(".yp-will-selected").length > 0... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function draw_tooltip() {\n\n if (iframe.find(\".yp-selected-tooltip\").length <= 0) {\n return false;\n }\n\n var tooltip = iframe.find(\".yp-selected-tooltip\");\n var tooltipMenu = iframe.find(\".yp-edit-menu\");\n\n // Hide until set positio... | [
"0.56341165",
"0.56177634",
"0.55927974",
"0.54649115",
"0.5200092",
"0.5190889",
"0.5173995",
"0.51489776",
"0.51216316",
"0.5069981",
"0.5030542",
"0.5027214",
"0.5015688",
"0.499177",
"0.49630716",
"0.49067855",
"0.49067855",
"0.4877907",
"0.48648325",
"0.48574132",
"0.485... | 0.5906887 | 0 |
Smart insert default values for options. | function insert_default_options() {
if (is_content_selected() === false) {
return false;
}
// current options
var options = $(".yp-editor-list > li.active:not(.yp-li-about) .yp-option-group");
// delete all cached data.
$("li[dat... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"setOptions() {\n let defaultObj = {numChar: 1, limitNum: 3, orderBlock: [\"suggest\",\"collection\",\"product\"]};\n if(!this.options)\n {\n this.options = defaultObj; // set default if user not put arg\n }\n else {\n for(let key in defaultObj) // \n ... | [
"0.68584585",
"0.6824782",
"0.67294246",
"0.67294246",
"0.6658961",
"0.64023834",
"0.63962966",
"0.6267927",
"0.6227793",
"0.6209254",
"0.61783165",
"0.61618847",
"0.6159553",
"0.6135686",
"0.6042222",
"0.6024608",
"0.6010272",
"0.59759825",
"0.59759825",
"0.5965851",
"0.5957... | 0.6972509 | 0 |
Get current media condition | function get_media_condition() {
// Default
var size = 'desktop';
// Is res?
if ($("body").hasClass("yp-responsive-device-mode")) {
var frameWidth = iframe.width();
var media = $(".media-control").attr("data-code");
size ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function get_current_media_query() {\n\n if (!body.hasClass(\"yp-responsive-device-mode\")) {\n return 'desktop';\n } else {\n var w = iframe.width();\n var format = $(\".media-control\").attr(\"data-code\");\n return '(' + format + ... | [
"0.6588188",
"0.6110091",
"0.58932996",
"0.57910335",
"0.5788236",
"0.57066476",
"0.57066476",
"0.5659693",
"0.5599111",
"0.55866367",
"0.5575042",
"0.54642254",
"0.54576176",
"0.54576176",
"0.54576176",
"0.54576176",
"0.54494864",
"0.54494864",
"0.5421262",
"0.5409299",
"0.5... | 0.73254085 | 0 |
Getting current CSS Selectors | function get_all_selectors() {
// Source.
var source = editor.getValue();
source = get_minimized_css(source, true);
// if no source, stop.
if (source == '') {
return false;
}
// if have a problem in source, stop.
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getCssSelectors() {\n const selectors = [\n { id: 'root', classList: ['root'], lvl: 0, children: [] }\n ]\n const rootEl = document.getElementById('root')\n\n const walker = (nodes, selectors) => {\n for (let node of nodes) {\n if (node.nodeType !== 1) continue\n if (node.tagName === '... | [
"0.6925777",
"0.64156264",
"0.6217855",
"0.612379",
"0.6066117",
"0.60550666",
"0.60075295",
"0.59776974",
"0.5957909",
"0.5953643",
"0.59228",
"0.59193754",
"0.58786696",
"0.5838354",
"0.5799476",
"0.576505",
"0.57468957",
"0.5745947",
"0.57320243",
"0.5729314",
"0.5675651",... | 0.69483286 | 0 |
/ Check if is safe font family. | function is_safe_font(a) {
if (isUndefined(a)) {
return false;
}
if (a.toLowerCase().match(/\barial\b|\barial black\b|\barial narrow\b|\barial rounded mt bold\b|\bavant garde\b|\bcalibri\b|\bcandara\b|\bcentury gothic\b|\bfranklin gothic medium\b|\bgeneva\b|\bfutura... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function isHTMLFont(attrs) {\n for(var i = 0, n = attrs.length; i < n; i++) {\n switch(attrs[i][0]) {\n case \"color\":\n case \"face\":\n case \"size\":\n return true;\n }\n }\n return false;\n }",
"function checkFont() {\n for (glyph in drawnGlyp... | [
"0.6456508",
"0.6280666",
"0.61366147",
"0.6134823",
"0.60075307",
"0.5851121",
"0.58202463",
"0.57757145",
"0.57616407",
"0.57396567",
"0.57156783",
"0.5707278",
"0.56564206",
"0.56381863",
"0.56369686",
"0.56287444",
"0.5609641",
"0.5589549",
"0.55762786",
"0.5562517",
"0.5... | 0.7465148 | 0 |
Creating live CSS for color, slider and fontfamily and weight. | function insert_live_css(id, val, custom) {
// Responsive helper
var mediaBefore = create_media_query_before();
var mediaAfter = create_media_query_after();
// Style id
var styleId;
if (custom !== false) {
styleId = custom;
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function updateColour() {\n document.documentElement.style.setProperty('--' + this.name, this.value); //update the css variables\n}",
"css() {\n this.style__block = css({\n \"color\": this.theme.color,\n \"backgroundColor\": this.theme.backgroundColor\n })\n }",
"function SetCSS()\n{\n\t$(\... | [
"0.64147395",
"0.63674515",
"0.6238894",
"0.6231843",
"0.61989605",
"0.6189552",
"0.6183322",
"0.6176886",
"0.6171013",
"0.61685383",
"0.6150644",
"0.61104643",
"0.6070638",
"0.60584414",
"0.6039545",
"0.6037028",
"0.60252464",
"0.60189235",
"0.6016273",
"0.60133797",
"0.6000... | 0.6433954 | 0 |
Removing created live CSS | function delete_live_css(id, custom) {
// Style id
var styleId;
if (custom !== false) {
styleId = custom;
} else {
styleId = "#" + id + "-live-css";
}
var element = iframe.find(styleId);
if (element.le... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function removeDynamicStyle() {\n util.$(\"#annotator-dynamic-style\").remove();\n }",
"remove () {\n this.node.parentNode.removeChild(this.node)\n this.stylesheet.parentNode.removeChild(this.stylesheet)\n }",
"function cleanCssOut() {\n\treturn del([cssDest + cssOut]);\n}",
"if (window.scCGSHMRCa... | [
"0.71457464",
"0.6796974",
"0.6762002",
"0.66509837",
"0.66439867",
"0.65751785",
"0.65549904",
"0.65545106",
"0.65492207",
"0.65492207",
"0.6523102",
"0.64755",
"0.64755",
"0.64755",
"0.64755",
"0.64755",
"0.64686435",
"0.6440793",
"0.6368343",
"0.63444173",
"0.63399196",
... | 0.7502805 | 0 |
/ Converting selectors to Array | function get_selector_array(selector) {
var selectorArray = [];
// Clean
selector = $.trim(selector);
// Clean multispaces
selector = selector.replace(/\s\s+/g, ' ');
// Clean spaces before ">,+,~" and after
selector = selector.repl... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function gortSelector(selector) {\n // selector is gonna start with either a hash (#) or a dot (.)\n var selectorFirstChar = selector[0];\n var elements = []; // array to return\n\n // if firstChar of selector is a hash, then\n // use document.getElementById\n // else if firstChar of selector is a dot, then\... | [
"0.7219402",
"0.68252593",
"0.6708627",
"0.6699699",
"0.66892976",
"0.66892976",
"0.66892976",
"0.6588502",
"0.6588502",
"0.6588502",
"0.6575633",
"0.6556163",
"0.6556163",
"0.6556163",
"0.6552114",
"0.6463909",
"0.644745",
"0.6417997",
"0.6409815",
"0.64023757",
"0.63951343"... | 0.79731697 | 0 |
/ Get Best Class Name / / the most important function in yellow pencil scripts this functions try to find most important class name in classes. If no class, using ID else using tag name. | function get_best_class($element) {
// Cache
var element = $($element);
// Element Classes
var classes = element.attr("class");
// Clean Yellow Pencil Classes
if (classes !== undefined && classes !== null) {
classes = class_clean... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"_getClassNames(_id) {\n const _elem = this._elements[_id];\n if (this._isSVGElem(_elem)) {\n return _elem.className.baseVal;\n }\n else {\n return _elem.className;\n }\n }",
"_getClassNames(_id) {\n const _elem = this._elements[_id];\n if (this._isSVGElem(_elem)) {\n return _... | [
"0.64895564",
"0.64895564",
"0.62356675",
"0.606938",
"0.6062472",
"0.59954256",
"0.5908548",
"0.5892267",
"0.5844001",
"0.57929564",
"0.57410306",
"0.5738132",
"0.5729657",
"0.57162535",
"0.56908166",
"0.5633873",
"0.5624663",
"0.5621319",
"0.5605736",
"0.55699944",
"0.55646... | 0.79852307 | 0 |
/ Get Human Selectors | function get_human_selector(data) {
var allSelectors, i;
// Don't search it always
if (window.humanSelectorArray.length === 0) {
// Getting minimized data.
data = get_minimized_css(data, true);
// if no data, stop.
i... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function selector(a,b){var a=a.match(/^(\\W)?(.*)/),b=b||document,c=b[\"getElement\"+(a[1]?\"#\"==a[1]?\"ById\":\"sByClassName\":\"sByTagName\")],d=c.call(b,a[2]),e=[];return null!==d&&(e=d.length||0===d.length?d:[d]),e}",
"function selector(a,b){var a=a.match(/^(\\W)?(.*)/),b=b||document,c=b[\"getElement\"+(a[1... | [
"0.58154774",
"0.58154774",
"0.58154774",
"0.5628376",
"0.5628376",
"0.5628376",
"0.5617877",
"0.56144875",
"0.55701107",
"0.5491352",
"0.5483492",
"0.5429889",
"0.5392398",
"0.5374677",
"0.5365339",
"0.5325194",
"0.532299",
"0.5319281",
"0.52898043",
"0.5259497",
"0.52585524... | 0.5911441 | 0 |
This function add to class to body tag. ex input: .element1 .element2 ex output: body.customclass .element1 element2 | function add_class_to_body(selector, prefix) {
var selectorOrginal = selector;
// Basic
if (selector == 'body') {
selector = selector + "." + prefix;
}
// If class added, return.
if (selector.indexOf("body." + prefix) != -1) {
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function bodyAddClass(cl){\n $('body').attr('class',cl);\n}",
"addClass() {\n document.body.classList.add('learn-to-code');\n }",
"function setBodyClass(){\n /* nectar addition */ \n /*\n var section = $(SECTION_ACTIVE_SEL);\n var slide = section.find(SLIDE_AC... | [
"0.783924",
"0.6692658",
"0.6401956",
"0.6293192",
"0.62484115",
"0.62369037",
"0.6230365",
"0.610771",
"0.61038995",
"0.61038995",
"0.61038995",
"0.60863036",
"0.60863036",
"0.60863036",
"0.607005",
"0.6068438",
"0.60523945",
"0.60455734",
"0.60455734",
"0.60455734",
"0.6028... | 0.72026587 | 1 |
to state wise districts drop down | function show_state_wise_districts(state_id){
$.ajax({
url:root_path+"/api/get_state_wise_districts.php",
dataType:"JSON",
data:{state_id:state_id},
type:"POST",
success: function(response){
var option="<option>Select District</option>";
$.each(response,function(i,v){
option+="<option value='"+v.r... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getListOfDistrict() {\n loadingDistrictsMaster();\n $.each(district, function(i, resData) {\n var districts = \"<option value=\" + resData.districtID + \">\" + resData.districtName + \"</option>\";\n $(districts).appendTo('#statutory_districtID');\n });\n $('#statutory_districtID').trigger(\... | [
"0.6870183",
"0.6796076",
"0.67857724",
"0.669324",
"0.6602299",
"0.65844494",
"0.6552114",
"0.65480435",
"0.6529889",
"0.6527973",
"0.65165746",
"0.6506385",
"0.6495828",
"0.64872074",
"0.64250463",
"0.64017934",
"0.6378143",
"0.6365721",
"0.63453436",
"0.63434887",
"0.63308... | 0.77336144 | 0 |
to district wise mandals drop down | function show_district_wise_mandals(district_id){
$.ajax({
url:root_path+"/api/get_district_wise_mandals.php",
dataType:"JSON",
data:{district_id:district_id},
type:"POST",
success: function(response){
var option="<option>Select Mandal</option>";
$.each(response,function(i,v){
option+="<option val... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function selectDistrict(){\n let outputCommune = \"<option value='0'> Chọn Phường/Xã...</option>\";\n let idDistrict = $('#input-user-district > option').filter(':selected').val();\n for (let i = 0; i < listCommune.length; i ++){\n if (listCommune[i].idDistrict == idDistrict){\n outp... | [
"0.696943",
"0.6770257",
"0.6762521",
"0.6669056",
"0.6665093",
"0.6613179",
"0.65387905",
"0.6475973",
"0.6445508",
"0.64386797",
"0.63059723",
"0.6293972",
"0.6291056",
"0.6198939",
"0.61759686",
"0.61469764",
"0.6142236",
"0.6132395",
"0.6129354",
"0.6076416",
"0.59985137"... | 0.71188647 | 0 |
to mandal wise villages drop down | function show_mandal_wise_villages(mandal_id){
$.ajax({
url:root_path+"/api/get_mandal_wise_villages.php",
dataType:"JSON",
data:{mandal_id:mandal_id},
type:"POST",
success: function(response){
var option="<option>Select Village</option>";
$.each(response,function(i,v){
option+="<option value='"+v... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"toggSel (c, i) {\r\n const O = this;\r\n let opt = null;\r\n if (typeof (i) === \"number\") {\r\n O.vRange(i);\r\n opt = O.E.find('option')[i];\r\n }\r\n else {\r\n opt = O.E.find(`option[value=\"${i}\"]`)[0] || 0;\r\n }\r\n ... | [
"0.638148",
"0.61917335",
"0.6114758",
"0.6077887",
"0.60489315",
"0.6046341",
"0.60073555",
"0.6004611",
"0.60042906",
"0.5982515",
"0.59621024",
"0.59554005",
"0.59477764",
"0.5929121",
"0.5919428",
"0.59187573",
"0.59016067",
"0.5875231",
"0.5865257",
"0.58567995",
"0.5829... | 0.647797 | 0 |
to country wise states drop down | function show_country_wise_states(country_id){
$.ajax({
url:root_path+"/api/get_country_wise_states.php",
dataType:"JSON",
data:{country_id:country_id},
type:"POST",
success: function(response){
var option="<option>Select state</option>";
$.each(response,function(i,v){
option+="<option value='"+v.... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getStates(){\n\t\n\t\n\tvar country=$(\"#country option:selected\").val();\n\t $(\"#state\").empty();\n\t $(\"#state\").append('<option value=\"-1\">- - - Select - - -</option>');\n\tif(country!=-1){\n\t\tvar str = $('#srvUrl').val()+\"/ajax/getStates/\"+country; \n\t\t $.ajax({\n\t\t url: str,\n\n\t... | [
"0.731232",
"0.7207684",
"0.71929973",
"0.7057829",
"0.7049968",
"0.7031424",
"0.702247",
"0.7012598",
"0.69387776",
"0.69149464",
"0.6894996",
"0.6880221",
"0.6842409",
"0.6823631",
"0.67662376",
"0.6755662",
"0.6742356",
"0.67399275",
"0.67230284",
"0.6713515",
"0.6709157",... | 0.77355415 | 0 |
populate data in district edit form | function district_edit(rec_id){
$.ajax({
url:"http://localhost/nps_logistic/api/get_district_edit.php",
dataType:"JSON",
type:"POST",
data:{rec_id:rec_id},
success:function(response){
$("#country_drop_down_edit_district").val(response.country_id);
$("#state_drop_down_edit_district").val(response.st... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"setDistrictInfo(id){\n var self = this;\n self.selected_district = id.replace(/-/g, \" \"); \n }",
"function mandal_edit(rec_id){\n\t$.ajax({\n\t\turl:\"http://localhost/nps_logistic/api/get_mandal_edit.php\",\n\t\tdataType:\"JSON\",\n\t\ttype:\"POST\",\n\t\tdata:{rec_id:rec_id},\n\t\tsuccess:fu... | [
"0.647073",
"0.62794006",
"0.6269547",
"0.6240642",
"0.6231793",
"0.61649066",
"0.6153072",
"0.61397773",
"0.6092294",
"0.60772145",
"0.6051852",
"0.60346144",
"0.6034036",
"0.5969216",
"0.5941077",
"0.5926045",
"0.58618003",
"0.5852916",
"0.58142775",
"0.5795327",
"0.5792709... | 0.73795503 | 0 |
populate data in village edit form | function village_edit(rec_id){
$.ajax({
url:"http://localhost/nps_logistic/api/get_village_edit.php",
dataType:"JSON",
type:"POST",
data:{rec_id:rec_id},
success:function(response){
$("#country_drop_down_edit_village").val(response.country_id);
$("#state_drop_down_edit_village").val(response.state_... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function updateEditForm(data){\n $('#editRoomTheaterSelect').val(data.theater_id);\n $('#editRoomCapacity').val(data.capacity);\n }",
"showEditForm(data) {\n const newData = {\n id: data.id,\n ... | [
"0.66620505",
"0.63013124",
"0.6248614",
"0.61180395",
"0.6043144",
"0.6038563",
"0.6011835",
"0.6004166",
"0.5949147",
"0.5938775",
"0.5892401",
"0.5890246",
"0.58893055",
"0.5881431",
"0.5880645",
"0.58762574",
"0.5870326",
"0.58566004",
"0.58494776",
"0.5840363",
"0.583786... | 0.7302998 | 0 |
populate data in branches edit form | function branch_edit(rec_id){
$.ajax({
url:"http://localhost/nps_logistic/api/get_branch_edit.php",
dataType:"JSON",
type:"POST",
data:{rec_id:rec_id},
success:function(response){
$("#country_drop_down_edit_branches").val(response.country_id);
$("#state_drop_down_edit_branches").val(response.state_... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function saveBranchingEdit(_data){\n\t\tvar extra = $(data).find(\"page\").eq(currentPage).children(\"branch\").length;\n\t\tvar active = branchCount;\n\t\t//var removed = extra - active;\n\t\tfor(var i = extra + 1; i >= active; i--){\n\t\t\t$(data).find(\"page\").eq(currentPage).children(\"branch\").eq(i).remove(... | [
"0.58351463",
"0.5732379",
"0.5710806",
"0.5681476",
"0.56699294",
"0.5626374",
"0.56137705",
"0.560462",
"0.560462",
"0.55771536",
"0.5562017",
"0.552974",
"0.5519767",
"0.55170685",
"0.5479877",
"0.54626304",
"0.542791",
"0.5425479",
"0.5414687",
"0.5404859",
"0.5397326",
... | 0.68137044 | 0 |
my requestForm1 work start here | function myRequestForm1(){
var email1=$("#email1").val();
var emailCheck1 = /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/;
var mobile1= $("#mobile1").val();
//alert(mobile1.length);
if(!mobile1=="" && mobile1.length==13){
mobile1= mobile1;
}else if(!mobile1=="" && mobile1.length==11){
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function handleFormRequest() {\n var $inputs = $('.demo-form :input');\n var values = captureFormData($inputs);\n var url;\n // submitRequest(values, url);\n}",
"function omniFormPath(){\n\t\tsubmitomniFormPath(event,omniFormPath);\n}",
"function myRequestForm(){\n\t\t\tvar email=$(\"#email\").val();\n\t\t... | [
"0.66807795",
"0.6388632",
"0.61945873",
"0.6141779",
"0.60748386",
"0.6064961",
"0.6035545",
"0.60275733",
"0.6024426",
"0.60187155",
"0.6003906",
"0.5990767",
"0.59875625",
"0.59834117",
"0.59772766",
"0.59580195",
"0.5950543",
"0.5940545",
"0.5935017",
"0.59296685",
"0.591... | 0.67353636 | 0 |
Given a hash and restraints on the token variations, retrieve the appropriate translation for our map. A null entry is a signal not to add the translation to the map, because it's already in the map via its fallback ('') keys. | getConstrainedTranslation(
hash: PatternHash,
tokenConstraints: TokenToConstraint,
): ?string {
const constraintKeys = [];
for (const token in this._tokenToMask) {
constraintKeys.push([token, tokenConstraints[token] || '*']);
}
const constraintMap = this._getConstraintMapWithMemoization(... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function _translateValue(translationArray, key) {\n\t\tvar value = _coalesceOutput(key);\n\t\tif (translationArray === null) {return value;}\n\t\tvar lookup = translationArray[value.toLowerCase().trim()];\n\t\treturn (typeof(lookup) !== \"undefined\" && lookup !== \"\") ? lookup : value;\n\t}",
"_buildRecursive(... | [
"0.54647636",
"0.5392542",
"0.5340886",
"0.5107106",
"0.5092652",
"0.5079412",
"0.497499",
"0.497499",
"0.49062496",
"0.4894989",
"0.48723763",
"0.48535073",
"0.48265377",
"0.48251882",
"0.48204195",
"0.4806571",
"0.47984365",
"0.47893274",
"0.47893274",
"0.47893274",
"0.4789... | 0.63039327 | 0 |
Forward all messages to SDL Core from any connected client without filtering. | function forwardToSDL(msg) {
sdlConnection.send(msg);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"forward(id, kind, data, exceptFor) {\n const connections = this.loggedIn.get(id);\n if (!connections) {\n return;\n }\n\n for (const connection of connections) {\n if (connection !== exceptFor) {\n connection.send(kind, data);\n }\n }\n }",
"function forwardToClients(msg) {\... | [
"0.6049051",
"0.60094523",
"0.5978366",
"0.58341026",
"0.5800824",
"0.5725099",
"0.56606215",
"0.56039006",
"0.5594802",
"0.55864996",
"0.55469346",
"0.55397767",
"0.55179274",
"0.5427643",
"0.542494",
"0.542494",
"0.542494",
"0.5414636",
"0.53867644",
"0.5383474",
"0.5382901... | 0.70286775 | 0 |
Only forward component messages to clients that have previously registered the corresponding component. | function forwardToClients(msg) {
var componentName = undefined;
for(var i in conClients) {
var rpc = JSON.parse(msg);
if(rpc.method) {
componentName = rpc.method.split(".")[0];
console.log("Extracted Component Name: " + componentName);
if(conClients[i].registe... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function forwardMessageToClients(message) {\n var i = 0;\n var l = clients.length;\n\n for (; i < l; ++i) {\n socket.send(\n message,\n 0,\n message.length,\n clients[i].port,\n clients[i].address,\n function(err) {\n if (err) {\n log('ERROR: could not send data ... | [
"0.6030518",
"0.5849434",
"0.5536037",
"0.5300944",
"0.5269974",
"0.52483",
"0.52049005",
"0.5175688",
"0.51732326",
"0.5141301",
"0.50867844",
"0.50729144",
"0.50704056",
"0.50427145",
"0.5041501",
"0.5021483",
"0.5018179",
"0.50143373",
"0.4985835",
"0.49802068",
"0.4980147... | 0.76043236 | 0 |
Given groups of sequential items, run a linear sequence through each simultaneously. | function linearSequence(groups) {
groups.forEach((group) => {
if (group.length) {
const groupWrap = gsap.utils.wrap(group);
const colorWrap = gsap.utils.wrap(0, 360);
let groupIndex = 1;
const groupFunction = () => {
const currentIndex = groupIndex;
const randomDuration = U... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function sequence(items, consumer) {\n var results = [];\n var runner = function runner() {\n var item = items.shift();\n if (item) {\n return consumer(item).then(function (result) {\n results.push(result);\n }).then(runner);\n }\n\n return Promise.resolve(results);\n };\n\n return... | [
"0.60565525",
"0.603436",
"0.5747232",
"0.56955075",
"0.5603907",
"0.55952054",
"0.55916536",
"0.5528264",
"0.5523226",
"0.5520324",
"0.55002344",
"0.5477526",
"0.5472109",
"0.5462338",
"0.5462338",
"0.54509306",
"0.53168076",
"0.52874565",
"0.52776444",
"0.52542967",
"0.5232... | 0.75770503 | 0 |
Creates an observer that is triggered when the 'custom events' race tab is clicked. | function createObserver() {
const raceContainer = $('#racingAdditionalContainer')[0];
var observer = new MutationObserver(function(mutations) {
for (let mutation of mutations) {
let customEventsWrap = $(mutation.addedNodes).filter('.custom-events-wrap');
if ($... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function CustomEventObserver() {\n CustomEventObserver.superclass.constructor.apply(this, arguments);\n }",
"allCustomEvents() {\n // add custom events here\n }",
"registerEvents() {\n /*\n * Activate or Open the Overview tab when extension action is clicked\n * This calls the ... | [
"0.64653444",
"0.57257015",
"0.56268483",
"0.55647534",
"0.5377385",
"0.53642166",
"0.5360783",
"0.5343964",
"0.53176403",
"0.52778786",
"0.51947445",
"0.5187435",
"0.5124414",
"0.5078374",
"0.5048462",
"0.5041064",
"0.5040135",
"0.50147486",
"0.49985084",
"0.49976203",
"0.49... | 0.6654809 | 0 |
Applies the filters to the race list and hides any race that does not meet the criteria | function filterRaces() {
let raceList = $('.events-list').children().not('.clear');
$(raceList).each((index, race) => {
let showRace = true;
let checkboxes = $(".filter-container").find("input:checked");
$(checkboxes).each((i, x) => {
if (showRace) {
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async _applyRaceFilter(race) {\n if (!this._callsDone.race.find(e => e === race) && !this._filtersObject.firstFilter) {\n const cardsByRace = await requestCardsByRace(race);\n if (cardsByRace) {\n cardsByRace.forEach(e => {\n const cachedCard = this._c... | [
"0.63158935",
"0.6240215",
"0.5912575",
"0.59013844",
"0.5848363",
"0.58361626",
"0.5803789",
"0.5739124",
"0.57160777",
"0.5702288",
"0.565811",
"0.56142586",
"0.5547116",
"0.5509912",
"0.549692",
"0.54576486",
"0.5428208",
"0.5371695",
"0.53655887",
"0.5365044",
"0.53571963... | 0.80576736 | 0 |
Run resource generation for the given platform. | async function run(platform, resourcesDirectory, options, errstream) {
debug('Running %s platform with options: %O', platform, options);
const resources = [];
const sources = [];
const adaptiveResult = await safelyGenerateAdaptiveIconResources(platform, resourcesDirectory, options["adaptive-icon" /* ADA... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async function generateSimpleResources(type, platform, resourcesDirectory, options, errstream) {\n if (!options) {\n return;\n }\n debug('Building %s resources for %s platform', type, platform);\n const source = await image_1.resolveSourceImage(platform, type, options.sources.map(s => imageSourc... | [
"0.63921124",
"0.60589075",
"0.54637736",
"0.54372",
"0.54035604",
"0.52894896",
"0.5216352",
"0.5206381",
"0.51106906",
"0.50489247",
"0.4966515",
"0.49543488",
"0.4947285",
"0.48922604",
"0.48830178",
"0.48793775",
"0.48575684",
"0.48496222",
"0.48436064",
"0.48345435",
"0.... | 0.6915268 | 0 |
Attempt to generate Adaptive Icons for any platform. If there are no options given for this resource or if the platform or source images are not suitable, this function resolves with `undefined`. | async function safelyGenerateAdaptiveIconResources(platform, resourcesDirectory, options, errstream) {
if (!options || platform !== "android" /* ANDROID */) {
return;
}
try {
return await generateAdaptiveIconResources(resourcesDirectory, options, errstream);
}
catch (e) {
deb... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async function generateAdaptiveIconResources(resourcesDirectory, options, errstream) {\n if (options.foreground.sources.length === 0 || options.background.sources.length === 0) {\n throw new error_1.BadInputError('Adaptive icons require sources for both foreground and background.');\n }\n debug('Bu... | [
"0.6421528",
"0.62971264",
"0.6267099",
"0.6117895",
"0.58979577",
"0.58979577",
"0.5872185",
"0.5872185",
"0.5856749",
"0.5856749",
"0.5851398",
"0.58334523",
"0.58334523",
"0.5793012",
"0.5793012",
"0.5786973",
"0.5786973",
"0.57867867",
"0.57867867",
"0.57809216",
"0.57809... | 0.7330189 | 0 |
clear references to IDB, e.g. during a close event | _clear () {
console.log('_clear database', this._dbName)
// We don't need to call removeEventListener or remove the manual "close" listeners.
// The memory leak tests prove this is unnecessary. It's because:
// 1) IDBDatabases that can no longer fire "close" automatically have listeners GCed
// 2) w... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"_clear () {\n // We don't need to call removeEventListener or remove the manual \"close\" listeners.\n // The memory leak tests prove this is unnecessary. It's because:\n // 1) IDBDatabases that can no longer fire \"close\" automatically have listeners GCed\n // 2) we clear the manual close listeners i... | [
"0.7586821",
"0.69703007",
"0.6871979",
"0.6728968",
"0.66735744",
"0.66726804",
"0.6620593",
"0.6584765",
"0.6583362",
"0.6571263",
"0.6466774",
"0.64568037",
"0.6453564",
"0.63963455",
"0.6380775",
"0.63146096",
"0.6298778",
"0.6294785",
"0.6280003",
"0.62777597",
"0.627055... | 0.74517375 | 1 |
given a list of terms, this is how you get the LR pairs from collection.aggregate() | function LRQuery(terms) {
return [
{ $match : { _id : { $in : terms } } },
{ $project : { LR : 1 , _id : 0 } },
{ $unwind : "$LR" },
{ $group : { _id : "NA", LR : { $push : "$LR" } } },
{ $project : { LR : 1 , _id : 0 } }
];
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function combinations(pre,terms) {\n var i,j,k,term,res,tmp,c;\n tmp=[pre];\n res=[];\n for(i=0;i<terms.length;i++) {\n term=terms[i];\n res=[];\n // make n versions of tmp, with each term[j] added\n for(j=1;j<term.length;j++) {\n // now make a copy of resultlists with term[j] added\n for... | [
"0.57555413",
"0.5391008",
"0.509027",
"0.50273937",
"0.5027393",
"0.49932152",
"0.49862048",
"0.49186346",
"0.48965687",
"0.47731775",
"0.47705796",
"0.4762267",
"0.47422287",
"0.46879622",
"0.46850443",
"0.46837392",
"0.46833658",
"0.46560228",
"0.46539965",
"0.46205556",
"... | 0.72264725 | 0 |
convert a list of ontology terms from strings to integers | function termsToInts(terms) {
for(var i in terms) {
terms[i] = parseInt(terms[i].replace(/[A-Z]+:0*/, ""));
}
return terms;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function strings_to_nums(d){\n d.id = +d.id;\n d.survived = +d.survived;\n d.age = +d.age;\n d.n_siblings_spouses = +d.n_siblings_spouses;\n d.parch = + d.parch;\n d.fare = +d.fare;\n d.confidence = +d.confidence;\n d.predicted = +d.predicted;\n return d;\n}",
"function spia(str=\"\") ... | [
"0.5871459",
"0.5749222",
"0.55142343",
"0.5426689",
"0.5350772",
"0.5310365",
"0.5278524",
"0.5212202",
"0.51851875",
"0.51729906",
"0.5157041",
"0.51567805",
"0.513878",
"0.51255965",
"0.5114244",
"0.5093374",
"0.50781083",
"0.5077317",
"0.5056752",
"0.50442666",
"0.5040313... | 0.79720795 | 0 |
Functor necessary to ensure 'field' variable closure | function queryFunctor(field) {
"use strict";
return function (done) {
var terms = getField(obj, field.split(':'));
var coll;
if (terms) {
if (typeof terms[0] === "string") {
terms = termsToInts(terms);
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"map(field_name, f){\n\t\treturn this.copy((new Map()).set(field_name, f(this.takeValue(field_name))));\n\t}",
"function getField$1(_, ctx) {\n if (!_.$field) return null;\n var k = 'f:' + _.$field + '_' + _.$name;\n return ctx.fn[k] || (ctx.fn[k] = field(_.$field, _.$name));\n }",
"function functor(v... | [
"0.633004",
"0.6280831",
"0.6088084",
"0.6088084",
"0.6088084",
"0.6088084",
"0.6088084",
"0.6088084",
"0.6088084",
"0.6088084",
"0.6088084",
"0.6088084",
"0.6088084",
"0.6088084",
"0.6088084",
"0.6035348",
"0.59714556",
"0.5955456",
"0.58994126",
"0.5816667",
"0.5724411",
... | 0.62869614 | 1 |
Single Bank (Row) We build the Mold and then the Model. (at this juncture things are still static). | function createBankModel(presentMold,sa,ss,sv,row) {
console.log("createBankModel %o",{presentMold:presentMold,sa:sa,ss:ss,sv:sv,row:row});
// ================================== View ==================================
sv.frame = `
<td class=bank-name> <div>{{&vertical}}</div></td>
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function MaschineModel ()\n{\n this.sceneBank = new SceneBankProxy (16);\n}",
"getParsedRow() {\n // eslint-disable-next-line new-cap\n return new this.model();\n }",
"function createBannerModel(presentMold,sa,ss,sv,row) {\r\n console.log(\"createBannerModel %o\",{presentMold:presentMold,sa:sa,ss:ss... | [
"0.5802336",
"0.57081175",
"0.5455213",
"0.5380967",
"0.5377733",
"0.5359059",
"0.533159",
"0.5277845",
"0.5261238",
"0.52580506",
"0.52416044",
"0.5217248",
"0.5209284",
"0.5192896",
"0.51598847",
"0.51476103",
"0.51460266",
"0.5142776",
"0.5083432",
"0.5082962",
"0.50695425... | 0.6983639 | 0 |
Bank Control Panel We build the Mold and then the Model. (at this juncture things are still static). | function createControlModel(presentMold,sa,ss,sv,row) {
console.log("createControlModel %o",{presentMold:presentMold,sa:sa,ss:ss,sv:sv,row:row});
// ================================== View ==================================
sv.frame = `
<div class=cpan>
<p class=name>{{name}}</p>
{{#isState(... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function createBankModel(presentMold,sa,ss,sv,row) {\r\n console.log(\"createBankModel %o\",{presentMold:presentMold,sa:sa,ss:ss,sv:sv,row:row});\r\n // ================================== View ==================================\r\n sv.frame = `\r\n <td class=bank-name> <div>{{&vertical}}</... | [
"0.68547577",
"0.61042154",
"0.60581446",
"0.5902251",
"0.58570486",
"0.5812802",
"0.573404",
"0.5664321",
"0.56153035",
"0.56025237",
"0.5599232",
"0.5596501",
"0.55863374",
"0.55111825",
"0.54491234",
"0.5440667",
"0.54197353",
"0.5374534",
"0.5360154",
"0.5356446",
"0.5343... | 0.641537 | 1 |
Banner We build the Mold and then the Model. (at this juncture things are still static). | function createBannerModel(presentMold,sa,ss,sv,row) {
console.log("createBannerModel %o",{presentMold:presentMold,sa:sa,ss:ss,sv:sv,row:row});
// ================================== View ==================================
sv.frame = `
{{#isState(ssVisible)}}<span class=banner style=color:rgb({{colorNow}})... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function renderBanner(data){\n new BannerView({\n model: data\n });\n}",
"function modelLoaded(){\n console.log('Model Loaded');\n loadingText.html('')\n // call to classifyIngredient once model is loaded\n detectIngredient();\n}",
"function modelReady() {\n createDiv(\"Model ist geladen\")\n... | [
"0.64651453",
"0.61622816",
"0.61426866",
"0.6077512",
"0.5985036",
"0.59396803",
"0.58529305",
"0.58342385",
"0.57759035",
"0.57759035",
"0.57759035",
"0.57667136",
"0.5737137",
"0.5725265",
"0.5683109",
"0.5664462",
"0.5662888",
"0.56287277",
"0.55930334",
"0.5545736",
"0.5... | 0.72122735 | 0 |
Cascaded Site Engine) We build the Mold and then the Model. (at this juncture things are still static). | function createSiteModel(presentMold,sa,ss,sv,ctx) {
console.log("createSiteModel %o",{presentMold:presentMold,sa:sa,ss:ss,sv:sv,ctx:ctx});
// ================================== View ==================================
sv.css = `
<style>
div#{{mdlBase}} div.but button {width:1... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function _model (){\n\ttry {\n\t\tFREEmium ['GET'] = _get_vars ();\n\t\tFREEmium ['toggles'] = [];\n\t\tFREEmium ['toggles']['related_pages'] = 'off';\n\t\tFREEmium ['toggles']['message'] = 'off';\n\t\tFREEmium ['first_visit'] = true;\n\t\t//_cookies ();\n\t\t_resize ();\n\t\t//_create_sounds ();\n\t\t_hotkeys ();... | [
"0.65126354",
"0.6279222",
"0.58989465",
"0.5772521",
"0.575483",
"0.5749374",
"0.571955",
"0.5647462",
"0.5624928",
"0.5574463",
"0.5571963",
"0.5571296",
"0.5542984",
"0.5521464",
"0.55080223",
"0.5488674",
"0.5466685",
"0.5454714",
"0.5454714",
"0.54540426",
"0.5450808",
... | 0.6489705 | 1 |
Site Configurator We build the Mold and then the Model. (at this juncture things are still static). | function createConfigureModel(presentMold,sa,ss,sv,ctx) {
// ================================== View ==================================
sv.css = `
<style>
div#{{mdlBase}} div.cfg {margin-top:10px}
div#{{mdlBase}} div.cfg label.head {display:inline-block;width:100px;text-align:right... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function createSiteModel(presentMold,sa,ss,sv,ctx) {\r\n console.log(\"createSiteModel %o\",{presentMold:presentMold,sa:sa,ss:ss,sv:sv,ctx:ctx});\r\n // ================================== View ==================================\r\n sv.css = `\r\n <style>\r\n div#{{mdlBase}} div.but button ... | [
"0.6565975",
"0.6058761",
"0.57333815",
"0.5639036",
"0.549586",
"0.54905057",
"0.5489088",
"0.54777175",
"0.538242",
"0.53770274",
"0.53699136",
"0.5339896",
"0.5333726",
"0.53104854",
"0.52975607",
"0.5289893",
"0.52486324",
"0.5247169",
"0.5246378",
"0.52062434",
"0.520373... | 0.75552106 | 0 |
This illustrates extending a Mold. Here we add a new State ssWaiting so we have to modify the sa,ss,sv tables This is for illustration only. It would have been far easier to define the ssWaiting state in the base mold and only have it activated when we set counting to greater than 10. | function samcExtendRocketMold(sa,ss,sv,ctx) {
console.log("samcExtendRocketMold %o",{sa:sa,ss:ss,sv:sv,ctx:ctx});
// actions
sa.addFunc("fnCheckWaitDecrement",function(model,stepParms) {
console.log("fnCheckWaitDecrement %s %o",model.strState,{model:model,stepParms:stepParms});
if (model.inState("ssW... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"changeState(state) {\r\n if (state !== \"hungry\" && state !== \"busy\" &&\r\n state !== \"sleeping\" && state !== \"normal\") {\r\n throw new Error()\r\n }\r\n\r\n this.state = state;\r\n this.states.push(this.state);\r\n return this.state\r\n }",
"cha... | [
"0.57329965",
"0.5631714",
"0.55941194",
"0.54960173",
"0.52783394",
"0.5262554",
"0.521514",
"0.5105983",
"0.5075091",
"0.50700426",
"0.5045455",
"0.503726",
"0.50340754",
"0.50282717",
"0.50146997",
"0.500191",
"0.49783528",
"0.4974711",
"0.49519137",
"0.49434614",
"0.49414... | 0.6919441 | 0 |
current label based on toggled state | get currentLabel() {
return this._regOrToggled(this.label, this.toggledLabel, this.isToggled);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"get currentLabel() {\n return this._regOrToggled(this.label, this.toggledLabel, this.isToggled);\n }",
"_computeToggleActionLabel(opened) {\n return opened ? 'Hide' : 'Show';\n }",
"function getCurrentLabel () {\n return status.currentLabel;\n }",
"function toggleLabel() {\n ... | [
"0.8202626",
"0.7288507",
"0.70766646",
"0.66833663",
"0.6681303",
"0.6667062",
"0.6464164",
"0.6421014",
"0.6419915",
"0.6391361",
"0.632493",
"0.63245195",
"0.6324361",
"0.6321431",
"0.6312354",
"0.6273637",
"0.62652266",
"0.620204",
"0.617648",
"0.61683315",
"0.61422247",
... | 0.8247309 | 0 |
current icon based on toggled state | get currentIcon() {
return this._regOrToggled(this.icon, this.toggledIcon, this.isToggled);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"get currentIcon() {\n return this._regOrToggled(this.icon, this.toggledIcon, this.isToggled);\n }",
"__toggleIcon(state) { \n switch (state) {\n case 1:\n return 'notification:sync';\n case 2:\n return 'notification:sync-problem';\n default:\n return 'notificat... | [
"0.8205611",
"0.7560184",
"0.7376298",
"0.71749264",
"0.71123385",
"0.6905213",
"0.68246794",
"0.67909443",
"0.67709047",
"0.67449003",
"0.67332274",
"0.6693706",
"0.6677334",
"0.66626",
"0.66620284",
"0.65847176",
"0.65688634",
"0.6519872",
"0.6500821",
"0.64824486",
"0.6464... | 0.8240965 | 0 |
label is offscreen (screenreaderonly) | get labelStyle() {
return !!this.icon && this.icon !== "" && this.showTextLabel === false
? "offscreen"
: null;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"_hideLabelIfEmpty() {\n const label = this._elements.label;\n\n // If it's empty and has no non-textnode children, hide the label\n const hiddenValue = !(label.children.length === 0 && label.textContent.replace(/\\s*/g, '') === '');\n\n // Toggle the screen reader text\n this._elements.labelWrapper.... | [
"0.69573104",
"0.68264186",
"0.6539663",
"0.6358523",
"0.63132066",
"0.6192134",
"0.6132077",
"0.60471493",
"0.60026646",
"0.593205",
"0.59270173",
"0.5869193",
"0.5852206",
"0.58499026",
"0.5837725",
"0.5822602",
"0.58155054",
"0.5813927",
"0.57901853",
"0.578449",
"0.577689... | 0.6869988 | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.