query stringlengths 9 34k | document stringlengths 8 5.39M | negatives listlengths 19 20 | metadata dict |
|---|---|---|---|
drawGraph Calculate the participant's score for a meeting and add data to graph | drawGraph() {
logger.debug('ParticipantScore: drawGraph', this.props.graphType);
const chart = this.chart;
const timelineData = this.props.graphDatasets[GraphDatasetTypes.UTTERANCE_TIMELINE].data;
logger.debug('ParticipantScore: timelineData', { timelineData });
// Is this comp... | [
"getGraphData() {\n // sort participants by totalSecsUtterances\n const sortedParticipants = new Map([ ...this.props.graphDataset.participantStats.entries() ]\n .sort((a, b) => b[1].totalSecsUtterances - a[1].totalSecsUtterances));\n\n const selfData = [ this.props.participantId, {\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Called when the user needs to reauthorize. Sends the user of the addon an email explaining the need to reauthorize and provides a link for the user to do so. Capped to send at most one email a day to prevent spamming the users of the addon. | function sendReauthorizationRequest() {
var settings = PropertiesService.getDocumentProperties();
var authInfo = ScriptApp.getAuthorizationInfo(ScriptApp.AuthMode.FULL);
var lastAuthEmailDate = settings.getProperty('lastAuthEmailDate');
var today = new Date().toDateString();
if (lastAuthEmailDate != today) {
... | [
"function sendReauthorizationRequest() {\n var authInfo = ScriptApp.getAuthorizationInfo(ScriptApp.AuthMode.FULL);\n var properties = PropertiesService.getUserProperties();\n var LAST_AUTH_EMAIL_KEY = 'Import.reauth.lastAuthEmailDate';\n var lastAuthEmailDate = properties.getProperty(LAST_AUTH_EMAIL_KEY);\n va... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Enter a parse tree produced by LUFileParserentityListBody. | enterEntityListBody(ctx) {
} | [
"enterNewEntityListbody(ctx) {\n\t}",
"visitNewEntityListbody(ctx) {\n\t return this.visitChildren(ctx);\n\t}",
"visitEntityListBody(ctx) {\n\t return this.visitChildren(ctx);\n\t}",
"function parseListFile(listFileName, projects, rootPath){\n \n const listObj = readInFile(listFileName);\n //writeToFile(... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Keeps value within min and max | function keepWithin(value, min, max) {
if(value < min) value = min;
if(value > max) value = max;
return value;
} | [
"function keepWithin(value, min, max) {\n if( value < min ) value = min;\n if( value > max ) value = max;\n return value;\n }",
"function keepWithin(value, min, max) {\r\n if(value < min) value = min;\r\n if(value > max) value = max;\r\n return value;\r\n }",
"function keepWithin(val... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
transform ORCID activities into (title,ID,identifierType,originalOrder,URL,citeprocURL) | function activitiesToSimpleWorks(activitiesObject){
var order = 0;
var worksList = activitiesObject.obj.works.group.map(function(obj){
var rObj = {originalOrder:""+order};
order++;
rObj.title = obj["work-summary"][0].title.title.value;
if (obj.identifiers){
rObj.ID = obj.identifiers.ident... | [
"async enrichActivity(activity) {\n\n for(let gp of activity.geneProducts) {\n let metas = await this.annotate(gp.id);\n\n // if no meta retrieved, continue\n if(!metas) { continue; }\n\n // add hyperlink to gene\n gp.url = metas.url;\n \n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
filter all users list with active and deactive | function filterByIsActive(obj) {
if (obj.IsActive == true) {
$scope.ActivatedUserList.push(obj);
return true;
}
else if (obj.IsActive == false && obj.IsRegistered != false) {
$scope.DeactivatedUserList.push(obj);
return ... | [
"async allActiveUsers(){\n return User.find({isActive:true});\n }",
"filterInactive(item){\n return item.active === false;\n }",
"function scanActiveUsers() {\n //console.log(\"Init: scan active users\");\n User.find({ is_active: true }, (err, users) => {\n if (err) console.log(\"Init: ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Called by layer manager to validate props (in development) | validateProps() {
validateProps(this.props);
} | [
"validate(props) {\n throw new Error('Not implemented');\n }",
"validateProps() {\n Object(_lifecycle_props__WEBPACK_IMPORTED_MODULE_4__[\"validateProps\"])(this.props);\n }",
"validateProps() {\n\t\tif (!this.props.nodeInfo) return false;\n\n\t\tif (!this.props.nodeInfo.nodeName) return false;\n\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Asserts the provided array of error messages is empty. If any errors are in the array, logs the errors and exit the process as a failure. | function assertNoErrors(errors) {
var e_1, _a;
if (errors.length == 0) {
return;
}
error("Errors discovered while loading configuration file:");
try {
for (var errors_1 = tslib.__values(errors), errors_1_1 = errors_1.next(); !errors_1_1.done; errors_1_1 = errors_1.next()) {
... | [
"function checkAnyErrors(errArray) {\n\tvar allNull = errArray.every((err) => { return (err === null) });\n\treturn !(allNull); \n}",
"function evaluateErrors(errorArray){\n for(let i = 0; i < errorArray.length; i++) {\n if(errorArray[i] !== '')\n return true;\n }\n }",
"function assertErrorM... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
$Build static map ============================================================ | function buildStatic() {
// https://maps.google.com/maps?q=225+delaware+avenue,+Buffalo,+NY&hl=en&sll=42.746632,-75.770041&sspn=5.977525,8.591309&t=h&hnear=225+Delaware+Ave,+Buffalo,+Erie,+New+York+14202&z=16
// API key console
// https://code.google.com/apis/console
// BfloFRED API Key : key=AIzaSyBMSezbmos0W2n6BQ... | [
"function MapBuilder() {}",
"function expandStaticMaps() {\n\n // Build maps by id and collection\n for (var key in staticsMap.schemas) {\n var staticSchema = staticsMap.schemas[key]\n staticSchema.name = key\n staticsMap.schemaIds[staticSchema.id] = staticSchema // map by schemaId\n staticsMap.col... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
prevent undefined fields from being exposed, to simplify spotting errors | static get autoExposeFields() {
return false;
} | [
"static get autoExposeFields() {\n return false;\n }",
"static stripInvalidAPIFields(fields) {\n return kit_1.omit(fields, ['permsets', 'generatepassword', 'generatePassword', 'profileName']);\n }",
"handleNonPublicFields(data, fields, nonPublicFields) {\n if (fields == null) {\n fie... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
\ Object: MyContent Purpose: container for all helper Objects and functions, leaves less on global scope Members: fibContainer a instantiation of the FibonacciContainer object \ | function MyContent() {
// Contains the fibonacci object
this.fibContainer = new FibonacciContainer();
} | [
"function FibonacciContainer() {\n // Contains all previous function calls(input, output)\n this.fibList = [];\n}",
"function CreateFib(){ \n\treturn {\n\t\t_Fib: [],\n\t\tfind: function(n) { \n\t\t\tfor( var i = this._Fib.length; i <= n; ++i) {\n\t\t\t\tvar f = 0;\n\t\t\t\tif (i<=0){f=0;} \n\t\t\t\telse if (... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Determines if the calculation input is from a text calculation. | function isTextCalculation( inputElement ) {
return jQuery( inputElement ).siblings( "label[for^='calc_type']" ).children( "input" ).prop( "checked" );
} | [
"function isTextCalculation( inputElement ) {\n\t\treturn jQuery( inputElement ).siblings( 'label[for^=\"calc_type\"]' ).children( 'input' ).prop( 'checked' );\n\t}",
"isTextOperation(value) {\n return Operation.isOperation(value) && value.type.endsWith(\"_text\");\n }",
"isTextOperation(value) {\n retur... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
create a submit PDU object with required parameters and options | function Submit(UserNumber, MessageCoding, MessageContent, options) {
if (arguments.length === 0) return; // it is for receiver to parse PDU only
var myOptions = {};
myOptions.__proto__ = defOptions;
if (options) {
if (!(options instanceof Array))
options = [options];
options.forEach(function(opt) {
if (... | [
"function PTPOperationRequest(code, params, dataBufToSend) {\n\n// Packet format is:\n// 1. [32] Length\n// 2. [32] PacketType\n// 3. [32] DataDirection\n// 4. [16] OperationCode\n// 5. [32] TransactionID\n// 6. [32] Parameters\n\n let paramCount = 0;\n if (params !== undefined && params.constructor === Array) {\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns the sql method for a DDL statement | function getDDLMethod(sql) {
if (sql.startsWith('create')) {
return 'create';
}
if (sql.startsWith('alter')) {
return 'alter';
}
if (sql.startsWith('drop')) {
return 'drop';
}
return 'unknown';
} | [
"toSQL() {\n if (this._method === 'alter') {\n extend(this, AlterMethods);\n }\n this._fn.call(this, this);\n return this.client.tableCompiler(this).toSQL();\n }",
"function sql(config = {}) {\n let lang = config.dialect || StandardSQL;\n return new LanguageSupport(lang.language, [schemaCo... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Generates an image for each resolution in breakpoint's array and store the image in the 'genaratedfiles/responsiveimages' folder. | function ResponsiveImages(done){
return responsiveImageBreakpoints.forEach( (breakpoint, index) => {
logger.log(`Generating Responsive Images for: ${breakpoint.device} width: ${breakpoint.width}`);
gulp.src(sourceFiles.responsiveImages)
.pipe( imageResize(breakpoint))
.... | [
"function imageBreakpointSwitch() {\n\t$(\"img.responsive\").each(function() {\n\t\tvar imagepath = $(this).attr('src');\n\t\tvar dummy = imagepath.split(\"/\");\n\t\tvar filename = dummy.pop();\n\t\tdummy = dummy.join(\"/\");\n\t\tvar filename = filename.split(\".\");\n\t\tvar ext = filename.pop();\n\t\tswitch(tru... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
for when we get the captcha challenge from the server | function onCaptchaLoad(data) {
// we should have checks based on what kind of captcha it is:
// if data["captcha"]["type"] == "text" blah blah
// but for now, lets be lazy
document.getElementById("question").innerText = data["captcha"]["display_data"];
window.captchaID = data["id"];
// TODO: sto... | [
"getChallengeResult() {\n return do {\n if (isDefined(window.grecaptcha)) {\n window.grecaptcha.getResponse()\n } else {\n undefined\n }\n }\n }",
"function handleCAPTCHA() \n{\n captchaSolved = true;\n}",
"function getChallenge()\r\n{\r\n\tvar challenge = sendRequest(\"/s... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
END getShareDivWrapper$ START getActionDiv$ | function getActionDiv$(useDefault) {
var postBtn$ = $('<a/>').addClass('oM-ASWidgetPostNewEntry oM-Button-active').text(localizeString("ASWidget-share-postnewentrybtn", "Post")),
clearBtn$ = $('<a/>').addClass('oM-ASWidgetClearNewEntry oM-Button-default').text(localizeString("ASWidget-share-clearnewentrycontentb... | [
"function showActionDiv(action) {\n\tvar moduleElem = document.getElementById('pickmodule');\n\tvar module = moduleElem.options[moduleElem.selectedIndex].value;\n\n\tvar oModPick = document.getElementById('allpick');\n\tvar fieldName=oModPick.options[oModPick.selectedIndex].value;\n\tvar fieldLabel=oModPick.options... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Figure out the widths of each box based on the position of the dragBar. | function setBoxWidths() {
var leftWidth = dragBarPos - 2,
rightWidth = outerWidth - dragBarPos - 12;
left.css('width', '' + toPercent(leftWidth) + '%');
right.css('width', '' + toPercent(rightWidth) + '%');
} | [
"get _width() {\n // The container event's width is determined by the maximum number of\n // events in any of its rows.\n if (this.rows) {\n const columns =\n this.rows.reduce((max, row) => {\n return Math.max(max, row.leaves.length + 1) // add itself\n }, 0) + 1 // add the cont... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Copies the allowlisted CSS grid styles for the element itself. | setOwnCssGridStyles_() {
this.setCssGridStyles_(this.element);
} | [
"setDescendentCssGridStyles_() {\n const elementsToUpgradeStyles = scopedQuerySelectorAll(\n this.element,\n SUPPORTED_CSS_GRID_ATTRIBUTES_SELECTOR\n );\n\n Array.prototype.forEach.call(elementsToUpgradeStyles, (element) => {\n this.setCssGridStyles_(element);\n });\n }",
"function con... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Make sure paths start with protocol and end with '/' | function formatPath(input) {
if (input && input.lastIndexOf('/') !== input.length - 1) {
input = input + '/';
}
if (input && input.substr(0, 2) === '//') {
input = document.location.protocol + input;
}
} | [
"function isValidPathStart(base) {\n if (!/^\\//.test(base)) {\n return false;\n }\n if ((base === '/') ||\n (base.length > 1 && base[1] !== '/' && base[1] !== '\\\\')) {\n return true;\n }\n throw new Error('The path start in the url is invalid.');\n}",
"function isValidPath(p... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Changes image src attribute of the img with id=previewimage | function change_preview(source) {
$('#preview-image').attr("src", source)
} | [
"function changeImage(imageId)\n{\t\n\tvar thumbnailImage = document.getElementById(imageId);\n\tvar previewImage = document.getElementById(\"preview\");\n\t\n\tpreviewImage.src = thumbnailImage.src;\n}",
"function resetPreviewImg(){\n $('#edit-previewing').attr('src', 'img/noimage.png');\n $('#previewing')... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
On clicking the backward button, we have to rewind the song by 30 seconds. | function setProgressBackward() {
isPlaying = "paused"
// Firstly we will set idNextSong to true.
playNextSong = true
// If we hold the backward button for 1 sec, then this function will execute and it will decrease the current time of mediany 30 sec else it will play the next song.
setTimeout(fu... | [
"function backward(){\n music.currentTime -= 10;\n}",
"function backwardSong() {\n if (count >= 1){\n setCount(count - 1)\n }\n else{\n setCount(songs.length-1);\n };\n }",
"function backward(){\n countMusic--;\n if(countMusic < 0){\n countMusic = musicArr.length - 1;... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Fetching from the best server consists of getting the server loads, selecting the server with lowest load, and compose a new request to find the resource in the selected server. | function fetchFromBestServer(request) {
var session = request.url.match(/\?session=([^&]*)/)[1];
return getServerLoads(session)
.then(selectServer)
.then(function(serverUrl) {
// Get the resource path and combine with `serverUrl` to get
// the resource URL but **in the selected server**.
v... | [
"function getMinLoadedRouter(availableRoutes) {\n let minRouter = availableRoutes.pop();\n let totalCPU = minRouter.metrics.reduce(function(a, b) {\n\n return {\n cpu : parseFloat(a.cpu) + parseFloat(b.cpu) + a.loadavg[0] + b.loadavg[0],\n loadavg: [0]\n };\n });\n minRouter.cpu = totalCPU.cpu;\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Create the base service path | function createServiceBasePath(cb) {
var servicePath = [ self.basePath, self.serviceInstance.name ].join('/');
self.client
.getClient()
.mkdirp(servicePath, cb);
} | [
"function createServiceBasePath(cb) {\n self.client\n .getClient()\n .mkdirp(self.path, cb);\n }",
"function createServiceBasePath(callback) {\n var servicePath = [self.basePath, self.serviceInstance.name].join('/');\n\n self.client\n .getZkClient()\n .mkdirp(serv... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
import FeedbackOptions from './components/feedback/feedbackOptions/FeedbackOptions'; import Statistics from './components/feedback/statistics/Statistics'; import Notification from './components/feedback/notification/Notification'; | function App() {
return (
<Container>
<Feedback />
</Container>
);
} | [
"static defineComponents() {\n const componentsList = require.context('../components/', true, /\\.js$/);\n componentsList.keys().forEach((path) => {\n require(`../components/${path.slice(2)}`);\n });\n }",
"function App() {\n return (\n <div className=\"App\">\n {/*<Coun... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Define a function to return "Unknown" if a value is NaN | function checkifNaN (value) {
if (isNaN(value) || value === 'nan') {
return "Unknown"
}
else {
return value
}
} | [
"function noData(value){\n\t\tif(String(value) == \"NaN\"){\n\t\t\treturn \"No data\";\n\t\t} else {\n\t\t\treturn value\n\t\t};\n\t}",
"function handleNaN(val, defaultVal) {\r\n return isNaN(val) || val == 0 ? defaultVal : val;\r\n}",
"function whatIfNotNaN(value) {\n return (value !== value) ? '=NaN' :\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
this empty function overrides the super function, we track when the form has changed more explicitly, per form tab, in this class | formChanged() {} | [
"function formChanged() {\r\n\tdisableWidget('newButton');\r\n\tenableWidget('saveButton');\r\n\tdisableWidget('printButton');\r\n\tdisableWidget('copyButton');\r\n\tenableWidget('undoButton');\r\n\tdisableWidget('deleteButton');\r\n\tdisableWidget('refreshButton');\r\n\tformChangeInProgress=true;\r\n\tgrid=dijit.b... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
ref fields added to _title and _color so we are able to reference in the AddColorForm component above | render() {
return (
<form onSubmit={this.submit}>
<input ref="_title" //ref field so we can reference it with this._title
type="text" placeholder="color title... " required/>
<input ref="color" // ref field allowing us to reference it with this._color
type="color" required/... | [
"function setupColorElement() {\n L.StyleEditor.formElements.ColorElement = L.StyleEditor.formElements.FormElement.extend({\n createContent: function createContent() {\n this.options.colorPickerDiv = L.DomUtil.create('div', 'leaflet-styleeditor-colorpicker', this.options.uiElement);\n\n this._getColor... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Return a modified state object used for synching. Other datasets might have different chromosome ordering and resolution arrays | getSyncState() {
return {
chr1Name: this.dataset.chromosomes[this.state.chr1].name,
chr2Name: this.dataset.chromosomes[this.state.chr2].name,
binSize: this.dataset.bpResolutions[this.state.zoom],
binX: this.state.x, // TODO -- tranlsate to lower right c... | [
"toStateObject() {\n const parentStateObject = PropertyIOImpl.toStateObject(this);\n parentStateObject.numberType = this.numberType;\n parentStateObject.range = js_Range.RangeIO.toStateObject(this.rangeProperty.value);\n const hasRangePhetioID = this.rangeProperty && this.rangeProperty.isPhetioInstrumen... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Method to reset the mineMap and other data every time user clicks 'generate' button i.e., when user plays a new game. | function clearData() {
document.getElementById('mineSweeper').innerHTML = '';
mineMap = {};
flagMap = {};
handleMessage('', 'hide');
gameOver = false;
} | [
"function resetMap() {\n heatmapLayer._data.clear(); // remove all data from storage\n heatmapLayer._max = 32;\n heatmapLayer._min = 0;\n heatmapLayer._draw();\n hideModal('resetModal');\n }",
"function resetMap(){\n\t// Reset all variables and arrays\n\ttmpCoordinates = [];\n\tmarkersArray = [];\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Builds an array of segments "levels". The first level will be the leftmost tier of segments if the calendar is lefttoright, or the rightmost if the calendar is righttoleft. Assumes the segments are already ordered by date. | function buildSlotSegLevels(segs) {
var levels = [];
var i, seg;
var j;
for (i=0; i<segs.length; i++) {
seg = segs[i];
// go through all the levels and stop on the first level where there are no collisions
for (j=0; j<levels.length; j++) {
if (!computeSlotSegCollisions(seg, levels[j]).length) {
... | [
"function buildSlotSegLevels(segs) {\n var levels = [];\n var i;\n var seg;\n var j;\n\n for (i = 0; i < segs.length; i++) {\n seg = segs[i]; // go through all the levels and stop on the first level where there are no collisions\n\n for (j = 0; j < levels.length;... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
inserting to stock db | function dbStockInsert(Pinumber, Pname, Pprice)
{
var db = dbGetHandle()
var rowid = 0;
db.transaction(function (tx) {
tx.executeSql('INSERT INTO stock_DB VALUES(?, ?, ?)',
[Pinumber, Pname, Pprice])
var result = tx.executeSql('SELECT last_insert_rowid()')
rowid... | [
"addStockToDb(stock, ip) {\n if (!stock) return { error: 'Need Stock' };\n\n const newStock = new stockData({\n stock: stock.toUpperCase(),\n likes: 1,\n ipLikes: [ip],\n });\n\n return newStock\n .save()\n .then(stock => {\n return stock;\n })\n .catch(error =>... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Player objects function to get the index of the array which has the attribute passed in | function getIndex(array, attr, value) {
for (var i = 0; i < array.length; i++) {
if (array[i].hasOwnProperty(attr) && array[i][attr] === value) {
return i;
}
}
return -1;
} | [
"getPlayerIndex(playerId){\n for(var index=0; index<this.players.length; index++){\n if(this.players[index].playerId == playerId){\n return index;\n }\n }\n }",
"getPlayerIndex( player ){\n\n\t\tfor( let i in this.players ){\n\n\t\t\tif( this.players[i] === pl... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
void _Attribute.GetIDsOfNames([ref] guid riid, System.IntPtr rgszNames, uint3... | GetIDsOfNames() {
} | [
"getIds () {\n\t\treturn keys( this.names ).map( name => this.lookup( name ) );\n\t}",
"function getIdentifiers(src) {\n var names = {};\n // define callback for identifiers (to add to set)\n var options = {loc: false,\n builder: {identifier: function (name) {names[name] = true;}}}\n\n Re... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
AIPlayerScript.getDestroyCard This finds the first destroy card the AI player has in their hand | function getDestroyCard():int {
var cardInfo:GameAction;
for (var i:int=0; i < 3; i++) {
cardInfo = GameStateScript.getAIAction(i);
if (cardInfo != null && cardInfo.action == ActionType.Destroy) {
return i;
}
}
return -1;
} | [
"removeCard(card) {\n var index = this.hand.indexOf(card);\n return this.hand.splice(index,1)[0];\n }",
"dealCard() {\n if (!this.hasCards()) {\n return null\n }\n\n return this.cards.shift()\n }",
"giveCard(reqCard) {\n let cardFound = this.hand.find(card => card.va... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
var reportId = 0; angularjs controller method | function reportController($scope, $http, $location) {
var pathName = $location.path();
var empId = pathName.toString().split("/")[3];
var reportId = 0;
//declare variable for maintain ajax load and entry or edit mode
$scope.loading = true;
$scope.addMode = false;
... | [
"selectReport(report) {\n this.$scope.reportHash = report;\n this.setMode('report');\n }",
"function getReportDetails(reportId){\n $scope.data.loading = true;\n reportServices.getAllReportsFromIndexDb()\n .then(function(reports){\n reports.forEach(function(report){\n if... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
NOTE, due to the use of async/await, this file is not intended to be imported by the frontend TODO investigate escaping queries before sending to the discovery service This wrapper sets the discover service up and connects to the proper discovery environment and collection before making a query. All the params are pass... | function makeQuery(params) {
const discovery = new DiscoveryV1({
version: '2017-08-01'
})
// Using a Promise to allow the use of async/await in other code, this allows calls without callback hell which is important in
// finding the correct collection, it requires both the environment and a discovery insta... | [
"function makeQuery(params) {\n const credentials = getCredentials('discovery')\n\n const discovery = new DiscoveryV1({\n username: credentials.username,\n password: credentials.password,\n version_date: '2016-11-07'\n })\n\n // Using a Promise to allow the use of async/await in other code, this allows... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
===================================// get the last textarea and add retrieved JSON data. then select the textarea and copy to Clipboard | function copyToClipboard() {
const txtAreaCopy = document.querySelector("#txtarea-clipboard");
txtAreaCopy.innerHTML = mJiraFullString; //JSON.stringify(dict);
txtAreaCopy.select();
document.execCommand("copy");
} | [
"function copyJSON(tArea){\n var copyText = tArea;\n\n copyText.select();\n\n document.execCommand(\"copy\");\n\n if(copyText.value != \" \"){\n showToast(\"Saved to Clipboard\", \"G\");\n }\n else{\n showToast(\"Please ensure you have loaded an object.\", \"R\");\n }\n try{\n document.getSelection... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
The one and only jStat constructor. | function jStat()
{
return new jStat._init(arguments);
} | [
"function jStat() {\n\t return new jStat._init(arguments);\n\t}",
"function jStat() {\n return new jStat._init(arguments);\n}",
"function jstat(){}",
"constructor (rawStats) {\n // type, birthtime, mtime, mode, size, nlink\n super(\n Stats.detectType(rawStats),\n rawStats... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
add a TraceViewer object for easy creation of plots this is incredibly specific to our layout, though. | function TraceViewer(trace_url, button, full_trace, version) {
if ( ! button && trace_url ) {
console.log("Please provide a trace button and trace URL");
return;
}
this._pos = 250;
this._read = 'A';
this._initPos = 250;
this._ref = [];
this._locHash = new Object();
this.... | [
"function addTrace() { // eslint-disable-line no-unused-vars\n Plotly.relayout(lineChartOne, layout);\n Plotly.addTraces(lineChartOne, [\n {\n x: [xpos],\n y: [chartData1[1]],\n type: 'scatter',\n mode: 'lines',\n line: { color: 'blue' },\n },\n ]);\n }",
"fu... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
If the customer/project is marked export to OA, automatically set the export to OA flag as export | function setExportToOpenAirSupportCaseClient (type, name)
{
if (name == 'company')
{
// get the company
var cust_proj = nlapiGetFieldValue('company');
// look it up
if (cust_proj > 0)
{
var exportToOA = isTrueAsString(nlapiLookupField('job', cust_proj, 'custentity_oa_export_to_openair'));
nlapi... | [
"function canExport() {\n\t\t\treturn self.budget.order_company_id && self.budget.order_status_id == self.internal.orderStatusValues.open;\n\t\t}",
"function setExportToOpenAirOnNew()\n{\n\tvar nlobjContext = nlapiGetContext();\n\tvar recType = nlapiGetNewRecord().getRecordType();\n\n\tvar script_fld_id = 'custsc... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This function runs the game; it is called many times per second by the requestAnimationFrame method. The 'timestamp' parameter that is passed to this function is provided by the requestAnimationFrame method. | function gameLoop(timestamp) {
// Tracking the amount of time that has passed
let deltaTime = timestamp - lastTime;
lastTime = timestamp;
// Clear canvas, update, and draw
ctx.clearRect(0, 0, GAME_WIDTH, GAME_HEIGHT);
game.update(deltaTime);
game.draw(ctx);
// Show latest updates per ... | [
"loop() {\n //call update\n gameNs.game.update();\n //call the draw function\n gameNs.game.draw();\n //call itself\n window.requestAnimationFrame(gameNs.game.loop);\n }",
"function runGame(){\n requestAnimationFrame(drawComponents);\n}",
"loop(){\n\t\tif (this.running) {\n\t\t\tlet tick = ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Display string for the recurrence value of the booking | get recurrence() {
return 'No Recurrence';
} | [
"function displayBusTimes(busScheduleObj, busLine) {\n // TODO: your code here\n return (\n \"The bus will arrive in the next [\" + busScheduleObj[busLine] + \"] minutes.\"\n );\n}",
"function displayBusTimes(busScheduleObj, busLine) {\n\t// TODO: your code here\n return (\n \"The bus will arrive in th... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Function used to display a different price search parameter depending on the param entered in the search form | function priceParam () {
if (flightSearchParams[5] === 1000 || flightSearchParams[5] === '1000') { return 'Up to ₹1000 per person' }
else if (flightSearchParams[5] === '800') { return 'Up to ₹800 per person' }
else if (flightSearchParams[5] === '600') { return 'Up to ₹600 per person' }
e... | [
"function search () {\n\n var params = {\n name: getProductName(),\n category_id: getSelectedCategoryId(),\n min_price: getMinPrice(),\n max_price: getMaxPrice()\n }\n\n params = $.extend({}, params);\n\n var url = getUrl();\n //var quer... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
check the context of the selected CS. Add only if it is in the write context list | function checkContextCS_AC(selCS)
{
if (selCS != null && selCS != "")
{
if (writeContArray != null && writeContArray.length > 0)
{
for (var idx=0; idx<writeContArray.length; idx++)
{
var sContext = writeContArray[idx][0];
if (sContext != ... | [
"function writeContext() {\n if (envelope.contextId !== undefined) {\n envelope.contextId.copy(buffer, POSITION.CONTEXT);\n position = POSITION.CONTEXT + SIZE.CONTEXT;\n\n // Note: We can only write a subSource if we have a context. Although, the setters shoul... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
allows for the circle to move up | function moveCircleUp (){
ypos = ypos - 30;
} | [
"moveUp() {\n if (this.y > 12) {\n this.y -= 8;\n }\n }",
"function moveUp(){\n\t\t\tvar y =+ player.cy\n\t\t}",
"moveUp(){\n target = ypos - 100;\n }",
"function moveCircleDown (){\n\nypos = ypos + 30;\n\n}",
"moveUp() {\n this.shiftY = -8;\n this.moving = Move... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
registers all move listeners | onMove(callback) {
this.listenToMove.push(callback);
} | [
"function registerMoveListeners() {\n selected = null;\n turn = 'w';\n isInCheck = false;\n checkmate = false;\n\n const squares = getAllSpaces();\n squares.forEach( x => {\n x.addEventListener('click', (event) => spaceListener(x));\n });\n}",
"moveAllListeners(other) {\n\n }",
"_... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Changes all samples to sustain mode | function sustainMode(){
for(var i = 0; i < samples.length; i++){
samples[i].playMode('sustain');
}
} | [
"changeData() {\n this.avgAmplitudeStore = 0;\n let netAmplitude = 0;\n const sampleNumber = sampleRate / frameRate;\n for (let i = 0; i < sampleNumber; i++) {\n //first value is detail of noise (how many layers of random numbers to interpolate between)\n // second value determines how equally... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns the index of a marker in the path list | function pathPointIndex(marker) {
if(typeof pathPoints == 'undefined' || pathPoints.length < 1)
return -1;
var cur = 0;
while(cur < pathPoints.length) {
var curMarker = pathPoints[cur];
if(marker.timestamp == curMarker.timestamp && marker.nodeId == curMarker.nodeId) {
return cur;
}
cur++;
}
return... | [
"function findMarkerIndex(point_marker) {\n var index = -1;\n\n for (var i = 0; i < point_markers.length; ++i) {\n if (point_markers[i] == point_marker) {\n index = i;\n break;\n }\n }\n\n return index;\n}",
"function findMarkerIndex(point_marker) {\n var index = ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Execute import of new layer | importLayer(request, response) {
logger.info('LayerImporterController#importLayer');
this.getImportInputs(request).then(inputs => {
this._layerImporter.importLayer(inputs);
response.send(this._layerImporter.getCurrentImporterTask());
}).catch(error => {
response.send({
message: error.message,
su... | [
"function import_asset(src_path, tmpl_path, layer_name)\n{\n \n var cur_doc = setup_doc(tmpl_path)\n\n timeline = cur_doc.getTimeline()\n\n var common = new Common()\n idx = common.create_layer(layer_name, timeline, true)\n\n //if (timeline.frameCount < 1)\n // timeline.insertFrames()\n tim... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
document ready; avatar obj | function getAvatarData(){
var bgSource = $('.modal.active .js-img-holder').css('background-image').replace('url(','').replace(')','').replace(/\"/gi, ""),
signatureCheckbox = $('.modal.active .js-signature__checkbox').prop('checked'),
signatureText = $('.modal.active .form-block__input').val(),
data... | [
"get avatar() {}",
"function setupAvatar() {\n \t// If the element already exists, stop the Function.\n \tif (document.getElementsByClassName('titlebar-avatar').length) {\n \t\treturn;\n \t}\n\n \t// Fetch the current system user.\n \tvar user = require('process').env.USER;\n\n \t// Fetch the avatar in a b... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Insert traverses the tree and adds a new node in the correct location | insert(value) {
this.count++;
let newNode = new Node(value)
const searchTree = (node) => {
// if value < node.value, go left
if (value < node.value) {
// if no left child, append new node
if (!node.left) {
node.left = newNode;
// if left child, look left agai... | [
"function InsertNode() {}",
"insert(data) {\r\n var newNode = new Node(data); \r\n\r\n if(!this.root){\r\n this.root = newNode; \r\n } \r\n else{\r\n this.insertNode(this.root, newNode); \r\n } \r\n \r\n}",
"insert(node) {\n if (node.low <= this.low) {\n if (this.left ==... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
perform export of password registrations | exportPasswordRegistrations() {} | [
"importPasswordRegistrations() {}",
"exportWallet(password) {\n console.log('exportWallet', this.wallet, password);\n }",
"exportAccounts() {\n let secret = this.state.secret;\n \n Helper.download(\n this.state.accounts\n .filter((acc) => acc.selected)\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Add new expense record. | addExpenseRecord() {
let sheetInfo = this.getExpensesSheetInfo();
let sheet = sheetInfo.getSheet();
let srcRowNum = sheetInfo.sampleDataRow;
let destRowNum = sheetInfo.firstDataRow;
sheet.insertRowBefore(destRowNum);
let firstColumn = sheetInfo.getFirstConfigurableColum... | [
"addExpense(expense) {}",
"function addExpense(){\n console.log(\"Deducting: $\", main.deduction, main.expenseNote);\n\n var deduction = {\n note: main.expenseNote,\n total: main.deduction\n };\n\n $http\n .post('/expenses', deduction)\n .then(function(response){\n var credi... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
generate field with hat and holes | static generateField(height, width, holes) {
let newField = [];
for (let i = 0; i < height; i++) {
newField.push([]);
for (let j = 0; j < height; j++) {
newField[i].push(fieldCharacter)
};
};
newField[0][0] = pathCharacter;
let hatX = Math.floor(Math.random() * width);
... | [
"static generateField(width, height, holes) {\n let newField = [];\n for (let i = 0; i < width; i++) {\n newField.push([]);\n for (let j = 0; j < height; j++) {\n newField[i].push(fieldCharacter)\n };\n };\n //5.2 return a randomized two-di... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Expects: void Returns: Close trasano user modal and load index.html | function closeTrasanoUserModal() {
$('#trasanoUserMODAL').modal('hide');
window.location = "../index.html";
} | [
"function closeUserEditor() {\n $('#userModal').modal(\"hide\");\n}",
"function showModalFor(userIndex) {\n body.appendChild(modalList[userIndex]);\n addModalNavButtons(modalList[userIndex],userIndex);\n for (let i = 0; i < modalList.length; i++) {\n if (i !== userIndex && modalList[i].parentNo... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Analyze the splice composition of a gene Intron Retentions associate each exon with whether it is an intron retention Exon skipping associate each exon with whether or not it can be skipped relative to any overlapped exon Alternate 5' start associate each exon with whether or not its an alternative 5' start Exon: relat... | constructor (gene,options) {
if (! options) options = {};
this._gene = gene;
this._classified_exons = undefined; // this is cached when called with getter
// make a catalog of exons
this._unique_exons = this._gene.unique_exons.entries.map(function(x) {
return {exon:x.copy(),transcripts:[]};
... | [
"function get_exome_position(){\n \n for(i = 0; i < queried_gene_object.variant_objects.length; i++){\n \n var gaps = 0;\n for(j = 0; j < numberOfExons; j++){\n \n if(j == 0){ // First exon\n \n if((exonStarts[j] <= queried_gene_object.v... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
FUNCTION changediv RETURN VALUE This function does not return parameters PARAMETERS toDiv The div to show MEANING The function will hidde al divs and open the the div name received the parameter | function changediv(toDiv)
{
// in case the data is unvalid stop
if(undefined == toDiv || 0 == toDiv.length)
return;
toDiv = '#' + toDiv;
// In case the div doesn't exist stop
if(undefined == $(toDiv) || 0 == ($(toDiv)).length)
return;
// Every div in the conteiner will be hide
$('#contenedor').children().ea... | [
"function mostrarDiv(idmuestra,idoculta){\n\tvar ident=\"#\"+idmuestra;\n\tvar identOculta=\"#\"+idoculta;\n\t$(identOculta).hide();\n\t$(ident).show();\r\n}",
"function cmShowDiv(strDivName)\r\n {\r\n document.getElementById('div_'+strDivName).style.visibility = 'visible';\r\n }",
"function documentDi... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
AdminService est la fabrique des services | function AdminFontion(AdminService) {
var vm = this;
vm.loadAll = loadAll;
loadAll();
function loadAll() {//Fontion qui affiche la liste des admins
AdminService.query(null, onSuccess, onError);
function onSuccess(data, headers) {
vm.admins = da... | [
"function AdminSubnavService() {\n\t}",
"initAdmin() {\n logger.log('initAdmin');\n\n // Status.\n this._app.get('/status', (req, res) => {\n res.setHeader('Content-Type', 'application/json');\n res.send(JSON.stringify({\n env: __ENV__,\n version: META.APP_VERSION\n }, null, ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Given an event, returns another event which debounces calls and defers the listeners to a later task via a shared `setTimeout`. The event is converted into a signal (`Event`) to avoid additional object creation as a result of merging events and to try prevent race conditions that could arise when using related deferred... | function defer(event, disposable) {
return debounce(event, () => void 0, 0, undefined, true, undefined, disposable);
} | [
"function debounceEvent(event, handler) {\n /* default parameters */\n timeout = typeof timeout !== 'undefined' ? timeout : 500;\n call_on = typeof call_on !== 'undefined' ? call_on : true\n call_after = typeof call_after !== 'undefined' ? call_after : false;\n\n function fireOnce() {\n if (call_on)\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Misc. routines. log(x): display a thing in the console (Firefox only, maybe) | function log(x)
{
if (typeof(window.console) !== 'undefined') {
window.console.log(x);
}
} | [
"function log() {}",
"function logging() {}",
"function console_log() {\n Platform.Response.Write('<scr' + 'ipt>');\n Platform.Response.Write('console.log.apply(null,' + Platform.Function.Stringify(Array.from(arguments)) + ')');\n Platform.Response.Write('</scr' + 'ipt>'); \n }",
"func... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
mkTableRow() get data from firebase and update info on settraininfo | function mkTableRow(firebaseObj) {
// console.dir(firebaseObj);
// Get Parrent table body (Parent)
let _tableBody = document.querySelector("#set-train-info");
// Create the table row element
let _tableRow = document.createElement("tr");
// get next train time and minutes away
let timesObj = ... | [
"function getTrain(){\n let trainId = $(this).attr('data-id');\n var ref = db.ref(trainId);\n ref.once('value').then(function(snapshot) {\n fields.map(function(field) {\n $('#' + field).val(snapshot.val()[field]);\n });\n trainIdEl.val(trainId);\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Decodes the given DataView (starting at optional byte offset) according to this PrimitiveType definition | decode (view, offset=0) {
return this._decode && inBounds(view, this._nbytes, offset) ?
this._decode(view, offset) : null
} | [
"fromDataView(dataView, offset) {\n let vt = dataView.getUint16(offset, true);\n let length = 2; // value type 2 bytes\n offset += 2;\n\n // 4bytes alignments\n switch (vt) {\n case VT_I4:\n case VT_R4:\n case VT_R8:\n case VT_UI4:\n case VT_I8:\n case VT_UI8:\n cas... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Apply uploader plugin to all inputs | function applyPluginOnInputs(inputs) {
inputs.each(function () {
// for each input in the form
var self = $(this);
self.data(PLUGIN_UPLOADER, new AutoUploader(self));
})
} | [
"function initGalleryUpload() {\n $('.fileinput').fileinput();\n }",
"function fileInput() {\n\t$('.upload-file').each(function () {\n\t\t$(this).filer({\n\t\t\tshowThumbs: true,\n\t\t\taddMore: true,\n\t\t\tallowDuplicates: false,\n\t\t\tlimit: 1\n\t\t});\n\t});\n}",
"function load_formstone_upload_p... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
define a function called 'fetchData()' that passes the values from // the 'queryType' and 'itemID' elements in starwars.html to the function // called 'getFromSWAPI()' | function fetchData() {
queryType=document.querySelector('#queryType').value;
itemID=document.querySelector('#itemID').value;
getFromSWAPI(queryType, itemID)
} | [
"function getFromSWAPI() {\r\n // assign values to any necessary variables\r\n fetch(`https://swapi.dev/api/${queryType}/${itemID}`)\r\n .then(function (response) {\r\n return response.json()\r\n })\r\n .then(function(data){\r\n updateInfo(data)\r\n })\r\n .catch(function(err) {\r... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
config/: TBTCConfig/; depositFactory/: DepositFactory/; | static async withConfig(config = defaultConfig/*: TBTCConfig*/, networkMatchCheck = true) {
const depositFactory = await DepositFactory.withConfig(config)
return new TBTC(depositFactory, config, networkMatchCheck)
} | [
"function OktaConfigurationStrategy() {\n\n}",
"function TransactionFactory() {\n }",
"function TransactionService() {\n\n}",
"function AccountFactory(){}",
"function depositTx (state, tx, context) {\n // get specified block header from state\n // TODO: make this into a static blockchain-spv functi... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
When the user clicks on the button, toggle between hiding and showing the Contact dropdown content | function ContactFunction() {
document.getElementById("Contact_myDropdown").classList.toggle("show");
} | [
"toggle() {\n !this.isDropdownShowing ? this.show() : this.hide();\n }",
"function dropdown(){\r\n\t\t\tdocument.getElementById(\"dropdownContent\").classList.toggle(\"show\");\r\n\t\t}",
"function toggleDropdown() {\n dropdownIsHidden ? showDropdown() : hideDropdown();\n }",
"function toggleAddCo... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Create a function that has one parameter: resolveAfter. Calling this function will return a promise that resolves after the resolveAfter seconds has passed. | function resolveFunction(resolveAfter) {
return new Promise((resolve) => {
setTimeout(() => resolve(), resolveAfter * 1000);
});
} | [
"function afterSetTime(resolveAfter){\n return new Promise((resolve) => {\n setTimeout(() => {\n \n resolve('I am called asynchronously after ' + resolveAfter + ' seconds');\n }, resolveAfter*1000);\n });\n}",
"function after(delay, a) {\n return inj(function () {\n r... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
obtain drm ticket from xstream | function getTicket(streamId, sessionToken, request, callback) {
// prepare request body for ticket request
var reqParams = {
drmType: 'widevine_modular',
licenseType: 'non-persistent',
streamId: streamId,
};
// prepare headers for ticket request
var reqHeaders = {
'Content-Ty... | [
"function getOtdsSsoTicket() {\n var auth = new Appworks.Auth(\n function(data) { },\n function(error){ }\n );\n\n auth.otdsssoticket(function(ticket) {\n out(\"OTDS Ticket: \" +ticket);\n }, function(error) {\n out(\"Error: \" + error);\n });\n}",
"function getQlikSenseTicket( directory, user ) ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Function to unlock the hidden tunnel behind the clock after player interacts with it correctly | function clockUnlock() {
document.getElementById(`location`).style.display = `block`;
document.getElementById(`description`).style.display = `block`;
document.getElementById(`buttonarea`).style.display = `none`;
document.getElementById(`userinput`).style.display = `inline-block`;
document.getEl... | [
"function UnLockControls(){\r\n UnlockStay();\r\n UnlockHit();\r\n \r\n}",
"function attemptUnlock() {\n\t// cursors\n\tif (points.total > 14) {\n\t\tvisible(\"cursors\", true, \"block\")\n\t\taction();\n\t}\n\t// vault\n\tif (points.total > 49 && clickPoints.total > 0) {\n\t\tvisible(\"vault\", true, \"... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Memoize the Uint8Array representation of name We need this to sort the links, otherwise we will reallocate new Uint8Arrays every time | get nameAsBuffer () {
if (this._nameBuf != null) {
return this._nameBuf
}
this._nameBuf = uint8ArrayFromString(this.Name)
return this._nameBuf
} | [
"get nameAsBuffer () {\n if (this._nameBuf !== null) {\n return this._nameBuf\n }\n\n this._nameBuf = uint8ArrayFromString(this.Name)\n return this._nameBuf\n }",
"get nameAsBuffer () {\n if (this._nameBuf !== null) {\n return this._nameBuf\n }\n\n this._nameBuf = Buffer.from(this.... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
k: string, key to retrieve from | get(k) {
return this.kvStore[k];
} | [
"function get_(key){\n\t\tfor(var i = 0; i < keyValueMap.length; i++){\n\t\t\tif(keyValueMap[i].k == key){\n\t\t\t\treturn keyValueMap[i].v;\n\t\t\t}\n\t\t}\n\t}",
"get(key) {\n //first get the hash\n let index = this._hash(key)\n // then retrieve the array of key/val pairs at that index/hash... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
windowLoad() only called once at the very beginning of the game to initialise karel's position and its scenery | function windowLoad() {
draw(startX, startY, startDirection);
karel[startX][startY] = true;
// checkWallAround(startX, startY);
// checkBeepersPresent(startX, startY);
// loadDatabase();
} | [
"function initializeGame() {\n initializeCanvas();\n\n levelManager = new LevelManager(theCanvas, levelStartSound, levelEndSound);\n\n initializeLevel();\n setStatus(levelManager, player);\n\n levelManager.showStartScreen(); // Schrift über Blumen :)\n }... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This function parses the content of a fls attached to the given base tex file. All input files are considered as included subfiles/nontex files, and all output files will be check if there are aux files related. If so, the aux files are parsed for any possible bib file. | parseFlsFile(baseFile) {
this.extension.logger.addLogMessage('Parse fls file.');
const rootDir = path.dirname(baseFile);
const outDir = this.getOutDir(baseFile);
const flsFile = path.resolve(rootDir, path.join(outDir, path.basename(baseFile, '.tex') + '.fls'));
if (!fs.exist... | [
"parseFileAndSubs(file, onChange = false) {\r\n if (this.isExcluded(file)) {\r\n this.extension.logger.addLogMessage(`Ignoring ${file}`);\r\n return;\r\n }\r\n this.extension.logger.addLogMessage(`Parsing ${file}`);\r\n if (this.fileWatcher && !this.filesWatched.inc... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Append that element to the DOM | appendCeleb(element) {
element.append(this.createElement())
} | [
"append(node) {\n this.element.appendChild(node);\n }",
"function append(el) {\n this.owner.el.appendChild(el);\n}",
"function append(elem) {\n if (elem.render)\n body.append(elem.render());\n else\n body.append(elem);\n }",
"appendElements() {\n this.appendChild(this.... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Stops sending updates to the remote peer and resets internal state of peers seen. Adds a peer to the locally discovered peer list for the next Live message. | addPeer (peer) {
if (peer.indexOf(':') < 0) return // disregard invalid peers
if (peer in this._remoteAddedPeers) return // never advertise peer the remote wire already sent us
if (peer in this._localDroppedPeers) delete this._localDroppedPeers[peer]
this._localAddedPeers[peer] = true
} | [
"function peersKeepAlive()\n {\n let json = JSON.stringify(\n {\n from: username,\n msg: \"\",\n keepalive: \"ping\"\n }\n );\n\n let todelete = [];\n \n activeusers.forEach(\n (peer, peername) =>\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Load section and append to req. | function load(req, res, next, id) {
Section.get(id).then((section) => {
// !!! This is used by auth.authorize this MUST be set for any resource
req.venueId = section.venue_id; // eslint-disable-line no-param-reassign
req.section = section; // eslint-disable-line no-param-reassign
return next();
}).e... | [
"function loadSection(section){\n\t \t var url = \"/Get_Started/\"+Utils.replaceSpaceToUnderScore(usertype);\n\t \t if(edition != \"\")\n\t \t \turl += \"/\"+Utils.replaceSpaceToUnderScore(edition);\n\t \t url += \"/\"+section;\n\t $( \".tab-content\" ).load( url + \" .content-body\", function() {\n\t ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Determine whether the given properties match those of a `TrustedSignersProperty` | function CfnStreamingDistribution_TrustedSignersPropertyValidator(properties) {
if (!cdk.canInspect(properties)) {
return cdk.VALIDATION_SUCCESS;
}
const errors = new cdk.ValidationResults();
errors.collect(cdk.propertyValidator('awsAccountNumbers', cdk.listValidator(cdk.validateString))(propert... | [
"function CfnApi_MutualTlsAuthenticationPropertyValidator(properties) {\n if (!cdk.canInspect(properties)) {\n return cdk.VALIDATION_SUCCESS;\n }\n const errors = new cdk.ValidationResults();\n if (typeof properties !== 'object') {\n errors.collect(new cdk.ValidationResult('Expected an obj... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Command 2 The confirmation function encodes the JSON data to a 2 bytes array downlink messsage that enable/disable confirmation. | function confirmation(data) {
if (typeof data.confirmation !== 'boolean') {
return {
errors: ["Missing required field or invalid input: confirmation"],
};
}
if (data.confirmation) {
return [0x07, 0x01];
} else {
return [0x07, 0x00];
}
} | [
"onConfirmation(blk, tx, confnum, app) {}",
"function DeleteConfirmation2() {\n\tif (window.confirm('You are deleting the record. Click OK to continue. Click Cancel to stop.'))\n\t\treturn submitXForm('Delete');\n\telse\n\t\treturn false;\n}",
"function ModConfirmResponse(response) {\n //console.log(\" -... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
turn the text content of the directory into entry objects | _parseEntries() {
this.entries = [];
let entryStrs = this.content.split("\n");
this.entries = entryStrs.filter(str => str !== "").map(line => {
let fields = line.split("/");
return new entry(fields[0], fields[1], fields[2]);
... | [
"function DirectoryEntry () {\n this.children = {};\n this.buffer = new Buffer(0);\n this.sha = \"\";\n}",
"function loadDirEntry(_chosenEntry) {\n chosenEntry = _chosenEntry;\n if (chosenEntry.isDirectory) {\n var dirReader = chosenEntry.createReader();\n var entries = [];\n\n // Call the reader.re... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
reads up to delimeter | function readUpTo(del){
if(!del) del = ' ';
var temp = "";
while(line[index] != del) temp += line[index++];
index++; // skip del
return temp;
} | [
"function delimitedRead(stream, delimiter, count) {\n dumpv(\"Starting delimited read for \" + delimiter + \" up to \" +\n count + \" bytes\");\n\n let scriptableStream;\n if (stream.readBytes) {\n scriptableStream = stream;\n } else {\n scriptableStream = new ScriptableInputStream(stream);\n }\n\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Given a field or enum value node, returns the string value for the deprecation reason. | function getDeprecationReason(node) {
const deprecated = getDirectiveValues(GraphQLDeprecatedDirective, node);
return deprecated?.reason;
} | [
"function getDeprecationReason(node) {\n var deprecated = getDirectiveValues(GraphQLDeprecatedDirective, node);\n return deprecated && deprecated.reason;\n }",
"function getDeprecationReason(node) {\n var deprecated = Object(_execution_values__WEBPACK_IMPORTED_MODULE_12__[/* getDirectiveValues */ \"... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Insert to volunteer role | function insertVol(id, preference){
db.transaction(tx => {
tx.executeSql(
'INSERT INTO volunteer_role_t (person_id, preference) VALUES (?,?)',
[id, preference],
(tx, results) => {
console.log('Results', results.rowsAffected);
if (results.rowsAffected > 0) {
} else {
... | [
"addVolunteerToEvent(\n user_id: number,\n event_id: number,\n volunteer_type_id: number,\n callback: (status: string, data: Event) => mixed,\n ) {\n super.query(\n 'INSERT INTO `event_volunteer` (event_id, user_id, volunteer_type_id) VALUES (?, ?, ?)',\n [event_id, user_id, volunteer_type... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
getByUserId handles getting a list of upvotes for a specific user. | getByUserId(id) {
return new Promise((resolve, reject) => {
// Query the database.
// Get from the database.
this.db.query(getByUserIdQuery, [ id ], (err, res) => {
if (err)
return reject(err);
// Create a new set of upvotes.
let upvotes = [];
// Loop through the results.
res.forEa... | [
"getByUserIdAndSongId(userId, songId) {\n\t\treturn new Promise((resolve, reject) => {\n\t\t\t// Query the database.\n\t\t\t// Get from the database.\n\t\t\tthis.db.query(getByUserIdAndSongIdQuery, [ userId, songId ], (err, res) => {\n\t\t\t\tif (err)\n\t\t\t\t\treturn reject(err);\n\n\t\t\t\t// If no upvote was fo... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns true if the kind of event provided is a valid one | function isValidEventKind(evtKind) {
return (typeof Kinds[evtKind] !== 'undefined');
} | [
"function validEvent(eventKeys, typeKeys, emitter, typeName) {\n\n if (eventKeys.length > typeKeys.length) {\n emitter.emit('error', 'An event has more properties than its type, ' + typeName +\n '. Event properties: [' + eventKeys + ']. ' + typeName + ' properties: [' + typeKeys + '].');\n retur... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
takes in one of the constant [genre]Val strings defined above gets the recommended tracks based on the user set inputs, returns a promise mutates the variable "tracks" | function getTracks(genre){
if(!uId) return;
let genreString = 'seed_genres=' + genre;
let paramString = getOSqueryString();
return fetch('https://api.spotify.com/v1/recommendations' + '?' + genreString + '&' + paramString, {
headers: {
Authorization: 'Bearer ' + accessToken
}
})
.then(res... | [
"getTracksMatchingGenres(genres) {\n let tracks = [];\n this.getAllAlbums().forEach( album => {\n const tracksByGenere = album.getTracksByGenres(genres);\n tracks = tracks.concat(tracksByGenere);\n });\n return tracks;\n }",
"getTracks() {\n let results = [];\n\n if (!this.currentArti... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Is the input modal visible? | function inputModalIsVisible(state = false) {
return state;
} | [
"function isPrompterVisible() {\r\n\treturn $('#prompter').is(\":visible\")?true:false;\r\n}",
"isPanelVisible()\n\t{\n\t\treturn this.modalPanel.isVisible();\n\t}",
"isVisible() {\n return this.field.visible\n }",
"static get hasModalWindow() {}",
"get isVisible() {\n return document.getElementB... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
function to validate the pokemon | function pokemonValidate(pokemon) {
if(typeof(pokemon) === 'object'){
if(typeof(pokemon.name) !== 'string'){
return 'Your pokemon should have a name'
}else if(typeof(pokemon.height) !== 'number'){
return 'Your pokemon should have a height and it should be ... | [
"function validatePokemon(pokemon) {\n if (!pokemon.name) {\n throw \"Supplied Poke'mon has no name!\";\n }\n if (!pokemon.imageUrl) {\n throw \"Supplied Poke'mon has no imageUrl!\";\n }\n if (!pokemon.description) {\n throw \"Supplied Poke'mon has no description!\";\n }\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Determines if an index is valid. If the tabs are not ready yet, we assume that the user is providing a valid index and return true. | _isValidIndex(index) {
if (!this._items) {
return true;
}
const tab = this._items ? this._items.toArray()[index] : null;
return !!tab && !tab.disabled;
} | [
"_isValidIndex(index) {\n return index > -1 && (!this.steps || index < this.steps.length);\n }",
"function isValidIndex(index) {\n return index >= 0 && index < simpleDatabase.length\n}",
"validItemIndex(index) {\n return (index >= 0 && index < this.items.length);\n }",
"function checkIs... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
SELECT FROM cuisine_type WHERE id=3 | function findById(id) {
return db('cuisine_type')
.where({ id })
.first()
} | [
"getUserType({ id }, result) {\r\n let query = \"select idType from user where idUser = \" + id;\r\n\r\n sql.query(query, (err, rows, fieds) => {\r\n if (err) {\r\n result(err, rows);\r\n return;\r\n }\r\n\r\n result(null, rows);\r\n });\r\n }",
"function buscaCaracteristica... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Unpack the Server's Bid into a Prebidcompatible one. | function newBid(serverBid, rtbBid, bidderRequest) {
var bidRequest = __WEBPACK_IMPORTED_MODULE_1__src_utils_js__["getBidRequest"](serverBid.uuid, [bidderRequest]);
var bid = {
requestId: serverBid.uuid,
cpm: rtbBid.cpm,
creativeId: rtbBid.creative_id,
dealId: rtbBid.deal_id,
currency: 'USD',
... | [
"function PrebidServer() {\n let baseAdapter = new Adapter('prebidServer');\n let config;\n\n baseAdapter.setConfig = function(s2sconfig) {\n config = s2sconfig;\n };\n\n function convertTypes(adUnits) {\n adUnits.forEach(adUnit => {\n adUnit.bids.forEach(bid => {\n const types = paramTypes[b... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Fetch all course offering objects for this course | static courseOfferings() {
return this.hasMany(CourseOffering);
} | [
"getAllCourses() {\r\n return courses().then((courseCollection) => {\r\n return courseCollection.find({}).toArray();\r\n });\r\n }",
"function elective_all(req, res, next) {\n Elective.find()\n .populate('options')\n .exec((err, electives) => {\n if (err)\n r... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
replaceLastComma :: String > String | function replaceLastComma(selector) {
const lastComma = /,\s*$/;
return selector.replace(lastComma, '');
} | [
"function removeLastComma(str) {\n return str.replace(/,(\\s+)?$/, '');\n}",
"function removeLastComma(myString) {\n let ultComma = myString.lastIndexOf(\",\");\n if (ultComma > 0) {\n myString = myString.substring(0, ultComma);\n }\n return myString;\n}",
"function maybeAddComma(string) {... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Create consent event in the Didomi API The organization user ID passed to the API is the user email by default. Update the `organization_user_id` field in the call to POST /consents/events to use a different organization user ID. | async function createConsentEvent(data, context) {
if (!context.auth) {
// The user is not authenticated, stop here
throw new functions.https.HttpsError(
"failed-precondition",
"The function must be called while authenticated."
);
}
if (!data.consents || typeof data.consents !== "object")... | [
"function createEvent() {\n var calendarId = 'primary';\n var start = getRelativeDate(1, 12);\n var end = getRelativeDate(1, 13);\n var event = {\n summary: 'Lunch Meeting',\n location: 'The Deli',\n description: 'To discuss our plans for the presentation next week.',\n start: {\n dateTime: sta... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
parse Github URL text | function parseGithubURL(url_input) {
var data = { 'user': '', 'repo': '', 'path': '', 'name': '' };
if (url_input == null) {
return data;
}
// attempt a single file match
// example: https://github.com/tiggerntatie/brython-student-test/blob/master/hello.py
// ... | [
"function parseGithubUrl(urlStr) {\n let match;\n for (const pattern of githubPatterns) {\n match = urlStr.match(pattern);\n if (match) {\n break;\n }\n }\n if (!match)\n throw new Error(invalidGithubUrlMessage(urlStr));\n let [, auth, username, reponame, treeis... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
If the path ends with `.vue.template`, it's a `.vue` file's template part preprocessed by Vetur to calculate template diagnostics in TS Language Service | function isVirtualVueTemplateFile(path) {
return path.endsWith('.vue.template');
} | [
"templatePath (template_path = './') {\n return this.runtime.templatePath(this.resolved, template_path)\n }",
"function isVirtualVueFile(path) {\n return path.endsWith('.vue.ts') && !path.includes('node_modules');\n}",
"template(value) {\n var tag = this.tag;\n var dirname = this.dirname;\n\n va... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Declares a winner when one competitor reaches 5 points | function winner() {
if (playerPoints == 5) {
playerPoints = 0;
computerPoints = 0;
return "You won! Let's play again!";
} else if (computerPoints == 5) {
computerPoints = 0;
playerPoints = 0;
return "Game Over! Let's play again!";
} else {
return "First to 5 points wins! Let's Go!";
}
} | [
"pointMade(winner){\n\n //identify what player to add point to\n let winnerIdx = this.players.findIndex(player => player.name === winner);\n let winnerPlyr = this.players[winnerIdx];\n \n\n //if not a game ending point, add point to winner\n if(winnerPlyr.points <= 3){\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
name: extractSerie desc: extract the serie Id from its pathname; | function extractSerie(pathname) {
var regex = /\/serie-([\d]+)/,
id = pathname.match(regex);
if (!id) { return null; }
return id[1];
} | [
"getTarget(id) {\n return App.pathFinder.data.exoplanet_series.find(el => el.id === id);\n }",
"extractPart (id) {\n return id.split('-').pop()\n }",
"getTarget(id) {\n return App.pathFinder.data.neos_series.find(el => el.id === id);\n }",
"function extractStorageId(path)\n{\n\t// Subtract... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Given two points, returns the angle a picture/rectangle should be rotated to line up | function getAngleToRotate(pointA, pointB) {
if(pointA[0] == pointB[0]) {
return 90;
} else {
return Math.atan((pointB[1] - pointA[1]) / (pointB[0] - pointA[0])) / Math.PI * 180;
}
} | [
"function angle(p1, p2) {\n return Math.atan2(p2.y - p1.y, p2.x - p1.x);\n}",
"function getangle(x,y)\n{return Math.atan2(y,x);}",
"function getAngle(x1, y1, x2, y2){\n\n return - Math.atan2(y1 - y2, x1 - x2);\n}",
"function getAngleBetweenTwoPoints(x1, y1, x2, y2) {\n return Math.atan2(y2 -... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
REGISTER MOUSE CLICK ON AN OBJECT amRegisterClick(map_id, object_id, title, value) This function is called when user clicks on some object area, movie or label. | function amRegisterClick(map_id, object_id, title, value) {
Ammap.publish('amregisterclick', map_id, object_id, title, value);
} | [
"function amRegisterClickAnywhere(map_id, object_id, title, value) {\n\tAmmap.publish('amregisterclickanywhere', map_id, object_id, title, value);\n}",
"function objectClicked (clickedObject){\r\n clickedObject.clicked = true; \r\n}",
"function addClickListener(objectId, fce) {\r\n var object = document.g... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |