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 |
|---|---|---|---|---|---|---|
// KEYPAD LOGIC // show key pad | function showKeyPad() {
binaryString = prettyBinaryString(asBinaryString(selectedTiles));
document.getElementById("show-key-pad").click();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function recordGokusKeyPad(keyType, keyCode) { }",
"function togglePrintKey(){\n\tif(gInput.printKey){\n\t\tgInput.printKey = false;\n\t}else{\n\t\tgInput.printKey = true;\n\t}\n}",
"function showKeyCode(e) {\n console.log(\"Event Listener 4: keyup:\");\n console.log(`keyCode: ${e.keyCode}`);\n\n keyCodeBox... | [
"0.7009508",
"0.6593072",
"0.6422611",
"0.6349122",
"0.63351345",
"0.6328463",
"0.6312229",
"0.62439173",
"0.62083316",
"0.6190718",
"0.6177962",
"0.61750954",
"0.61179703",
"0.6096507",
"0.6045305",
"0.6045058",
"0.60383034",
"0.6030063",
"0.6023215",
"0.6002703",
"0.5985842... | 0.75243896 | 0 |
Resolve an array of post ids to an array of post objects (culled for id,uri,title) | function get_posts(postids, cb){
if(_.isEmpty(postids)) {
log.error("Attempted to resolve empty list of post IDs");
cb([]);
}
dataLayer.Post.find(postids, {only: ['id','uri','title']}, function(err, posts) {
if(err) {
log.error(err);
} else if(posts) {
cb(posts);
}
});
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"reversePosts(posts) {\r\n const reverseEntries = [];\r\n\r\n for (let entry of Object.keys(posts)) {\r\n const post = {\r\n ...posts[entry],\r\n id: entry\r\n };\r\n\r\n reverseEntries.unshift(post);\r\n }\r\n\r\n return rev... | [
"0.6485888",
"0.64140373",
"0.61659354",
"0.5957322",
"0.5918666",
"0.5917028",
"0.5874687",
"0.58433735",
"0.57944643",
"0.57339686",
"0.5714743",
"0.56679165",
"0.56568116",
"0.56434244",
"0.55341667",
"0.55296427",
"0.54739285",
"0.5467392",
"0.54539853",
"0.5412093",
"0.5... | 0.70382345 | 0 |
Send the pre formatted daily email | function send_daily_email(user, mail_html, callback) {
var mail_options = {
from: "Lede <hello@unburythelede.com>",
to: user.email,
subject: "Last email for a while (thank you)!",
html: mail_html
};
send_email(user, mail_options, callback);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function generateEmail(){\n\n setupDates();\n \n body = \"Your daily update email.\";\n \n body += checkWasteCollection();\n \n body += \"<h2>Humidity Forecast</h2>\";\n \n getWeatherData();\n \n body += \"<br><em>For full weather information, visit the <a href='https://www.metoffice.gov.uk/weather/fore... | [
"0.7476956",
"0.7009202",
"0.66528934",
"0.6638817",
"0.65870494",
"0.6546015",
"0.6540109",
"0.6503557",
"0.6477368",
"0.64664555",
"0.64592683",
"0.64022386",
"0.6358358",
"0.6341093",
"0.6294124",
"0.6271216",
"0.6242301",
"0.6237353",
"0.6209723",
"0.6199422",
"0.61599815... | 0.70118666 | 1 |
Use the user and password informtion to generate a welcome email and send it | function send_welcome_email (user, temp_password, callback) {
var source = fs.readFileSync(__dirname + '/views/welcome.hjs', 'utf8');
var template = handlebars.compile(source);
var mail_html = template({password: temp_password, username: user.email});
var mail_options = {
from: "The Lede Team <hello@unbury... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function sendMail(fname, lname, randomusername, randompassword, email) {\n Email.send({\n Host: \"smtp.gmail.com\",\n Username: \"test0123app@gmail.com\",\n Password: \"cmfnukepwnvzjqgl\",\n To: `${email}`,\n From: 'test0123app@gmail.com',\n Subject: `Attendance System ... | [
"0.7273813",
"0.7048609",
"0.6817558",
"0.650404",
"0.64882547",
"0.6412411",
"0.6280745",
"0.6271344",
"0.6267617",
"0.62579995",
"0.624655",
"0.6233587",
"0.6232329",
"0.6194495",
"0.6189384",
"0.6185533",
"0.6157638",
"0.61461025",
"0.6145014",
"0.61387116",
"0.60905546",
... | 0.78269684 | 0 |
The constructor receive the instance of the express.js app and the Blockchain class | constructor(app, blockchainObj) {
this.app = app;
this.blockchain = blockchainObj;
// All the endpoints methods needs to be called in the constructor to initialize the route.
this.getBlockByHeight();
this.requestOwnership();
this.submitStar();
this.getBlockByHash(... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"constructor(app) {\n this.app = app;\n this.blockchain = new BlockchainClass.Blockchain();\n this.EMPTY_HEIGHT = -1;\n this.UNKNOWN_ERROR_MSG = 'Somethng bad happened, see server logs';\n this.getBlockResponse = block => ({error: false, block});\n this.getErrorResponse = m... | [
"0.73193765",
"0.68231523",
"0.6727788",
"0.6657162",
"0.66492796",
"0.6582601",
"0.6560646",
"0.65437263",
"0.65437263",
"0.654076",
"0.646155",
"0.6443212",
"0.63769054",
"0.636823",
"0.63525784",
"0.63520473",
"0.62580746",
"0.62564486",
"0.62309647",
"0.6200528",
"0.61649... | 0.78236955 | 0 |
Enpoint to Get a Block by Height (GET Endpoint) | getBlockByHeight() {
this.app.get("/block/:height", async (req, res) => {
if(req.params.height) {
const height = parseInt(req.params.height);
let block = await this.blockchain.getBlockByHeight(height);
if(block){
return res.status(2... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"getBlockByHeight() {\n this.server.route({\n method: 'GET',\n path: '/block/{height}',\n handler: async (request, h) => {\n const block = await blockchain.getBlockByHeight(encodeURIComponent(request.params.height))\n .then((value)=>{\n ... | [
"0.8003575",
"0.77126074",
"0.7652113",
"0.7497078",
"0.7434057",
"0.74039346",
"0.7352287",
"0.7307842",
"0.7245706",
"0.7242541",
"0.713586",
"0.7086494",
"0.7078335",
"0.70771754",
"0.70542747",
"0.70134526",
"0.7001338",
"0.6978141",
"0.69514614",
"0.6886055",
"0.68839705... | 0.7984728 | 1 |
Endpoint that allows user to request Ownership of a Wallet address (POST Endpoint) | requestOwnership() {
this.app.post("/requestValidation", async (req, res) => {
if(req.body.address) {
const address = req.body.address;
const message = await this.blockchain.requestMessageOwnershipVerification(address);
if(message){
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async function owner() {\n ownerOfToken = await asyncContract.ownerOf(tokenID)\n //Showes wallet address of token owner.\n $(\"#status\").text(ownerOfToken)\n}",
"requestValidation() {\n this.app.post(\"/requestValidation\", (req, res) => {\n const address = req.body.address\n if ... | [
"0.61816317",
"0.6123284",
"0.573721",
"0.5725552",
"0.5697899",
"0.5679366",
"0.5641991",
"0.55999887",
"0.55655634",
"0.5554621",
"0.5541298",
"0.5508907",
"0.5508817",
"0.55058944",
"0.55045605",
"0.5475298",
"0.5469252",
"0.54260135",
"0.5411509",
"0.5393897",
"0.5383838"... | 0.6214357 | 0 |
Endpoint that allow Submit a Star, yu need first to `requestOwnership` to have the message (POST endpoint) | submitStar() {
this.app.post("/submitstar", async (req, res) => {
if(req.body.address && req.body.message && req.body.signature && req.body.star) {
const address = req.body.address;
const message = req.body.message;
const signature = req.body.signature... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"requestStarRegistration() {\n this.server.route({\n method: 'POST',\n path: '/requestValidation',\n handler: async (request, h) => {\n const payload = request.payload\n if(payload.address == \"\") return \"Erro, wasn't possible register a empty ... | [
"0.62104696",
"0.6123153",
"0.58243966",
"0.57713103",
"0.57331765",
"0.5721855",
"0.559859",
"0.5595331",
"0.54608595",
"0.5425735",
"0.5391148",
"0.53864205",
"0.5381118",
"0.53680366",
"0.5354001",
"0.5296417",
"0.52870166",
"0.5269135",
"0.52661407",
"0.52424896",
"0.5208... | 0.67144495 | 0 |
get next clip Grabs the events for the next (or first) clip from the server. All it really does is adjust the current filters on the server and grabs the events related to the new filters (those filters being the clip's). | function getNextClip() {
// check to make sure we're not going out of bounds
if (eventGrabber.clipNumber >= storyboard.clips.length) {
//if we're at the end, remove the last CLEAR event
if(playback.orderOfEvents[playback.orderOfEvents.length - 1].eventID === "CLEAR") {
playback.orderOfEvents.splice(playback.o... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"processNext() {\n // If the queue is empty, fire the finished callback\n if (this.renderQueue.length === 0) {\n Caman.Event.trigger(this, \"renderFinished\");\n if (this.finishedFn != null) { this.finishedFn.call(this.c); }\n\n return this;\n }\n\n this.currentJob = this.renderQueue.shif... | [
"0.4833729",
"0.4813143",
"0.47240812",
"0.4642998",
"0.46075422",
"0.45992762",
"0.45977437",
"0.45905817",
"0.4538944",
"0.44717243",
"0.44696298",
"0.44662157",
"0.44431698",
"0.44324476",
"0.44150987",
"0.43958405",
"0.43947774",
"0.43875656",
"0.43743187",
"0.43698618",
... | 0.76338863 | 0 |
prepare_header Args: api_key as string, payload for call as JS Object payload as javascript object, Returns: header for HTTPS call | function prepare_headers(api_key, api_secret, payload) {
var preparedPayload = prepare_payload(payload);
var headers = {
"X-BFX-APIKEY": api_key,
"X-BFX-PAYLOAD": preparedPayload,
"X-BFX-SIGNATURE": crypto.createHmac('sha384', api_secret).update(preparedPayload).digest('hex')
}... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function addApiKeyAuth(obj, partnerId, secretKey) {\n var pId = encodeURIComponent(partnerId);\n var secretKey = encodeURIComponent(secretKey);\n var method = obj['method'];\n var timeStamp = Math.floor(Date.now() / 1000);\n var url = decodeURIComponent(obj['url'].substring(obj['url'].indexOf(\"v1\"... | [
"0.6216165",
"0.5900733",
"0.5754211",
"0.5733894",
"0.5687249",
"0.5639783",
"0.563384",
"0.5610312",
"0.5541489",
"0.55097383",
"0.5450467",
"0.54391307",
"0.54207045",
"0.54143286",
"0.5411056",
"0.53806984",
"0.53554386",
"0.5332214",
"0.5319794",
"0.53175396",
"0.5308083... | 0.7153875 | 0 |
perform_callout Args: url of call as string, http call type as string, payload of call for encoding | function perform_callout_authenticated(url, calloutType, payload, callback) {
payload.request = api_path + url;
payload.nonce = Date.now().toString();
//console.log(Date() + ': nonce '+payload.nonce);
try {
request({
method: calloutType,
url: BITFINEX + api_path + ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function perform_callout(url, calloutType, payload, callback) {\r\n try {\r\n request({\r\n method: calloutType,\r\n url: BITFINEX + api_path + url,\r\n }, function(error, response, body) {\r\n callback(JSON.parse(body));\r\n });\r\n } catch (error) {\r\n... | [
"0.8314941",
"0.55294836",
"0.52492917",
"0.5060781",
"0.50002944",
"0.49997935",
"0.48704574",
"0.48363692",
"0.4795447",
"0.47290373",
"0.46999723",
"0.46587124",
"0.46333644",
"0.4632248",
"0.46253595",
"0.46084166",
"0.45616713",
"0.45359278",
"0.45186925",
"0.45015106",
... | 0.73503435 | 1 |
perform_callout Args: url of call as string, http call type as string, payload of call for encoding | function perform_callout(url, calloutType, payload, callback) {
try {
request({
method: calloutType,
url: BITFINEX + api_path + url,
}, function(error, response, body) {
callback(JSON.parse(body));
});
} catch (error) {
throw error;
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function perform_callout_authenticated(url, calloutType, payload, callback) {\r\n payload.request = api_path + url;\r\n payload.nonce = Date.now().toString();\r\n //console.log(Date() + ': nonce '+payload.nonce);\r\n try {\r\n request({\r\n method: calloutType,\r\n url: BIT... | [
"0.7348792",
"0.55311453",
"0.5250427",
"0.5061845",
"0.5001625",
"0.49997866",
"0.486934",
"0.48365724",
"0.4796703",
"0.4728204",
"0.47007555",
"0.46593517",
"0.46336704",
"0.4630109",
"0.46262637",
"0.46085477",
"0.45636743",
"0.45361608",
"0.45203936",
"0.45021424",
"0.44... | 0.83143926 | 0 |
get raw total count of reqTimes | get count() {
return this.reqTimes.length
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async getPacketRelayStats()\n {\n\n \n let minedTransactions = await this.mongoInterface.findAll('metapackets', {status:'mined'} )\n let pendingTransactions = await this.mongoInterface.findAll('metapackets', {status:'pending'} )\n let queuedTransactions = await this.mongoInterface.findAll('metapackets... | [
"0.63427156",
"0.6264104",
"0.62435234",
"0.6071937",
"0.60306674",
"0.60103995",
"0.598081",
"0.592801",
"0.592801",
"0.5889391",
"0.58429605",
"0.5833645",
"0.5813813",
"0.5812876",
"0.57900864",
"0.5759286",
"0.5758527",
"0.5744324",
"0.5734251",
"0.57171816",
"0.5706216",... | 0.7823794 | 0 |
Indicates if the given argument is defined. | function isDefined(arg) {
return typeof arg !== 'undefined';
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"hasArgument(name) {\n let args = is_int(name) ? Object.values(this.arguments) : this.arguments;\n return isset(args[name]);\n }",
"function isDefined() {\n for (var i = 0; i < arguments.length; i++) {\n var v = arguments[i];\n if (typeof v == \"undefined\" || v == null)\n return false;... | [
"0.75886667",
"0.7435845",
"0.7187509",
"0.686698",
"0.68438476",
"0.6746579",
"0.66113317",
"0.6484053",
"0.6484053",
"0.6459441",
"0.6449505",
"0.6449505",
"0.6408501",
"0.6314664",
"0.62595147",
"0.6224591",
"0.6146016",
"0.61356646",
"0.6122876",
"0.60910493",
"0.60910493... | 0.7812174 | 1 |
Indicates if the given argument is undefined. | function isUndefined(arg) {
return typeof arg === 'undefined';
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function IsUndefined(x) {\n\t return x === undefined;\n\t }",
"function IsUndefined(x) {\n return x === undefined;\n }",
"function IsUndefined(x) {\n return x === undefined;\n }",
"function IsUndefined(x) {\n return x === undefined;\n }",
"fun... | [
"0.7864158",
"0.7863584",
"0.7863584",
"0.7863584",
"0.7863584",
"0.7863584",
"0.7863584",
"0.7863584",
"0.7847676",
"0.784585",
"0.7838258",
"0.7838258",
"0.7838258",
"0.77318805",
"0.77318805",
"0.7596627",
"0.7587664",
"0.7582808",
"0.755563",
"0.7519666",
"0.74804425",
... | 0.8379003 | 1 |
Indicates if the given arg is initialized. | function isInitialized(arg) {
if (arg === false) return true;
if (arg) return true;
return false;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function isUninitialized(arg) {\n\tif (!arg) return true;\n\treturn false;\n}",
"function isUninitialized(arg) {\n\tif (!arg) return true;\n\treturn false;\n}",
"function assertInitialized(arg, msg) {\n\tif (isUninitialized(arg)) throw new Error(msg ? msg : \"Argument asserted as initialized but was not initia... | [
"0.74698997",
"0.74698997",
"0.6940087",
"0.6846467",
"0.64568293",
"0.62396866",
"0.62396866",
"0.62061805",
"0.6015621",
"0.59633726",
"0.59479123",
"0.59479123",
"0.594626",
"0.55850095",
"0.5579693",
"0.5571414",
"0.5571414",
"0.5493788",
"0.5493072",
"0.5492694",
"0.5467... | 0.7790351 | 1 |
Indicates if the given arg is uninitialized. | function isUninitialized(arg) {
if (!arg) return true;
return false;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function assertUninitialized(arg, msg) {\n\tif (isInitialized(arg)) throw new Error(msg ? msg : \"Argument asserted as uninitialized but was initialized\");\n}",
"function assertUninitialized(arg, msg) {\n\tif (isInitialized(arg)) throw new Error(msg ? msg : \"Argument asserted as uninitialized but was initializ... | [
"0.6990297",
"0.6990297",
"0.67606527",
"0.67606527",
"0.6758707",
"0.6758707",
"0.6640998",
"0.656917",
"0.656917",
"0.6556511",
"0.63246036",
"0.61948043",
"0.61865634",
"0.6008309",
"0.59452075",
"0.59452075",
"0.58896303",
"0.588177",
"0.588177",
"0.5854694",
"0.5752928",... | 0.82205224 | 1 |
Indicates if the given argument is an integer. | function isInt(arg) {
return arg === parseInt(Number(arg)) && !isNaN(arg) && !isNaN(parseInt(arg, 10));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function isInteger(x) { return parseInt(x, 10) === x; }",
"function _isInteger( _int ) { \n return parseInt( _int ) === _int; \n }",
"function isInteger(it){\n\t return !$.isObject(it) && _isFinite(it) && floor(it) === it;\n\t}",
"function isInteger(it){\r\n return !$.isObject(it) && _isF... | [
"0.7567265",
"0.737738",
"0.7369428",
"0.73644304",
"0.7329269",
"0.7329269",
"0.73191714",
"0.73191714",
"0.7283573",
"0.7218978",
"0.7218978",
"0.71505356",
"0.7113928",
"0.7090955",
"0.69921464",
"0.6991874",
"0.696759",
"0.6954612",
"0.6951896",
"0.6945064",
"0.6935808",
... | 0.80454767 | 1 |
Determines if the given argument is a boolean. | function isBoolean(arg) {
return typeof(arg) == typeof(true);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function isBoolean(arg){\n return typeof arg === 'boolean';\n }",
"function boo(bool) \n{\n return bool.constructor === Boolean;\n}",
"function isBoolean(input) {\n return typeof input == \"boolean\";\n}",
"function isBoolean(x) {\n return (typeof(x) === \"boolean\");\n}",
"function is_bool(vari... | [
"0.84706575",
"0.78226995",
"0.7820523",
"0.77491874",
"0.7666631",
"0.7620593",
"0.75828856",
"0.75572217",
"0.75572217",
"0.7526361",
"0.7512988",
"0.7512988",
"0.75064105",
"0.7480392",
"0.747257",
"0.747257",
"0.7456856",
"0.73978287",
"0.73978287",
"0.73947316",
"0.73947... | 0.8510148 | 1 |
Determines if the given string is base32. | function isBase32(str) {
if (typeof str !== 'string') return false;
assertTrue(str.length > 0, "Cannot determine if empty string is base32");
return /^[ABCDEFGHIJKLMNOPQRSTUVWXYZ234567]+$/.test(str);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function isBase32(value) {\n return typeof value === \"string\" && validator__WEBPACK_IMPORTED_MODULE_1___default.a.isBase32(value);\n}",
"function IsBase32(validationOptions) {\n return Object(_common_ValidateBy__WEBPACK_IMPORTED_MODULE_0__[\"ValidateBy\"])({\n name: IS_BASE32,\n validator: ... | [
"0.77033734",
"0.63996595",
"0.5772652",
"0.57560176",
"0.57560176",
"0.5672651",
"0.56502277",
"0.5632532",
"0.5632532",
"0.5632532",
"0.5632532",
"0.5632532",
"0.5632532",
"0.5632532",
"0.5632532",
"0.5632532",
"0.5632532",
"0.5632532",
"0.5632532",
"0.5632532",
"0.5632532"... | 0.8469706 | 1 |
Determines if the given string is base58. | function isBase58(str) {
if (typeof str !== 'string') return false;
assertTrue(str.length > 0, "Cannot determine if empty string is base58");
return /^[123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]+$/.test(str);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function assertBase58(str, msg) {\n\tassertTrue(isBase58(str), msg ? msg : \"Argument asserted as base58 but is not base58\");\n}",
"function isBalanced (string) {\n\n}",
"static isContractPoint(value) {\n try {\n const bn = (new BN(value.toString(10))).toString(16);\n // console.log('bn', bn, bn.... | [
"0.6863024",
"0.63484627",
"0.6224244",
"0.6087294",
"0.6087294",
"0.58999586",
"0.58846915",
"0.5678631",
"0.5655951",
"0.5646699",
"0.56195223",
"0.56161916",
"0.5605225",
"0.5590832",
"0.5564215",
"0.5549738",
"0.5548423",
"0.55423224",
"0.55343896",
"0.5533136",
"0.551401... | 0.8599058 | 1 |
Determines if the given string is base64. | function isBase64(str) {
if (typeof str !== 'string') return false;
assertTrue(str.length > 0, "Cannot determine if empty string is base64");
try {
return btoa(atob(str)) == str;
} catch (err) {
return false;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function isBase64(value) {\n\tif (isString(value))\n\t\treturn base64.test(value);\n\n\treturn false;\n}",
"function isBase64(value) {\r\n if (isString(value))\r\n return base64.test(value);\r\n\r\n return false;\r\n}",
"function isBase64String(value) {\n if (!isString(value)) {\n return... | [
"0.8387237",
"0.8341651",
"0.8160167",
"0.7571",
"0.7456015",
"0.6796875",
"0.64137024",
"0.63039607",
"0.62954265",
"0.6279738",
"0.6241763",
"0.6222738",
"0.6163148",
"0.61229056",
"0.6100472",
"0.60831237",
"0.60513973",
"0.5990002",
"0.5975894",
"0.5975894",
"0.59510297",... | 0.8427889 | 1 |
Asserts that the given boolean is false. Throws an exception if not a boolean or true. | function assertFalse(bool, msg) {
if (typeof bool !== 'boolean') throw new Error("Argument is not a boolean");
if (bool) throw new Error(msg ? msg : "Boolean asserted as false but was true");
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function isFalse(boolean) {\n return boolean === false;\n}",
"function isFalse(boolean) {\n return (boolean === false);\n}",
"function assertBoolean(arg, msg) {\n\tif (!isBoolean(arg)) throw new Error(msg ? msg : \"Argument asserted as a boolean but is not a boolean\");\n}",
"testIsFalse() {\n t... | [
"0.7264149",
"0.7202023",
"0.7103469",
"0.70295507",
"0.68086815",
"0.67891073",
"0.67891073",
"0.67819023",
"0.6777522",
"0.6710025",
"0.6653379",
"0.6653379",
"0.65574735",
"0.6534063",
"0.64397997",
"0.62596416",
"0.6252959",
"0.61992157",
"0.6182341",
"0.6166681",
"0.6162... | 0.81584024 | 1 |
Asserts that the given argument is null. Throws an exception if not null. | function assertNull(arg, msg) {
if (arg !== null) throw new Error(msg ? msg : "Argument asserted as null but was not null: " + arg);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function assertNotNull(arg, msg) {\n\tif (arg === null) throw new Error(msg ? msg : \"Argument asserted as not null but was null\");\n}",
"function assertNotNull(arg, msg) {\n\tif (arg === null) throw new Error(msg ? msg : \"Argument asserted as not null but was null\");\n}",
"function assertNotNull(obj) {\n ... | [
"0.8031022",
"0.8031022",
"0.6859922",
"0.680958",
"0.6722256",
"0.65759027",
"0.6408522",
"0.63084525",
"0.63020027",
"0.63020027",
"0.62466156",
"0.61368096",
"0.6070245",
"0.6070245",
"0.606835",
"0.60538095",
"0.6049759",
"0.6043633",
"0.60312873",
"0.5936685",
"0.5936685... | 0.83087 | 1 |
Asserts that the given argument is not null. Throws an exception if null. | function assertNotNull(arg, msg) {
if (arg === null) throw new Error(msg ? msg : "Argument asserted as not null but was null");
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function assertNull(arg, msg) {\n\tif (arg !== null) throw new Error(msg ? msg : \"Argument asserted as null but was not null: \" + arg);\n}",
"function assertNull(arg, msg) {\n\tif (arg !== null) throw new Error(msg ? msg : \"Argument asserted as null but was not null: \" + arg);\n}",
"function assertIsDefine... | [
"0.79182667",
"0.79182667",
"0.6833726",
"0.6655613",
"0.65465343",
"0.6515173",
"0.65136003",
"0.64079595",
"0.64079595",
"0.6370893",
"0.6315996",
"0.6302966",
"0.6302966",
"0.6257231",
"0.6257231",
"0.6139733",
"0.6069932",
"0.6018293",
"0.6011729",
"0.5996112",
"0.5977387... | 0.80382216 | 1 |
Asserts that the given argument is undefined. Throws an exception if defined. | function assertUndefined(arg, msg) {
if (isDefined(arg)) throw new Error(msg ? msg : "Argument asserted as undefined but was defined: " + arg);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function assertIsDefined(arg) {\n if (isUndefinedOrNull(arg)) {\n throw new Error('Assertion Failed: argument is undefined or null');\n }\n return arg;\n }",
"function assertDefined(arg, msg) {\n\tif (isUndefined(arg)) throw new Error(msg ? msg : \"Argument asserted as defined ... | [
"0.83989894",
"0.8356378",
"0.8356378",
"0.7527445",
"0.7527445",
"0.7134769",
"0.7134769",
"0.7052861",
"0.690006",
"0.68826884",
"0.68678576",
"0.6865922",
"0.6831201",
"0.6831201",
"0.6831201",
"0.68298376",
"0.68298376",
"0.68298376",
"0.68298376",
"0.68298376",
"0.682983... | 0.86453813 | 1 |
Asserts that the given argument is initialized. Throws an exception if not initialized. | function assertInitialized(arg, msg) {
if (isUninitialized(arg)) throw new Error(msg ? msg : "Argument asserted as initialized but was not initialized");
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function assertInitialized(arg, msg) {\n\tif (isUninitialized(arg)) {\n\t\tthrow new Error(msg ? msg : \"Argument asserted as initialized but was \" + arg);\n\t}\n}",
"function assertUninitialized(arg, msg) {\n\tif (isInitialized(arg)) throw new Error(msg ? msg : \"Argument asserted as uninitialized but was init... | [
"0.83660245",
"0.78459525",
"0.78459525",
"0.6478973",
"0.6478973",
"0.61538136",
"0.61538136",
"0.5963845",
"0.5963845",
"0.595765",
"0.595765",
"0.5937997",
"0.5937997",
"0.5874357",
"0.5829662",
"0.5829662",
"0.5829662",
"0.5829662",
"0.5829662",
"0.5829662",
"0.5792268",
... | 0.84459174 | 0 |
Asserts that the given argument is uninitialized. Throws an exception if initialized. | function assertUninitialized(arg, msg) {
if (isInitialized(arg)) throw new Error(msg ? msg : "Argument asserted as uninitialized but was initialized");
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function assertInitialized(arg, msg) {\n\tif (isUninitialized(arg)) throw new Error(msg ? msg : \"Argument asserted as initialized but was not initialized\");\n}",
"function assertInitialized(arg, msg) {\n\tif (isUninitialized(arg)) {\n\t\tthrow new Error(msg ? msg : \"Argument asserted as initialized but was \"... | [
"0.82457566",
"0.81817764",
"0.74144393",
"0.74144393",
"0.6913837",
"0.6913837",
"0.67796844",
"0.67796844",
"0.6456589",
"0.62639344",
"0.62639344",
"0.6033944",
"0.6033944",
"0.57255733",
"0.57255733",
"0.5656858",
"0.56522655",
"0.56467855",
"0.56467855",
"0.56467855",
"0... | 0.8547084 | 1 |
Asserts that the given arguments are equal. Throws an exception if not equal. | function assertEquals(arg1, arg2, msg) {
assertTrue(equals(arg1, arg2), msg ? msg : "Arguments asserted as equal but are not equal: " + arg1 + " vs " + arg2);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function assertNotEquals(arg1, arg2, msg) {\n\tif (arg1 === arg2) throw new Error(msg ? msg : \"Arguments asserted as not equal but are equal: \" + arg1 + \" vs \" + arg2);\n}",
"function assertNotEquals(arg1, arg2, msg) {\n\tif (arg1 === arg2) throw new Error(msg ? msg : \"Arguments asserted as not equal but ar... | [
"0.6748916",
"0.6748916",
"0.6601688",
"0.65931803",
"0.65566254",
"0.65456504",
"0.65456504",
"0.65216094",
"0.6479544",
"0.6479227",
"0.64455026",
"0.6445314",
"0.6404689",
"0.6374105",
"0.6365401",
"0.6320446",
"0.6312471",
"0.6308183",
"0.63068074",
"0.62994164",
"0.62443... | 0.6831972 | 1 |
Asserts that the given arguments are not equal. Throws an exception if equal. | function assertNotEquals(arg1, arg2, msg) {
if (arg1 === arg2) throw new Error(msg ? msg : "Arguments asserted as not equal but are equal: " + arg1 + " vs " + arg2);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"testAreNotEquals() {\n this.areNotEquals(1, 0);\n this.areNotEquals(1, '0');\n this.areNotEquals(1, false);\n this.areNotEquals(0, true);\n this.hasException(() => this.areNotEquals(1, 1));\n this.hasException(() => this.areNotEquals(1, '1'));\n this.hasException(()... | [
"0.7051868",
"0.70399946",
"0.6852601",
"0.6502002",
"0.64404154",
"0.62416744",
"0.6239237",
"0.6232261",
"0.6232261",
"0.6226972",
"0.62027645",
"0.616992",
"0.6168779",
"0.6146301",
"0.61461097",
"0.6141846",
"0.6108742",
"0.60858244",
"0.60858244",
"0.6083445",
"0.6039130... | 0.8042012 | 1 |
Asserts that the given argument is an integer. | function assertInt(arg, msg) {
if (!isInt(arg)) throw new Error(msg ? msg : "Argument asserted as an integer but is not an integer");
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function isInt(arg) {\n\treturn arg === parseInt(Number(arg)) && !isNaN(arg) && !isNaN(parseInt(arg, 10));\n}",
"function isInt(arg) {\n\treturn arg === parseInt(Number(arg)) && !isNaN(arg) && !isNaN(parseInt(arg, 10));\n}",
"function checkInt(val) {\n if (!val.match(Regex.integer))\n throw new Error('The ... | [
"0.71374637",
"0.71374637",
"0.7125078",
"0.68064344",
"0.6755927",
"0.67228514",
"0.67228514",
"0.64642906",
"0.64642906",
"0.6386851",
"0.6383921",
"0.6369984",
"0.6368863",
"0.6368863",
"0.63671106",
"0.6345597",
"0.6345597",
"0.6338359",
"0.63382566",
"0.63193977",
"0.631... | 0.82172257 | 1 |
Asserts that the given argument is a number. | function assertNumber(arg, msg) {
if (!isNumber(arg)) throw new Error(msg ? msg : "Argument asserted as a number but is not a number");
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function assertNumber(value) {\n assertSet(value);\n if (typeof value !== \"number\") {\n throw new Error(\"Value must be a number\");\n }\n return value;\n}",
"function assertNumber(value) {\n if (typeof value !== 'number' || isNaN(value))\n throw AssertError('Value is not a number'... | [
"0.7383539",
"0.7328694",
"0.71907794",
"0.7175741",
"0.705503",
"0.7045442",
"0.70378464",
"0.68706226",
"0.6806662",
"0.67905986",
"0.6746645",
"0.6746645",
"0.667436",
"0.6614747",
"0.6605004",
"0.6564269",
"0.6550732",
"0.65457374",
"0.6542725",
"0.6526282",
"0.64907277",... | 0.8150715 | 1 |
Asserts that the given argument is a string. | function assertString(arg, msg) {
if (!isString(arg)) throw new Error(msg ? msg : "Argument asserted as a string but is not a string");
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function assertString(arg, msg) {\n\tif (!isString(arg)) throw new Error(msg ? msg : \"Argument asserted as a string but is not a string: \" + arg);\n}",
"function is_string(arg) {\r\n return typeof arg === 'string';\r\n }",
"function is_string( arg ) {\n return typeof arg === 'string';\n }",
"... | [
"0.8083273",
"0.773229",
"0.77219963",
"0.7421121",
"0.738571",
"0.72488344",
"0.7238508",
"0.71145767",
"0.71145767",
"0.70537007",
"0.7014959",
"0.6984495",
"0.6850494",
"0.682418",
"0.682418",
"0.682418",
"0.6689226",
"0.6680869",
"0.6542128",
"0.65360004",
"0.65269476",
... | 0.81158364 | 0 |
Asserts that the given argument is an array. | function assertArray(arg, msg) {
if (!isArray(arg)) throw new Error(msg ? msg : "Argument asserted as an array but is not an array");
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"testIsArray() {\n this.isArray([]);\n this.isArray(new Array());\n this.hasException(() => this.isArray(0));\n }",
"function IsArray(argument) {\n return Array.isArray\n ? Array.isArray(argument)\n : argument instanceof Object\n ... | [
"0.7206873",
"0.70132047",
"0.70132047",
"0.70132047",
"0.70132047",
"0.70132047",
"0.70132047",
"0.70132047",
"0.6989386",
"0.6987045",
"0.6987045",
"0.6987045",
"0.6979261",
"0.69608027",
"0.69567585",
"0.6925694",
"0.6882165",
"0.68564254",
"0.6854211",
"0.68492794",
"0.68... | 0.76904744 | 1 |
Asserts that the given argument is an object with the given name. | function assertObject(arg, obj, msg) {
if (!isObject(arg, name)) {
throw new Error(msg ? msg : "Argument asserted as object with name '" + name + "' but was not");
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function assertObject(arg, obj, msg) {\n\tassertInitialized(arg, msg);\n\tif (obj) {\n\t\tif (!isObject(arg, obj)) throw new Error(msg ? msg : \"Argument asserted as object '\" + obj.name + \"' but was not\");\n\t} else {\n\t\tif (!isObject(arg)) throw new Error(msg ? msg : \"Argument asserted as object but was no... | [
"0.7113506",
"0.66230476",
"0.6400714",
"0.6020185",
"0.5928145",
"0.58441556",
"0.5786701",
"0.5781859",
"0.5771614",
"0.57455766",
"0.57455766",
"0.57422775",
"0.5725767",
"0.5723571",
"0.5663",
"0.5644895",
"0.5596147",
"0.5596147",
"0.5589997",
"0.5589997",
"0.5589997",
... | 0.79176533 | 0 |
Sets the child's prototype to the parent's prototype. | function inheritsFrom(child, parent) {
child.prototype = Object.create(parent.prototype);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function extend(child, parent, _protoFn) {\n var i;\n parent = isArray(parent) ? parent : [parent];\n var _copyProtoChain = function (focus) {\n var proto = focus.__proto__;\n while (proto != null) {\n if (proto.prototype != null) {\n for... | [
"0.6468297",
"0.6433102",
"0.6281449",
"0.6186232",
"0.61316085",
"0.61316085",
"0.6109553",
"0.60740477",
"0.6038675",
"0.6023626",
"0.59237057",
"0.5864209",
"0.58603907",
"0.58556193",
"0.5841008",
"0.58106136",
"0.580538",
"0.5785456",
"0.57336724",
"0.57076573",
"0.56858... | 0.6441488 | 1 |
Returns the power set of the given array. | function getPowerSet(arr) {
var fn = function(n, src, got, all) {
if (n == 0) {
if (got.length > 0) {
all[all.length] = got;
}
return;
}
for (var j = 0; j < src.length; j++) {
fn(n - 1, src.slice(j + 1), got.concat([ src[j] ]), all);
}
return;
}
var all = [];
all.push([]);
for (var i = 0;... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function powerset(arr) {\n var ps = [[]];\n for (var i = 0; i < arr.length; i++) {\n for (var j = 0, len = ps.length; j < len; j++) {\n ps.push(ps[j].concat(arr[i]));\n }\n }\n return ps;\n}",
"function powerset(ary) {\r\n var ps = [[]];\r\n for (var i=0; i < ary.length... | [
"0.80302835",
"0.7810787",
"0.7724035",
"0.6546969",
"0.6546969",
"0.64339983",
"0.6051708",
"0.5970995",
"0.59074104",
"0.5906523",
"0.5779927",
"0.5724413",
"0.5657927",
"0.56455976",
"0.56378466",
"0.55935246",
"0.55802304",
"0.5549198",
"0.55414593",
"0.55410373",
"0.5520... | 0.81883585 | 1 |
Returns the power set of the given array whose elements are the given size. | function getPowerSetOfLength(arr, size) {
assertInitialized(arr);
assertInitialized(size);
assertTrue(size >= 1);
var powerSet = getPowerSet(arr);
var powerSetOfLength = [];
for (var i = 0; i < powerSet.length; i++) {
if (powerSet[i].length === size) {
powerSetOfLength.push(powerSet[i]);
}
}
return power... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getPowerSet(arr) {\n\tvar fn = function(n, src, got, all) {\n\t\tif (n == 0) {\n\t\t\tif (got.length > 0) {\n\t\t\t\tall[all.length] = got;\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\t\tfor (var j = 0; j < src.length; j++) {\n\t\t\tfn(n - 1, src.slice(j + 1), got.concat([ src[j] ]), all);\n\t\t}\n\t\treturn;\n\t}\n... | [
"0.7282687",
"0.7282687",
"0.69086766",
"0.68782127",
"0.6792264",
"0.6703507",
"0.5849621",
"0.57350504",
"0.57265115",
"0.5682369",
"0.56540203",
"0.5420805",
"0.5420609",
"0.53896487",
"0.53712755",
"0.53251797",
"0.5288928",
"0.528866",
"0.52806616",
"0.52737385",
"0.5261... | 0.83016294 | 1 |
Returns an array of indices of the given size. | function getIndices(size) {
var indices = [];
for (var i = 0; i < size; i++) {
indices.push(i);
}
return indices;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function createArr(size) {\n var mat = [];\n for (let i = 0; i < size; i++) {\n mat[i] = i + 1;\n }\n return mat;\n}",
"function range(size){\n\tfor (var i = 0; i < size; i++) {\n\t\tarray[i] = i;\n\t}\n\treturn array;\n}",
"function generateArray (size) {\n return [...new Array(size)].ma... | [
"0.6251552",
"0.6053353",
"0.5892951",
"0.58143914",
"0.58019596",
"0.5785546",
"0.5743724",
"0.56678903",
"0.5659954",
"0.56438094",
"0.56389743",
"0.56127226",
"0.56074387",
"0.55826813",
"0.5542146",
"0.55413175",
"0.5516638",
"0.5483211",
"0.54622626",
"0.54317963",
"0.54... | 0.8663242 | 1 |
Returns combinations of the given array of the given size. | function getCombinations(arr, combinationSize) {
// validate input
assertInitialized(arr);
assertInitialized(combinationSize);
assertTrue(combinationSize >= 1);
// get combinations of array indices of the given size
var indexCombinations = getPowerSetOfLength(getIndices(arr.length), combinationSize);
// co... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getCombinations(arr, combinationSize) {\n\t\n\t// validate input\n\tassertInitialized(arr);\n\tassertInitialized(combinationSize);\n\tassertTrue(combinationSize >= 1);\n\t\n\t// get combinations of array indices of the given size\n\tvar indexCombinations = getPowerSetOfLength(getIndices(arr.length), combi... | [
"0.79173535",
"0.7154957",
"0.6995327",
"0.67657655",
"0.6748633",
"0.6720941",
"0.6392531",
"0.63588756",
"0.6204037",
"0.6111881",
"0.60844445",
"0.6056704",
"0.60525835",
"0.60440046",
"0.6016384",
"0.60104495",
"0.60104495",
"0.6000695",
"0.5899301",
"0.5880797",
"0.58705... | 0.79784536 | 0 |
Gets an 'a' element that is downloadable when clicked. | function getDownloadableA(name, contents) {
var a = window.document.createElement('a');
a.href = window.URL.createObjectURL(new Blob([contents], {type: 'text/plain'}));
a.download = name;
a.target="_blank";
a.innerHTML = name;
return a;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getDownloadLink($selector, anchor) {\n // Get the scene file name that I would be downloading\n var theSceneFileName = getSceneFileName($selector.find('div#video_download').find('a'));\n\n var $aVideoLink = $selector.find('a[href*=\"' + theSceneFileName + '\"]');\n var theDownloadLink = $aVide... | [
"0.6470108",
"0.64565563",
"0.6289301",
"0.61331695",
"0.59930974",
"0.5811522",
"0.5788729",
"0.57843333",
"0.576756",
"0.57641846",
"0.57527435",
"0.5716233",
"0.56901556",
"0.56842756",
"0.5609105",
"0.5601518",
"0.55939615",
"0.5575696",
"0.55323184",
"0.5530602",
"0.5529... | 0.6661633 | 1 |
Returns the given node's outer HTML. | function getOuterHtml(node) {
return $('<div>').append($(node).clone()).html();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function outerHTML(element) {\n if (element.outerHTML) {\n return element.outerHTML;\n } else {\n var twrap = document.createElement(\"div\");\n var tnode = element.cloneNode(true);\n twrap.appendChild(tnode);\n var content = twrap.innerHTML;\n return content;\n ... | [
"0.7852653",
"0.7720226",
"0.7703861",
"0.76970047",
"0.76970047",
"0.768888",
"0.768888",
"0.768888",
"0.768404",
"0.768404",
"0.768404",
"0.768404",
"0.7619703",
"0.7619703",
"0.7604004",
"0.75949794",
"0.75949794",
"0.75949794",
"0.75949794",
"0.75949794",
"0.75949794",
... | 0.84623516 | 1 |
Indicates if the given string contains whitespace. | function hasWhitespace(str) {
return /\s/g.test(str);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function containsWhitespace(str) {\n var expr = /\\s/;\n return expr.test(str);\n }",
"function hasWhiteSpace(s) {\n return s.indexOf(' ') >= 0;\n}",
"function hasWhiteSpace(s) {\n return s.indexOf(' ') >= 0;\n}",
"function isWhitespace(str... | [
"0.8204504",
"0.81281894",
"0.8112275",
"0.8041486",
"0.8041274",
"0.7800193",
"0.7790059",
"0.7720066",
"0.7702614",
"0.75878596",
"0.75353795",
"0.7528838",
"0.7512715",
"0.7493697",
"0.7493697",
"0.74418527",
"0.74115986",
"0.73849386",
"0.73563045",
"0.73563045",
"0.73276... | 0.8222907 | 1 |
Counts the number of nonwhitespace characters in the given string. | function countNonWhitespaceCharacters(str) {
var count = 0;
for (var i = 0; i < str.length; i++) {
if (!isWhitespace(str.charAt(i))) count++;
}
return count;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function countNonSpaces(s)\r\n{\r\n let c = 0;\r\n for (let index = 0; index < s.length; index++) {\r\n if( s[index] != \" \" )\r\n c = c + 1;\r\n \r\n }\r\n return c;\r\n}",
"function countNonSpaces(str){\n return str.split(\" \").join(\"\").length\n}",
"function countC... | [
"0.81349945",
"0.8024485",
"0.7963592",
"0.79113203",
"0.773604",
"0.7686486",
"0.7594519",
"0.7377938",
"0.7324047",
"0.717475",
"0.7021174",
"0.69569147",
"0.688998",
"0.688998",
"0.68784815",
"0.68600476",
"0.68596745",
"0.6831405",
"0.6820139",
"0.6724436",
"0.67107874",
... | 0.8362281 | 1 |
Returns tokens separated by whitespace from the given string. | function getWhitespaceTokens(str) {
return str.match(/\S+/g);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function tokenize(string)\n{\n return string.split(\"\"); // Converts the Program to an Array of Chars\n // After this parser will analyze using this Array of Chars\n}",
"function tokenize(str = '') {\n return str\n .toLowerCase()\n // split at whitespace and/or punctuation\n .split(/[\\.,!?():;]... | [
"0.7494218",
"0.72228086",
"0.72111154",
"0.7143659",
"0.70037574",
"0.6808448",
"0.67569256",
"0.6737582",
"0.6727861",
"0.6722322",
"0.6684975",
"0.66781795",
"0.66771454",
"0.6615714",
"0.6605104",
"0.6605104",
"0.6605104",
"0.6605104",
"0.6605104",
"0.6564465",
"0.6535408... | 0.77726305 | 1 |
Returns the document's first stylesheet which has no href. | function getInternalStyleSheet() {
for (var i = 0; i < document.styleSheets.length; i++) {
var styleSheet = document.styleSheets[i];
if (!styleSheet.href) return styleSheet;
}
return null;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getActiveStyleSheet() {\r\n var i, a;\r\n\r\n for (i=0; (a = document.getElementsByTagName(\"link\")[i]); i++) {\r\n if (a.getAttribute(\"rel\").indexOf(\"style\") != -1 && a.getAttribute(\"title\") && !a.disabled) {\r\n\t\t\treturn a.getAttribute(\"title\");\r\n\t\t}\r\n }\r\n\r\n retur... | [
"0.6615297",
"0.65313077",
"0.6286291",
"0.6045288",
"0.569834",
"0.5690379",
"0.5690379",
"0.5690379",
"0.56643414",
"0.5636095",
"0.56215817",
"0.562032",
"0.5594521",
"0.55891466",
"0.55891466",
"0.55891466",
"0.5562201",
"0.55356276",
"0.5529718",
"0.55059147",
"0.5505914... | 0.74070925 | 1 |
Returns the document's internal stylesheet as text. | function getInternalStyleSheetText() {
var internalCss = "";
var internalStyleSheet = getInternalStyleSheet();
if (!internalStyleSheet) return null;
for (var i = 0; i < internalStyleSheet.cssRules.length; i++) {
internalCss += internalStyleSheet.cssRules[i].cssText + "\n";
}
return internalCss;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getInternalStyleSheet() {\n\tfor (var i = 0; i < document.styleSheets.length; i++) {\n\t\tvar styleSheet = document.styleSheets[i];\n\t\tif (!styleSheet.href) return styleSheet;\n\t}\n\treturn null;\n}",
"function getInternalStyleSheet() {\n\tfor (var i = 0; i < document.styleSheets.length; i++) {\n\t\t... | [
"0.6612298",
"0.6612298",
"0.6334051",
"0.6121948",
"0.59854823",
"0.5895043",
"0.5838069",
"0.57959384",
"0.57959384",
"0.57959384",
"0.5788958",
"0.57888025",
"0.5777713",
"0.57693225",
"0.57693225",
"0.57693225",
"0.5753042",
"0.57304",
"0.5729983",
"0.57245415",
"0.568996... | 0.7722178 | 1 |
Builds an HTML document with the given div in the body. | function buildHtmlDocument(div, title, dependencyPaths, internalCss) {
var str = "<!DOCTYPE HTML>";
str += "<html><head>" + (title ? "<title>" + title + "</title>" : "") + (internalCss ? "<style>" + internalCss + "</style>" : "");
if (dependencyPaths) {
dependencyPaths = listify(dependencyPaths);
for (var i = 0;... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function buildDOM(){\n const body = grabElement(\"body\");\n const script = grabElement(\"script\");\n const header = makeElement(\"header\");\n const main = makeElement(\"main\");\n const footer = makeElement(\"footer\");\n body.insertBefore(footer, script);\n body.insertBefore(main, footer);... | [
"0.65661407",
"0.624098",
"0.6206071",
"0.6146998",
"0.60921115",
"0.60454947",
"0.5996273",
"0.5976519",
"0.59502554",
"0.5889608",
"0.58527225",
"0.58195966",
"0.5807173",
"0.57960325",
"0.57710445",
"0.57121927",
"0.56965345",
"0.5686535",
"0.56655836",
"0.5635789",
"0.562... | 0.6940752 | 0 |
prevents onLoad() from being called multiple times | function onLoadOnce(err, window) {
if (onLoadCalled) return;
onLoadCalled = true;
if (onLoad) onLoad(err, window);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"handleOnLoad() {\n this.toggleLoading?.(false);\n this.toggleFallback?.(false);\n this.togglePlaceholder?.(false);\n }",
"_executeOnLoad(){\n if( this._onReadyCb ){\n this._onReadyCb( this );\n this._onReadyCb = false; // remove Cb, since this is executed only once\n ... | [
"0.70517236",
"0.69711083",
"0.6910213",
"0.69049853",
"0.68834925",
"0.675535",
"0.67505795",
"0.66845495",
"0.65615374",
"0.65473145",
"0.65473145",
"0.65473145",
"0.65101224",
"0.65005225",
"0.65005225",
"0.65005225",
"0.65005225",
"0.64790344",
"0.6461544",
"0.64070404",
... | 0.7375096 | 1 |
Determines if the image at the given URL is accessible. | function isImageAccessible(url, timeout, onDone) {
// track return so it only executes once
var returned = false;
// attempt to load favicon
var img = new Image();
img.onload = onResponse;
img.onerror = onResponse;
img.src = url + "?" + (+new Date()); // trigger image load with cache buster
// nest fail... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function doesImageExist(urlToImage)\n{\n var xhr = new XMLHttpRequest();\n xhr.open('HEAD', '/images/' + urlToImage, false);\n xhr.send();\n\n if (xhr.status == \"404\" || !urlToImage || urlToImage.length === 0) {\n console.log(\"File doesn't exist\");\n return false;\n } else {\n ... | [
"0.6774187",
"0.66979665",
"0.66856426",
"0.6658728",
"0.665213",
"0.66454804",
"0.66380006",
"0.6513946",
"0.6413847",
"0.63930124",
"0.6165142",
"0.6136266",
"0.60489744",
"0.6027721",
"0.6027721",
"0.6027721",
"0.6027721",
"0.6027721",
"0.60119873",
"0.60119873",
"0.600566... | 0.73199135 | 1 |
Determines if the given file is a zip file. | function isZipFile(file) {
return file.name.endsWith(".zip") || file.type === 'application/zip';
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function isZipExtension(str) {\n\tvar re = /^[0-9]{3}[0-9]$/;\n\treturn (re.test(str));\n}",
"function isZip (s)\n{\n var re = /^(\\d{5})(-?\\d{4})?$/;\n if (re.test(s)) return true;\n return false;\n}",
"function isGzipFile (filepath) {\n var buf = new Buffer(3)\n var fd = fs.openSync(filepath, 'r'... | [
"0.6456749",
"0.5963203",
"0.584592",
"0.5672748",
"0.56663233",
"0.5656909",
"0.5629028",
"0.5620443",
"0.5620443",
"0.5620443",
"0.5620443",
"0.5620443",
"0.55670655",
"0.55369747",
"0.55369747",
"0.55369747",
"0.55369747",
"0.55369747",
"0.55369747",
"0.5449322",
"0.540559... | 0.84618735 | 1 |
Determines if the given file is a json file. | function isJsonFile(file) {
return file.name.endsWith(".json") || file.type === 'application/json';
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"isJsonMime(mime) {\n const jsonMime = new RegExp('^(application\\/json|[^;/ \\t]+\\/[^;/ \\t]+[+]json)[ \\t]*(;.*)?$', 'i');\n return mime != null && (jsonMime.test(mime) || mime.toLowerCase() === 'application/json-patch+json');\n }",
"isJsonMime(mime) {\n const jsonMime = new RegExp('^(a... | [
"0.71863025",
"0.71712434",
"0.71712434",
"0.699287",
"0.68051887",
"0.65041906",
"0.6465096",
"0.6412752",
"0.6361349",
"0.6348102",
"0.6348102",
"0.6348102",
"0.6303346",
"0.63004553",
"0.6292809",
"0.6262726",
"0.6262726",
"0.62453794",
"0.6215287",
"0.62126696",
"0.621266... | 0.87686974 | 1 |
Determines if the given file is a csv file. | function isCsvFile(file) {
return file.name.endsWith(".csv") || file.type === 'text/csv';
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function _isCSV(input) {\n \ttry {\n\t\tvar flag = false;\n\t\tvar pattern = \"^.+\\.(csv)$\";\n if (input.val().match(pattern)) {\n flag = true;\n } else {\n flag = false;\n }\n return flag;\n \t} catch(e) {\n alert('ImportCSV' + e.message);\n }\n }",... | [
"0.74186176",
"0.7316879",
"0.68028283",
"0.60345",
"0.5566681",
"0.5526134",
"0.5500622",
"0.5460663",
"0.538098",
"0.5351598",
"0.50693905",
"0.50610447",
"0.5046294",
"0.5046294",
"0.5046294",
"0.5044187",
"0.5014362",
"0.5012542",
"0.5012542",
"0.5012542",
"0.5008265",
... | 0.85855556 | 1 |
Fetches the given list of images. Prerequisite: async.js. | function getImages(paths, onDone) {
// listify paths
if (!isArray(paths)) {
assertTrue(isString(paths));
paths = [paths];
}
// collect functions to fetch images
var funcs = [];
for (var i = 0; i < paths.length; i++) {
funcs.push(loadFunc(paths[i]));
}
// fetch in parallel
async.parallel(funcs, onDo... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function collectImages(list){\n return new Promise(function(resolve, reject){ \n \n var imageCollection = [];\n list.forEach(function (url, index){\n \n getImage(url).then(function(image){\n image.url = url;\n imageCollection.push(image);\n \n ... | [
"0.74288845",
"0.7417648",
"0.7409579",
"0.7391804",
"0.727074",
"0.72512364",
"0.7239302",
"0.7150218",
"0.7132579",
"0.7127687",
"0.7127612",
"0.70880216",
"0.7045144",
"0.7009553",
"0.69876134",
"0.69684404",
"0.69679725",
"0.6951198",
"0.69448715",
"0.6939362",
"0.6931559... | 0.75008893 | 1 |
taken roughly from core.py:_construct_conv_actions | function construct_conv (conv, actions) {
let subject = null
let created = null
const messages = {}
const participants = {}
for (let action of actions) {
const act = action.act
if (['conv:publish', 'conv:create'].includes(act)) {
subject = action.body
created = action.ts
} else if (ac... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function convertActionBinding(localResolver,implicitReceiver,action,bindingId,interpolationFunction,baseSourceSpan){if(!localResolver){localResolver=new DefaultLocalResolver}var actionWithoutBuiltins=convertPropertyBindingBuiltins({createLiteralArrayConverter:function createLiteralArrayConverter(argCount){// Note:... | [
"0.57302713",
"0.56137383",
"0.5603746",
"0.53532654",
"0.5265883",
"0.51988363",
"0.5177416",
"0.5166583",
"0.5156754",
"0.511634",
"0.50960356",
"0.5084628",
"0.50735635",
"0.5065345",
"0.5028698",
"0.5020877",
"0.5020033",
"0.501968",
"0.50192654",
"0.50128424",
"0.4999238... | 0.6733986 | 0 |
Write a function to replace the first occurrence of "for" in an input string with 4. | function replace4(str){
const findex = str.indexOf("for");
const substring1 = str.substr(0, findex);
const substring2 = str.substr(findex + 3, str.length-1);
return substring1 + 4 + substring2;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function replace4(str){\r\n const findInx = str. indexOf(\"for\");\r\n const subStr1 = str.substr(0, findInx)\r\n const subStr2 = str.substring(findInx +3, str.length-1)\r\n return subStr1+ 4 + subStr2;\r\n}",
"function step4(token) {\n return replacePatterns(token, [['al', ''], ['ance', ''], ['en... | [
"0.8344309",
"0.60410285",
"0.574893",
"0.57471055",
"0.5736403",
"0.5693268",
"0.564956",
"0.5619654",
"0.55581677",
"0.55532205",
"0.55490667",
"0.55490667",
"0.55490667",
"0.55490667",
"0.55490667",
"0.55490667",
"0.55478275",
"0.5545913",
"0.55419385",
"0.5514304",
"0.551... | 0.8103712 | 1 |
Promo Banner Javascript is used to animate the sections for resolutions that can only show a single section at a time | function PromoBanner(element) {
var $children = [].slice.call(
element.querySelectorAll('.amp-dc-promo-block')
);
var currentItemNum = 2;
var winWidth = window.innerWidth;
if ($children.length < 2) {
$children[0].classList.add('dc-fade-in');
r... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function animateSections(){\r\n\r\n\t\t//software development section animations\r\n\tif (sectionView.SD.visib && sectionView.SD.firstView){\r\n\t\t// run animation when you see it first\r\n\t\t$('.SDanimateL').animate({right: '10%'}, { easing: 'swing', duration: 2500});\r\n\t\t$('.SDanimateC').animate({right: '0'... | [
"0.6584571",
"0.638776",
"0.6322611",
"0.6309946",
"0.62544537",
"0.62379616",
"0.6202119",
"0.618039",
"0.6174902",
"0.61464506",
"0.6144381",
"0.61324936",
"0.6076023",
"0.6052137",
"0.6030409",
"0.6009659",
"0.5997664",
"0.5987024",
"0.5978499",
"0.5966374",
"0.5918569",
... | 0.64772445 | 1 |
No need to explicitly store or save, because Auth does it automatically when neccessary. Thus private method. | _store() {
if(!this.isInMemory) throw new Error('Nothing in memory to store to session');
$window.sessionStorage[this.SESSION_KEY] = _type;
_data.store();
$rootScope.$broadcast('$authUpdate');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async save() {\n const newUser = {\n key: this[Datastore.KEY] || datastore.key(kinds.USERS),\n data: this,\n };\n await datastore.save(newUser);\n this.id = newUser.key.id;\n }",
"function save(authyResponse) {\n newSession.save(function(err, doc) {\n cb.call(newSession, ... | [
"0.65118456",
"0.6406481",
"0.63878405",
"0.63516533",
"0.63232434",
"0.621739",
"0.61584413",
"0.61234796",
"0.6115234",
"0.61130565",
"0.6067381",
"0.6018376",
"0.6000501",
"0.5995877",
"0.599459",
"0.59828323",
"0.594524",
"0.5935893",
"0.59209234",
"0.5903948",
"0.5900560... | 0.6487075 | 1 |
make the teams ID and add it to the body | function makeID (body, callback) {
body._id = helpers.makeID([ body.season, body.year, body.team_name ]);
if (typeof body._id != "string") {
callback("Did not get string from makeID",null);
}
else {
callback(null,body);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function sendTeams(res){\n var draftid = res.data.rows[0].id;\n mostRecentDraftId = draftid;\n for(var i=0; i<data.teamInfo.length; i++){\n var sendData = {};\n sendData.draftid = draftid;\n sendData.teamname=data.teamInfo[i].teamName;\n $http.post('/save/sendteams', sendData).then(suc... | [
"0.64626145",
"0.6336901",
"0.62914985",
"0.6171041",
"0.60990715",
"0.6089804",
"0.5965423",
"0.59178984",
"0.59041464",
"0.58800334",
"0.5866511",
"0.5850798",
"0.58463746",
"0.58022547",
"0.578696",
"0.5779056",
"0.5777519",
"0.57637835",
"0.576377",
"0.5762247",
"0.571593... | 0.6759128 | 0 |
turn the members array into an object | function translateMembers (body, callback) {
// make the members into objects
var members = [];
for (var i = 0; i < 8; i++) {
// remove empty elements
if (typeof body.member[i] == 'string' && body.member[i].length != 0) {
members.push( { _id: helpers.makeI... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function _memberData(){ //object to inject into _memberlist array\r\n\tthis.on=false;\r\n\tthis.name=\"\";\r\n\tthis.fac=\"\";\r\n}",
"function convertMembersArrayWithConvertMember(convertMember) {\n return function convertMembersArray(members, label, options) {\n var v7Merged = mergeRecursive_1.defaul... | [
"0.6238826",
"0.61125064",
"0.5853876",
"0.5850895",
"0.57226914",
"0.57226914",
"0.57226914",
"0.57226914",
"0.560469",
"0.55131924",
"0.5390044",
"0.5378175",
"0.5305618",
"0.53005433",
"0.5284085",
"0.52627045",
"0.52428013",
"0.5224303",
"0.52177155",
"0.5209866",
"0.5181... | 0.61752266 | 1 |
Destroy plugin. Usage: $('el').demoplugin('destroy'); | function destroy() {
// Iterate over each matching element.
$el.each(function() {
var el = this;
var $el = $(this);
// Add code to restore the element to its original state...
hook('onDestroy');
// Remove Plugin instance from the element.
$el.remo... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function destroy() {\n // Iterate over each matching element.\n $el.each(function() {\n var el = this;\n var $el = $(this);\n\n // Add code to restore the element to its original state...\n\n hook('onDestroy');\n // Remove Plugin instance from the element.\n $el.... | [
"0.7372163",
"0.7331595",
"0.71744794",
"0.6941931",
"0.68814325",
"0.68359625",
"0.66278225",
"0.6604308",
"0.6604308",
"0.65778095",
"0.65778095",
"0.64646566",
"0.64449906",
"0.6435557",
"0.64076823",
"0.63950443",
"0.6350956",
"0.63351935",
"0.632226",
"0.6267358",
"0.626... | 0.7497962 | 0 |
Check if the site url changes. We can not wait until the load event because if the iframe can take too long for loading, so we perform periodic checks. When this function is called, the only info we have is the url, NOT THE BODY. After this function is called, the function options.fWhenLoaded will be called with the bo... | function listenOnSiteUrlChange(fCallback) {
if ( !fCallback || idCheckOnSiteUrlChange!=null ) return;
console.log('Throw periodic task for checking url changes');
idCheckOnSiteUrlChange = setInterval(
function(){
// iDoc changes when iframe is reloaded?
var idoc=(ifr... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function urlChecker () {\n if (window.urlChecker) return;\n\n var lastUrl = window.location.href;\n\n window.urlChecker = setInterval(function() {\n if (lastUrl !== window.location.href) {\n lastUrl = window.location.href;\n checkPage();\n }\n }, 500);\n}",
"function checkWhetherIframeChanged... | [
"0.66124636",
"0.6358374",
"0.63423675",
"0.6328755",
"0.6326673",
"0.6286888",
"0.6277961",
"0.6091952",
"0.59993917",
"0.59074044",
"0.5825126",
"0.58214825",
"0.5809083",
"0.5696499",
"0.56605965",
"0.56001186",
"0.5562253",
"0.55270034",
"0.5513168",
"0.5513168",
"0.55107... | 0.71763617 | 0 |
Public Methods Skip all mouse events | function ignoreMouseEvents() {
$webSiteContainer.css("pointer-events", "none");
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function mousePressed() {\n return false;\n}",
"function igdrp_mouseUp() {\r\n\treturn;\r\n}",
"function event_pointer_none(){\n $(\".op1,.op2,.op3,.op4\").css(\"pointerEvents\" , \"none\");\n }",
"function preventMouseEvents(ev) {\n ev.preventDefault();\n ev.stopPropagation();\n ... | [
"0.7626196",
"0.7344748",
"0.7308731",
"0.72579473",
"0.7203339",
"0.71830755",
"0.7061833",
"0.7034016",
"0.70226055",
"0.70187104",
"0.70187104",
"0.7008707",
"0.6986347",
"0.69805247",
"0.6919635",
"0.6905423",
"0.6852162",
"0.6846758",
"0.68315053",
"0.6811034",
"0.680317... | 0.7900482 | 0 |
input: object output: new object initiate new object create a for in loop for object select keyval pairs that has 'Fruit' in it add these keyval pair to new object return new object | function returnFruits(produce) {
let newObject = {};
for (let key in produce) {
if (produce[key] === 'Fruit') {
newObject[key] = produce[key];
}
}
return newObject;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function combineFruit(fruit, sweets, vegetables){\n\n return { \"object1\":fruit,\n \"object2\":sweets,\n \"object3\":vegetables,}\n}",
"function combineFruit(fruit, sweets, vegetables){\n return food = {\n fruit, \n sweets, \n vegetables}\n \n}",
"function merge(obj... | [
"0.6258094",
"0.60604554",
"0.5380443",
"0.5313028",
"0.5313028",
"0.5306502",
"0.53020597",
"0.52073985",
"0.5154869",
"0.51474744",
"0.5099452",
"0.5088009",
"0.507517",
"0.5067796",
"0.5037938",
"0.502222",
"0.50205064",
"0.5017615",
"0.5014525",
"0.49892753",
"0.49663287"... | 0.7362991 | 0 |
Spit out the favicon | function writeFavicon(response) {
var pth = (__dirname.indexOf('/') > -1) ? '/' : '\\';
response.writeHead(200, {"Content-Type": "image/vnd.microsoft.icon", "Access-Control-Allow-Origin": "*"});
response.write(fs.readFileSync(__dirname + pth + 'ficon.ico'));
response.end();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function favicon(res){\n\n}",
"static html_favicon() {\n\t\tvar href = this.useAppFavicon ? 'favicon.ico' : this.app_url('../favicon.ico');\n\t\treturn this.html_link(href, 'shortcut icon', { type: 'image/x-icon' });\n\t}",
"generateFavicons(cb) {\n rfg.generateFavicon(this.request, this.options.outputPath,... | [
"0.75685614",
"0.7183203",
"0.6975675",
"0.6901553",
"0.671216",
"0.6641664",
"0.63580966",
"0.6321633",
"0.6316208",
"0.6295582",
"0.6287819",
"0.61369884",
"0.61099476",
"0.6073401",
"0.5761175",
"0.5650613",
"0.56168044",
"0.5604829",
"0.55324996",
"0.5489098",
"0.5450986"... | 0.72376704 | 1 |
Write the directory page | function writeDirPage(response, folderpath, relpath, locations, config) {
var pageHTML = "<!DOCTYPE html><html><head><title>Directory Listing</title></head><body><h1>Directory Listing</h1><p>Resources:</p><ul>";
for (var d = 0; d < locations.length; d++) {
if (fs.existsSync(path.normalize(locations[d] + relpat... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function readDir(err, files) {\n if (err) {\n internalServerError.call(this, err);\n } else {\n var dirName = decodeURIComponent(\n getCurrentPathName(this)\n );\n this.output.push(\n \"<!doctype html>\",\n \"<html>\",\n \"<head>\",\n \"<title>Index of \", dirName, \"</... | [
"0.6515106",
"0.63478684",
"0.63057154",
"0.6268813",
"0.62523997",
"0.62338823",
"0.6198243",
"0.61952984",
"0.61865026",
"0.60250825",
"0.5930051",
"0.588307",
"0.58693534",
"0.58173823",
"0.5794352",
"0.57715297",
"0.57454395",
"0.57301265",
"0.57027584",
"0.5702091",
"0.5... | 0.7062572 | 0 |
Change button's text to Login | function changeTextToLogin() {
$("#loginRegisterFlg").val(1);
document.getElementById('btnLogOrReg').value = "登录";
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function loginButton(name)\n{\n if(name != \"\")\n {\n $(\"#login\").find(\".ui-button-text\").text(\"log out: \" +name);\n $(\"#login\").find(\".ui-button-icon-primary\").removeClass(\"ui-icon-locked\");\n $(\"#login\").find(\".ui-button-icon-primary\").addClass(\"ui-icon-unlocked\");\n... | [
"0.72026354",
"0.70660734",
"0.68435645",
"0.6687216",
"0.65723974",
"0.6569744",
"0.6544363",
"0.64777195",
"0.64612544",
"0.63873494",
"0.63849473",
"0.6303753",
"0.6299903",
"0.62865746",
"0.6275474",
"0.6258406",
"0.62535095",
"0.62459743",
"0.62384033",
"0.6235837",
"0.6... | 0.7505694 | 0 |
check if all the dependencies are fulfilled. can be overridden in the concrete class. | dependenciesFulfilled()
{
return true;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function areDependenciesAvailable() {}",
"function testDeps(dep) {\n\t // if (dep.definer.factory && typeof dep.definer.factory === 'function') \n\t // { \n\t if (dep.dependencies.every(function(e) { return e.met;}))\n\t { log(I,'All dependencies have been met for ' + dep.definer.id );\n\t // ' ,exe... | [
"0.73745674",
"0.69092304",
"0.67963654",
"0.660238",
"0.6520614",
"0.65167874",
"0.64851165",
"0.64773744",
"0.635012",
"0.626349",
"0.6254511",
"0.6174811",
"0.6105204",
"0.59674525",
"0.5888653",
"0.5887057",
"0.5761318",
"0.5734733",
"0.5710682",
"0.57012403",
"0.56859547... | 0.69162387 | 1 |
addAllEmployees(); walk through the employees, adding them | function addAllEmployees() {
for (var i = 0; i < aoCompany.length; i++) {
addEmployee(i, aoCompany[i]).then(function () {});
// the following doesn't work, because of the inability to create File objects
// (see below)
// if (aoCompany[i].sImageFile != "") {
// addImage(i, aoCompany[... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"addEmployees(employees) {\n employees.forEach((employee) => {\n if (!(employee instanceof Employee)) {\n throw new Error('Must provide a employee as an argument!');\n }\n this.addEmployee(employee);\n });\n }",
"function fillEmployeeList(){\r\n var divisionList = company[0].divisi... | [
"0.6779669",
"0.6457759",
"0.5973942",
"0.5909966",
"0.5896851",
"0.58418876",
"0.5809607",
"0.576721",
"0.56280565",
"0.56182665",
"0.5588128",
"0.5588128",
"0.5534756",
"0.5522164",
"0.5481429",
"0.54710597",
"0.54487246",
"0.5442253",
"0.5435607",
"0.5417088",
"0.5407476",... | 0.6797725 | 0 |
let oDeltaEmotions = compareEmotions(0, oTestEmotions2); console.log(oDeltaEmotions); oDeltatEmotions = compareEmotions(0, oTestEmotions1); console.log(oDeltaEmotions); testGetEmotions (); | function testGetEmotions() {
getEmotions(0).then(function (oEmotions) {
console.log(oEmotions);
});
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function compareRobots(robot1, memory1, robot2, memory2) {\n\n let robot1TurnsAvg = 0;\n let robot2TurnsAvg = 0;\n\n for (let tasks = 0; tasks < 100; tasks++) {\n robot1TurnsAvg += testRobot(VillageState.random(), robot1, memory1);\n robot2TurnsAvg += testRobot(VillageState.random(), robot2,... | [
"0.60114217",
"0.59539324",
"0.5903766",
"0.5888871",
"0.5749897",
"0.5671236",
"0.5660437",
"0.56354946",
"0.56051433",
"0.5593931",
"0.55829614",
"0.55313224",
"0.5514088",
"0.5475761",
"0.5466395",
"0.54430836",
"0.53387684",
"0.5337655",
"0.5334695",
"0.5332736",
"0.53181... | 0.6602226 | 0 |
displaying only those employees which have some issues | function displayEmployees(employees) {
var length = employees.length;
console.log("length:" + length);
for (i = 0; i < length; i++) {
var issues = 0;
if (employees[i].aiAnger != 0 || employees[i].aiFear != 0 || employees[i].aiSad != 0) {
issues += 1;
$("tbody").append(`<tr id="${employees[i].e... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"filterEmployees() {\n this.filteredEmployees = this.employees.filter(employee => employee.visible)\n }",
"function getDivAEmployees(employees, divisions) {\n\n return employees.find(function(emp) {\n return emp.assignedDiv === divisions.divId;\n });\n}",
"showAllEmployees() {\n return thi... | [
"0.56755966",
"0.5646418",
"0.55840707",
"0.55777466",
"0.55600244",
"0.5524072",
"0.5449859",
"0.53883475",
"0.5368632",
"0.53193605",
"0.5306896",
"0.529665",
"0.525786",
"0.52499646",
"0.52359194",
"0.52255934",
"0.52195394",
"0.52177376",
"0.52146095",
"0.52017266",
"0.51... | 0.6238058 | 0 |
Sets any exceptions that may have occurred in the source | setExceptions(exceptions, suppressUpdate = this.exceptions == exceptions) {
this.exceptions = exceptions;
if (!suppressUpdate)
this.callListeners();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"set excuse(value) {\n this._excuse = value;\n }",
"function exceptionConsumer() {\n\t\ttry {\n\t\t\tthis.original.apply(this.scope, arguments);\n\t\t} catch (e) {\n\t\t\tprocessException(e);\n\t\t}\n\t}",
"function yEnableExceptions() {\n YAPI.EnableExceptions();\n}",
"function YAPI_EnableExcept... | [
"0.62376076",
"0.54855967",
"0.5446677",
"0.5418117",
"0.5335502",
"0.5300991",
"0.5219674",
"0.5203826",
"0.5184302",
"0.5139992",
"0.5114694",
"0.5107586",
"0.49921876",
"0.49846968",
"0.49464288",
"0.49379188",
"0.49362838",
"0.4923555",
"0.49104294",
"0.48705512",
"0.4839... | 0.62911755 | 0 |
Retrieves the exceptions that the source currently indicate to have | getExceptions() {
return this.exceptions;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"visitExceptionDeclaration(ctx) {\n\t return this.visitChildren(ctx);\n\t}",
"visitExceptionDeclaration(ctx) {\n\t return this.visitChildren(ctx);\n\t}",
"visitExceptionSpecification(ctx) {\n\t return this.visitChildren(ctx);\n\t}",
"function getExceptionHandler() {\n return Private$4.exceptionHan... | [
"0.58559537",
"0.58559537",
"0.5764833",
"0.56859314",
"0.5662321",
"0.5615471",
"0.5575243",
"0.5560665",
"0.5540288",
"0.5513116",
"0.54526764",
"0.54257715",
"0.5381444",
"0.53782934",
"0.53545403",
"0.522383",
"0.5085221",
"0.50816536",
"0.50799197",
"0.50790143",
"0.5074... | 0.69365776 | 0 |
let routine = [wakeDog(),leashDog(),walkToPark(),throwFrisbee(),walkHome(),unleashDog()] you aren't calling the each of the functions with in the array. you are naming them first and calling them in the function | function exerciseDog(dogName,dogBreed)
{ //for (let i = 0; i < routine.length; i++){
//routine[i(dogName,dogBreed)];
//}
// y = f(X)
return routine.map(fn => fn(dogName,dogBreed)) //.map was suggested by matteo
//map works like hashes and key and value
//https://developer.mozilla.org/en-US... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function exerciseDog(dogName, dogBreed) {\n let returnValues = [ ]\nfor (let i = 0; i<routine.length; i+=1) {\n let callEachFunction = routine[i](dogName, dogBreed);\n returnValues.push(callEachFunction);\n}\nreturn returnValues\n}",
"function bankRobbery(){\n const heroes = ['Spiderman', 'Wolverine', ... | [
"0.7334882",
"0.64500195",
"0.62868345",
"0.62058985",
"0.6167167",
"0.60748494",
"0.60259426",
"0.59880054",
"0.59830976",
"0.57783437",
"0.5755675",
"0.57425296",
"0.5734057",
"0.5723009",
"0.57137215",
"0.5706886",
"0.5696039",
"0.5664708",
"0.56630695",
"0.5656894",
"0.56... | 0.6940651 | 1 |
asks the user if they want to play again | function playAgain() {
inquirer.prompt([{
type: "list",
name: "reset",
message: "Play Again?",
choices: ["Yes", "No"]
}]).then(function(res) {
if (res.reset === "Yes") {
pickWord();
hangman();
}
})
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function playAgain() {\n inquirer.prompt([\n {\n type: \"confirm\",\n name: \"confirm\",\n message: \"Would you like to play again?\",\n default: true\n }\n ])\n .then(function (user) {\n if (u... | [
"0.79886264",
"0.79023427",
"0.76968026",
"0.7585258",
"0.75681263",
"0.754678",
"0.75050527",
"0.73810893",
"0.72685856",
"0.7262268",
"0.72436965",
"0.7243517",
"0.7204787",
"0.72040373",
"0.71479565",
"0.712669",
"0.7119753",
"0.7070105",
"0.70452684",
"0.7041453",
"0.6987... | 0.80626655 | 0 |
Static convenience function for coercing a value to a FastPath. | static from(obj) {
return new FastPath(obj);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function castPath (value, object) {\n\tif (isArray(value)) {\n\t\treturn value;\n\t}\n\n\treturn isKey(value, object) ? [value] : stringToPath(toString(value));\n}",
"static translatePathToObject(path, value) {\r\n // Normalize the path\r\n if (!(path instanceof Array))\r\n path = path.s... | [
"0.64197767",
"0.63132",
"0.5938357",
"0.5897279",
"0.57861495",
"0.57535213",
"0.55470484",
"0.5461295",
"0.5347233",
"0.52498865",
"0.5198835",
"0.513291",
"0.51111627",
"0.5094315",
"0.50936896",
"0.5033821",
"0.50204635",
"0.50204635",
"0.50031966",
"0.49927336",
"0.49755... | 0.6837037 | 0 |
Temporarily push properties named by string arguments given after the callback function onto this.stack, then call the callback with a reference to this (modified) FastPath object. Note that the stack will be restored to its original state after the callback is finished, so it is probably a mistake to retain a referenc... | call(callback/*, name1, name2, ... */) {
const s = this.stack;
const origLen = s.length;
const argCount = arguments.length;
let value = s[origLen - 1];
for (let i = 1; i < argCount; ++i) {
const name = arguments[i];
value = value[name];
s.push(name, value);
}
const result ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"each(callback/*, name1, name2, ... */) {\n const s = this.stack;\n const origLen = s.length;\n const argCount = arguments.length;\n let value = s[origLen - 1];\n\n for (let i = 1; i < argCount; ++i) {\n const name = arguments[i];\n value = value[name];\n s.push(name, value);\n }\n\... | [
"0.5013735",
"0.5003814",
"0.4890052",
"0.48300558",
"0.47147378",
"0.46677908",
"0.46168587",
"0.46072403",
"0.45949247",
"0.45450646",
"0.45375928",
"0.45258012",
"0.4472533",
"0.4461509",
"0.44453174",
"0.44394973",
"0.44339156",
"0.44324785",
"0.43973464",
"0.43842286",
"... | 0.5082684 | 0 |
Similar to FastPath.prototype.call, except that the value obtained by accessing this.getValue()[name1][name2]... should be arraylike. The callback will be called with a reference to this path object for each element of the array. | each(callback/*, name1, name2, ... */) {
const s = this.stack;
const origLen = s.length;
const argCount = arguments.length;
let value = s[origLen - 1];
for (let i = 1; i < argCount; ++i) {
const name = arguments[i];
value = value[name];
s.push(name, value);
}
for (let i =... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"map(callback, ...names) {\n const result = [];\n this.each((path9, index, value) => {\n result[index] = callback(path9, index, value);\n }, ...names);\n return result;\n }",
"each(callback, ...names) {\n const {\n stack\n } = this;\n const {\n length\n } = stack;\n let ... | [
"0.6111646",
"0.58801",
"0.5522805",
"0.53598243",
"0.53468984",
"0.5311863",
"0.53005433",
"0.52992034",
"0.5263707",
"0.5125354",
"0.5027382",
"0.49913582",
"0.4990881",
"0.4980753",
"0.49767664",
"0.49767578",
"0.49605227",
"0.49466115",
"0.49425775",
"0.49188924",
"0.4865... | 0.59513503 | 1 |
The name of the current property is always the penultimate element of this.stack, and always a String. | getName() {
const s = this.stack;
const len = s.length;
if (len > 1) {
return s[len - 2];
}
// Since the name is always a string, null is a safe sentinel value to
// return if we do not know the name of the (root) value.
return null;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"get stackName() {\n return this._stackName;\n }",
"get propertyName() {\r\n return this.i.propertyName;\r\n }",
"getName() {\n const {\n stack\n } = this;\n const {\n length\n } = stack;\n\n if (length > 1) {\n return stack[length - 2];\n } // Since the name... | [
"0.6946276",
"0.6673989",
"0.66511697",
"0.65248024",
"0.62821794",
"0.62752986",
"0.62334347",
"0.62212354",
"0.61517465",
"0.61409277",
"0.6110902",
"0.6104169",
"0.6104169",
"0.6104169",
"0.6104169",
"0.6104169",
"0.61015654",
"0.6091637",
"0.608698",
"0.6073536",
"0.60735... | 0.67681855 | 1 |
The value of the current property is always the final element of this.stack. | getValue() {
const s = this.stack;
return s[s.length - 1];
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"getValue() {\n return getLast(this.stack);\n }",
"current() {\n return this._stack[this._stack.length - 1];\n }",
"peek () {\n console.log (`Current element is: ${this.myStack[this.myStack.length - 1]}`);\n }",
"back(){\n return this.tail.val;\n }",
"get() {\n ... | [
"0.7184208",
"0.69601136",
"0.689572",
"0.65262395",
"0.6515986",
"0.6494185",
"0.64800566",
"0.64222604",
"0.64201486",
"0.6241297",
"0.6178284",
"0.6148159",
"0.613989",
"0.61058855",
"0.61058855",
"0.60795796",
"0.6069647",
"0.6065113",
"0.6062271",
"0.6008996",
"0.5995675... | 0.70332605 | 1 |
Sets the randomness of the algorithm. Enabling randomness reduces the risk of falling into a local solution, but makes the solution unrepeatable. | setRandomness(flag) {
this.#isRandom = flag;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function setRandomization(enabled) {\n\tHAT_RANDOM = isEnabled;\n\tTSHIRT_RANDOM = isEnabled;\n\tUMBRELLA_RANDOM = isEnabled;\n\tBALLOON_RANDOM = isEnabled;\t\n}",
"setRandom(rand)\n\t{\n\t\tthis.random = rand;\n\t}",
"SetRandomNumber () {\n var temp = Math.floor(Math.random() * 54);\n RandomNumb... | [
"0.6905583",
"0.67855996",
"0.61647516",
"0.6146583",
"0.61257654",
"0.61093605",
"0.6096534",
"0.6089728",
"0.60736233",
"0.60624623",
"0.60567605",
"0.6008054",
"0.6008054",
"0.6008054",
"0.5966105",
"0.5886663",
"0.586724",
"0.5844511",
"0.580747",
"0.57808983",
"0.577731"... | 0.7396453 | 0 |
Function for routing the lookup display and action based on which tab is selected | function tabRouter(index) {
// Remove previous delegated click handler
$('#autocomplete-selected div.confirmation div.answer a.save, #advanced-search-selected div.confirmation div.answer a.save').off('click');
if(index <= 1) {
$('#lookup').show();
} else {
$('#loo... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function tabAction(){\n\t\n\t$$('.tabset .tab li').each(function(e, i){\n\n\t\te.removeEvents('click').removeEvents('dblclick').addEvents({\n\n\t\t\t'click' : function(){\n\t\t\t\tif(e.hasClass('view-all')){\n\t\t\t\t\topenView('ALL', i);\n\t\t\t\t}else\n\t\t\t\tif(e.hasClass('do-view')){\n\t\t\t\t\topenView(i, i)... | [
"0.6294132",
"0.59362173",
"0.59362173",
"0.5927006",
"0.5925054",
"0.59151816",
"0.5879329",
"0.58567417",
"0.58567417",
"0.5812361",
"0.57697505",
"0.57448983",
"0.5718349",
"0.5693455",
"0.5675263",
"0.56567323",
"0.56533504",
"0.56246597",
"0.5624352",
"0.5595248",
"0.559... | 0.6492211 | 0 |
returns menu items for header cells, can be a callback or an array | function headItems(evt, ui){
return [
{
name: 'Rename',
action: function (evt, ui) {
var grid = this,
column = ui.column,
title = column.title;
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function add_headers(){\r\n var scriptsTable = document.getElementsByTagName(\"table\")[0];\r\n var headerRow = scriptsTable.getElementsByTagName(\"tr\")[0];\r\n var info = headerRow.getElementsByTagName(\"th\")[0];\r\n info.appendChild(document.createTextNode(\" \"));\r\n add_menu_header(info, \"Name\",... | [
"0.61390984",
"0.61147964",
"0.61019605",
"0.60689116",
"0.589547",
"0.583167",
"0.57253724",
"0.572011",
"0.5710386",
"0.56102353",
"0.5557299",
"0.5548491",
"0.5548491",
"0.55237025",
"0.5509301",
"0.54937184",
"0.5493593",
"0.54901797",
"0.5463273",
"0.54556024",
"0.544205... | 0.66051143 | 0 |
A timer callback function that checks links (anchor elements) in the DOM. | function timerTick() {
const timeStamp = Date.now();
// Iterate all the links currently on the page (i.e., anchor elements with an href attribute)
forEachAnchorElement(anchorElement => {
const linkInfo = anchorElements.get(anchorElement)
// If we haven't seen this link ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function startCheckingUrl() {\r\n\t\ttimeout = setTimeout(timeoutHandler, timeoutLength);\r\n\t}",
"function disableLinks(){\n $(\"a\").each(function() {\n $( this ).addClass( \"linkDisabled\" );\n });\n setTimeout(function(){\n $(\"a\").each(function() {\n $( this ).removeClass... | [
"0.61371064",
"0.6056921",
"0.60532844",
"0.60292536",
"0.59627765",
"0.59570795",
"0.5896739",
"0.58725274",
"0.58615667",
"0.5856766",
"0.58343184",
"0.5770886",
"0.5763963",
"0.57462454",
"0.57057637",
"0.56632155",
"0.5651991",
"0.56131923",
"0.56074256",
"0.55739695",
"0... | 0.62941444 | 0 |
Notify the background script of any exposed links. | function notifyBackgroundScript() {
if (exposedLinkURLs.length > 0) {
browser.runtime.sendMessage({
type: "webScience.linkExposure.linkExposureUpdate",
pageId: pageManager.pageId,
url: pageManager.url,
privateWindow: browser.extension.i... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function sendLinks(links){\n chrome.runtime.sendMessage(links);\n}",
"function handleExternalLinks () {\n var host = location.host\n var allLinks = document.querySelectorAll('a')\n forEach(allLinks, function (elem, index) {\n checkExternalLink(elem, host)\n })\n}",
"function addOnUpdateListener(){\n\... | [
"0.60006124",
"0.59488374",
"0.5834642",
"0.57092416",
"0.5667595",
"0.56467813",
"0.5626267",
"0.5556346",
"0.5529279",
"0.55146426",
"0.55083096",
"0.549739",
"0.5450106",
"0.5449223",
"0.54177845",
"0.54057574",
"0.539424",
"0.53652793",
"0.5318364",
"0.53129125",
"0.53117... | 0.8564762 | 0 |
A listener function for pageManager.onPageVisitStart. Resets pagespecific data and starts the timer ticking. | function pageVisitStartListener () {
// Reset page-specific data
lastLostAttention = -1;
anchorElements = new WeakMap();
pagePS1 = urlToPS1(pageManager.url);
exposedLinkURLs = [];
// Start the timer ticking
timerId = setInterval(timerTick, updateInterval);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function pageManagerLoaded() {\n pageManager = window.webScience.pageManager;\n pageManager.onPageVisitStart.addListener(pageVisitStartListener);\n if(pageManager.pageVisitStarted) {\n pageVisitStartListener();\n }\n pageManager.onPageVisitStop.addListener(pageVisitSto... | [
"0.6223395",
"0.6154136",
"0.60698855",
"0.6065711",
"0.59939724",
"0.596627",
"0.5849423",
"0.58444184",
"0.57982683",
"0.57807744",
"0.5729762",
"0.572288",
"0.5685292",
"0.56272364",
"0.56205297",
"0.55841696",
"0.55623865",
"0.5555673",
"0.55442864",
"0.5506216",
"0.55051... | 0.7927766 | 0 |
A listener function for pageManager.onPageVisitStop. Clears the timer and intersection observer. | function pageVisitStopListener() {
// There might be links queued for reporting, so report them
notifyBackgroundScript();
clearInterval(timerId);
timerId = 0;
observer.disconnect();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"stop () {\n this._timer && this._timer.clear()\n this._latencyMonitor && this._latencyMonitor.removeListener('data', this._onLatencyMeasure)\n debug('stopped')\n }",
"function onStop() {\n log('#logs', \"Clicked the stop button\");\n if (detector && detector.isRunning) {\n runnin... | [
"0.65705085",
"0.62908804",
"0.6257277",
"0.6239889",
"0.6239889",
"0.6213391",
"0.61184734",
"0.60742396",
"0.60742396",
"0.6061477",
"0.5969196",
"0.59670234",
"0.5868004",
"0.58342445",
"0.58022195",
"0.57888305",
"0.57767195",
"0.5758655",
"0.5757813",
"0.57572395",
"0.57... | 0.7893781 | 0 |
Wait for pageManager load | function pageManagerLoaded() {
pageManager = window.webScience.pageManager;
pageManager.onPageVisitStart.addListener(pageVisitStartListener);
if(pageManager.pageVisitStarted) {
pageVisitStartListener();
}
pageManager.onPageVisitStop.addListener(pageVisitStopListener);... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async waitForPageLoad(){\n await this.getDriver().waitUntil(async() => {\n return await this.isPageLoaded()\n }, 100000, `pageLoaded timeout`, 500)\n }",
"static doWaitTillPageLoads() {\n this.#defaultResponse()\n }",
"function waitForFullPageLoad(){\r\n if(typeof Ext === \... | [
"0.74805105",
"0.7093873",
"0.6920591",
"0.68738234",
"0.675317",
"0.67477137",
"0.6683461",
"0.6683461",
"0.65443707",
"0.6514022",
"0.6481008",
"0.64424646",
"0.64341146",
"0.64341146",
"0.64302284",
"0.6421178",
"0.64069724",
"0.63866615",
"0.63408947",
"0.6323988",
"0.629... | 0.7211038 | 1 |
You have to override this ! Change this.name to the name of your module. | constructor(){
this.options = {}
this.name = "Module";
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function Module(){}",
"constructor(name) {\n super(name)\n\n }",
"constructor(name) {\n super(name)\n\n }",
"constructor(projectModulesService) {\n super(projectModulesService);\n this.name = 'project-module-details';\n this.prependName = 'Module Details';\n }",
... | [
"0.7038737",
"0.68043894",
"0.68043894",
"0.6699831",
"0.66775936",
"0.6656237",
"0.6620137",
"0.6610524",
"0.6589174",
"0.6589174",
"0.65736794",
"0.65675783",
"0.6509373",
"0.6493426",
"0.64557254",
"0.64375854",
"0.6413942",
"0.63805157",
"0.6375226",
"0.63711756",
"0.6331... | 0.69877934 | 1 |
Displays the song list to user | function displaySongs(song_list) {
var html = "";
for(var i = 0; song_list[i]; i++) {
var song_box = "<div class='songbox'><div class='song' id='" + song_list[i].s_id + "'>" + song_list[i].title + "<br><span class = 'artist'>" + song_list[i].artist + "</span>" +"</div><div class='feedback'><span class='liked' st... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"displaySongs(){\n $('#playlist').html('');\n\n //loop through the songs in the playlist\n for(var i=0; i < this.songArray.length; i++){\n //the 1 is for the index of the songs that beign played\n $('#playlist').append('<h5 id=\"song_' + i + '\">' + this.songArray[i].name + ' by ' + this.songArra... | [
"0.774188",
"0.7213956",
"0.7176903",
"0.7113154",
"0.6915759",
"0.6878144",
"0.68323696",
"0.67876947",
"0.67765105",
"0.6725044",
"0.6600276",
"0.6548318",
"0.65365684",
"0.6518845",
"0.6515991",
"0.65016884",
"0.6501669",
"0.64979756",
"0.6485519",
"0.646673",
"0.6437584",... | 0.78138053 | 0 |
Auto Solve the puzzle for the user | function solve_puzzle() {
fill_values(solved_Sudoku);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"solve(){\n\n }",
"solve() {\n\n // Verify that the initial state is a valid board\n if (!this.isValidBoard()) {\n return 'invalid board';\n }\n\n // Keep a stack of our attempts to solve, so we can backtrack as necessary\n const attemptStack = [];\n let attemptCount = 0;\n\n while (!... | [
"0.7407227",
"0.7164665",
"0.6880769",
"0.6838716",
"0.6832196",
"0.67785114",
"0.6735737",
"0.66677845",
"0.6661003",
"0.66558206",
"0.66333",
"0.6612655",
"0.65973663",
"0.65945905",
"0.65857834",
"0.6526386",
"0.64966804",
"0.6494738",
"0.64804816",
"0.64801425",
"0.646401... | 0.7416627 | 0 |
A function used to resolve all collissions in the game. | function resolveCollissions(){
// The contact object.
var contact;
// Loop through all the collissions in the world and resolve them.
for ( contact = GameResources.GameWorld.getWorld().m_contactList; contact != null; contact = contact.m_next )
{
// Get the two bodies involved in the collission.
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function resolve_collision(state){\n // List for subfunction to lookup previously read collision rectangles.\n var lookupTable = [];\n\n // Ah Yes... N^3 Complexity\n resolve_system(state, collision_id, (state, registry_obj) => {\n resolve_collision_individual(state, registry_obj.entity, lookup... | [
"0.6235075",
"0.60441476",
"0.60064185",
"0.5755731",
"0.56841004",
"0.56030184",
"0.5565508",
"0.53212047",
"0.53181624",
"0.5310851",
"0.5307315",
"0.52951217",
"0.52932036",
"0.5264963",
"0.5264654",
"0.52480114",
"0.5224253",
"0.5221404",
"0.5203332",
"0.51935524",
"0.517... | 0.771289 | 0 |
Given an `ActivatedRouteSnapshot`, returns the final value of the `Route.title` property, which can either be a static string or a resolved value. | getResolvedTitleForRoute(snapshot) {
return snapshot.data[RouteTitleKey];
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getStepTitleFromRoute(route) {\n if (route.data && route.data.title) {\n return route.data.title;\n }\n return capitalize(insertSpaces(route.path));\n}",
"function getHeaderTitle(route) {\n const routeName = route.state\n ? route.state.routes[route.state.index].name\n : ... | [
"0.7088413",
"0.6670911",
"0.6140262",
"0.59557956",
"0.58710366",
"0.5835739",
"0.58267707",
"0.5769337",
"0.5760426",
"0.5645828",
"0.56158996",
"0.56158996",
"0.5545551",
"0.5532373",
"0.55271137",
"0.5500602",
"0.5438104",
"0.5403855",
"0.5376799",
"0.5324094",
"0.5292014... | 0.84065396 | 0 |
Calculate how much beef heart is available for meal at index mealId, given that the previous meals have used a certain amount already. | calculateBeefHeartAvailable(mealId) {
const { meals, beefHeartWeight } = this.state;
var heartAlreadyUsed = 0;
for (var i = 0; i < mealId; i++) {
heartAlreadyUsed += meals[i].beefHeartNeeded;
}
return beefHeartWeight - heartAlreadyUsed;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function CalculateMaxReward () {\n let num = 0\n let lootTable = GetLootTable(1.0)\n lootTable.forEach(lootEntry => {\n // QAKIFCLCEEKMQ is a private boolean inside of ItemDefinition, I can't find it anywhere however.\n //if (lootEntry.item.QAKIFCLCEEKMQ === QKDKDLGICJHOQ) {\n\t\t\tnum += lootEntry.count.... | [
"0.5940604",
"0.5871349",
"0.58610284",
"0.58260113",
"0.58236045",
"0.5782569",
"0.5767571",
"0.5713088",
"0.5689384",
"0.56799394",
"0.5659798",
"0.5632674",
"0.5587456",
"0.5581593",
"0.5577992",
"0.5574785",
"0.55609",
"0.554611",
"0.5543854",
"0.5494407",
"0.54896617",
... | 0.8551588 | 0 |
Component Did Mount Method Here We Mount Component Splash Screen | componentDidMount() {
setTimeout(() => SplashScreen.hide() , 500);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"componentDidMount() {\n this.props.dispatch(SplashActions.load());\n setTimeout(() => this.props.navigation.navigate('Auth'), 1000);\n }",
"showSplashScreen() {\n this.props.navigator.push({\n id: 'Splash',\n callback: this.splashScreenFinished,\n })\n }",
"componentDidMount() {\n th... | [
"0.66458136",
"0.65131176",
"0.6382505",
"0.62604344",
"0.6176392",
"0.61597186",
"0.61326504",
"0.6082561",
"0.6067463",
"0.60258645",
"0.602246",
"0.5965827",
"0.59443206",
"0.59423584",
"0.59205294",
"0.5920455",
"0.5917204",
"0.5908164",
"0.59024084",
"0.5886029",
"0.5881... | 0.72477686 | 0 |
This function generate the task column index from the spreadsheet | function getTask() {
var ss = SpreadsheetApp.openById(ScriptProperties.getProperty('active'));
var sheet = ss.getSheetByName("default");
ss.setActiveSheet(sheet);
var data = sheet.getDataRange().getValues();
var task = [];
for (var index = 0; index < 50; index++) {
var str = data[0][inde... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getTask(){\n var ss = SpreadsheetApp.openById(ScriptProperties.getProperty('active'));\n var sheet = ss.getSheetByName(\"default\");\n ss.setActiveSheet(sheet);\n var data=sheet.getDataRange().getValues();\n var task=[];\n for(var index=0;index<50;index++){\n var str=data[0][index];\n if(/Task... | [
"0.636616",
"0.62778366",
"0.6011375",
"0.594689",
"0.5768345",
"0.5586758",
"0.5561004",
"0.5468853",
"0.5440999",
"0.5431336",
"0.5403852",
"0.5398494",
"0.5383921",
"0.5263447",
"0.5253113",
"0.51982224",
"0.5193704",
"0.5182401",
"0.51814",
"0.51674134",
"0.5164217",
"0... | 0.6425796 | 0 |
Input digit in the inputScreen | function digitInput(value){
document.getElementById("input-pinScreen").value += value;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function numberClick(event) {\n if (screenInput.value === \"0\") {\n screenInput.value = event.target.value;\n } else {\n screenInput.value += event.target.value;\n }\n}",
"function input(digit) {\r\n // Store display value and wait state\r\n const { displayValue, waitState } = calculator;\r\n ... | [
"0.70195127",
"0.6972547",
"0.6922559",
"0.6854128",
"0.6825968",
"0.6825968",
"0.6823536",
"0.67638475",
"0.6756815",
"0.6746409",
"0.6701538",
"0.6650403",
"0.65554494",
"0.6447351",
"0.6429344",
"0.63916856",
"0.63867086",
"0.6325457",
"0.6307967",
"0.62302554",
"0.6211283... | 0.69753534 | 1 |
Collect a payment channel after 12hour wait | async collectChannel(lotus, metadata) {
const paymentChannelAddr = metadata.paymentChannelAddr;
ports.postLog(`DEBUG: LUXON: Opterations.collectChannel: collectChannel on paymentChannelAddr=${paymentChannelAddr}`);
await lotus.collectPaymentChannel(paymentChannelAddr);
return 'Channel collected';
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function paymentDelay2(agent){\n\treturn new Promise((resolve, reject) => {\n\t\t\tagent.add('Thank you for your payment! \\nYour tickets have been booked and your bookingID is ' + Math.random().toString().substr(2,5));\n\t\t\tagent.add('Do you want to book hotel room also?');\n\t\t\tyesNoSuggestion(agent);\n\t\t\... | [
"0.5846631",
"0.53362256",
"0.53007257",
"0.52962965",
"0.5198924",
"0.519255",
"0.5188867",
"0.518698",
"0.51858395",
"0.51721764",
"0.5149561",
"0.5147497",
"0.51229244",
"0.51082504",
"0.5102411",
"0.5101036",
"0.5100112",
"0.50830704",
"0.5076965",
"0.5058909",
"0.5057995... | 0.5710258 | 1 |
is the response Ok | function httpOk(response) {
try {
return !response.status && location.protocol === "file:" ||
(response.status >= 200 && response.status < 300) ||
(response.status === 304) ||
(navigator.userAgent.indexOf("Safari") >= 0 &&
typeof response.status === "undefined");
} catch (e) {
}
r... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"isOk() {\n return this.getStatusCode() === '9000';\n }",
"function isOk(result) {\n return result.kind === 'ok';\n}",
"function isAjaxReturnOK(obj) {\n var ret = false;\n if (obj) {\n if (typeof (obj.response) == 'string') {\n if (obj.response.toLowerCase() == 'ok') {\n ... | [
"0.8306802",
"0.7201834",
"0.7067818",
"0.6932997",
"0.6868797",
"0.6840814",
"0.6818299",
"0.6817181",
"0.6814195",
"0.6814195",
"0.6814195",
"0.6814195",
"0.6814195",
"0.6814195",
"0.6814195",
"0.6814195",
"0.6814195",
"0.6814195",
"0.6814195",
"0.6814195",
"0.6814195",
"... | 0.7401871 | 1 |
Changes to the header when a language selector is present. | function languageSelector() {
if ($('.language-selector')) {
var languageSelectorHeight = $('.language-selector').outerHeight();
$('.widget.extendednavigation a.pull').css('margin-top', languageSelectorHeight+'px');
$('.bk-header').css('margin-top', languageSelectorHeight+'px');
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"setPageLanguage() {\n document.documentElement.lang = getLanguage();\n }",
"function changeLanguage(currentLang) {\n state.currentLang = currentLang;\n\n var languageStrings = {\n en: \"[EN]\",\n es: \"[ES]\",\n vi: \"[VI]\",\n ar: \"[AR]\"\n }\n\n var lowerLanguageStrings = {... | [
"0.6103367",
"0.6087198",
"0.60626024",
"0.60212487",
"0.59858584",
"0.5975142",
"0.59701425",
"0.5952867",
"0.59505457",
"0.5917663",
"0.59041566",
"0.58533317",
"0.5838052",
"0.58371377",
"0.57981205",
"0.5766497",
"0.5761887",
"0.5740764",
"0.5734109",
"0.57217133",
"0.565... | 0.6175303 | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.