messages
listlengths
2
2
language
stringclasses
8 values
prompt_type
stringclasses
2 values
lint_errors
int64
0
129
⌀
cyclomatic_complexity
int64
0
32
⌀
license
stringclasses
7 values
commit
stringlengths
40
40
repos
stringlengths
5
116k
new_file
stringlengths
4
220
status
stringclasses
6 values
error
stringlengths
26
74
⌀
is_valid_syntax
bool
2 classes
[ { "role": "user", "content": "Here is the current file:\n```javascript\n//$(\"checkbox\").click(setLocationCookie);\n$(document).ready(function() {\n $('#location-checkbox').change(function() {\n if(this.checked) {\n setLocationCookie();\n }\n });\n});\n```\n\nApply this change: Add js for fake...
javascript
edit
0
2
apache-2.0
75a66a9bad87cf4c9b9dfea6be5ffbf1559a791d
googleinterns/step36-2020,googleinterns/step36-2020,googleinterns/step36-2020
src/main/webapp/scripts/index.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\nimport React from 'react'\nimport { sparqlConnect } from '../sparql/configure-sparql'\nimport { LOADING, LOADED, FAILED } from 'sparql-connect'\nimport { browserHistory } from 'react-router'\nimport { uriToLink } from '../router-mapping...
javascript
edit
0
1
mit
cc13a47514441d2ffd90b041d6ef7a792609e61e
Antoine-Dreyer/Classification-Explorer,UNECE/Classification-Explorer,Antoine-Dreyer/Classification-Explorer,UNECE/Classification-Explorer
src/js/components/search-input.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\nimport AppDispatcher from '../dispatcher/AppDispatcher';\n\nlet runtimeAddress = localStorage.getItem('runtimeAddress') || '127.0.0.1';\nlet socket = io('http://' + runtimeAddress + ':5000/');\nsocket.on('connect', ()=>console.log('Conn...
javascript
edit
0
2
apache-2.0
b5fdaf6c9d68dc759f9f05d9c7b3b3dcd2a7ff7a
pioneers/PieCentral,pioneers/PieCentral,pioneers/PieCentral,pioneers/PieCentral,pioneers/PieCentral,pioneers/PieCentral,pioneers/PieCentral
dawn/js/utils/Ansible.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\nvar game = require('../game.js');\nvar chai = require('chai');\n\nchai.should();\n\ndescribe('Game', function() {\n describe('createPack', function() {\n it('has 52 cards', function() {\n var p = game.createPack();\n p.sho...
javascript
edit
0
1
mit
b88476d0f8ff2ee9a534245b61c672d340c2b941
psmarshall/500,psmarshall/500
test/gameSpec.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\nwindow.lovelyTabMessage = (function(){\n var hearts = ['❤','💓','💖','💗','💘','💝','💕'];\n var heart = hearts[Math.floor(Math.random() * (hearts.length))];\n var lang = (window && window.navigator && window.navigator.language...
javascript
edit
0
2
mit
562e2b130db0ee402d0203189aeef65bd0d5ff09
tarekis/tab-lover
index.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\ndefine(function () {\n icons = {};\n\n icons.load = function (iconInfo, callback) {\n if (\"uri\" in iconInfo) {\n source = iconInfo.uri;\n }\n else if (\"name\" in iconInfo) {\n source =...
javascript
edit
0
3
apache-2.0
6a1abab752d4cef30e8433b518648893814754f5
godiard/sugar-web,sugarlabs/sugar-web
icons.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\nvar libPath = require('path');\n\nmodule.exports = function supportAngularHtml5(server) {\n var router = server.loopback.Router();\n\n router.all('/*', function(req, res, next) {\n var reqUrl = req.originalUrl;\n\n if (reqUrl.ma...
javascript
edit
0
7
mit
8789732b4ceb906ecc37aa56ba185b52b7c94128
agreatfool/Cart,agreatfool/Cart,agreatfool/Cart,agreatfool/Cart,agreatfool/Cart,agreatfool/Cart,agreatfool/Cart,agreatfool/Cart,agreatfool/Cart,agreatfool/Cart,agreatfool/Cart,agreatfool/Cart,agreatfool/Cart,agreatfool/Cart,agreatfool/Cart,agreatfool/Cart,agreatfool/Cart,agreatfool/Cart
src/server/boot/angular-html5.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\n// We use an \"Immediate Function\" to initialize the application to avoid leaving anything behind in the global scope\n(function () {\n\n /* ---------------------------------- Local Variables ---------------------------------- */\n ...
javascript
edit
0
2
mit
4e723a8b1f997595373c04af130a15e0c18a07d5
tlkiong/cordovaTutorial,tlkiong/cordovaTutorial,tlkiong/cordovaTutorial,tlkiong/cordovaTutorial,tlkiong/cordovaTutorial
www/js/app.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\nvar isVowel = require('is-vowel');\nvar khaan = module.exports = {\n\tsplitAtVowels: function ( word ) {\n\t\tvar output = [];\n\t\tvar current = '';\n\t\tfor ( var i = 0; i < word.length; i++ ) {\n\t\t\tvar c = word[i];\n\t\t\tif ( isV...
javascript
edit
0
4
isc
e986b22d01bdb50da6145610d962bc9663a5b9e4
zuzak/node-khaan
index.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\nvar mongoose = require('mongoose');\nvar Schema = mongoose.Schema;\nvar config = require('../../config.js');\n\nthis.rawFeedModel = {\n\ttimestamp: {type: Date, default: Date.now},\n\ttext: String\n};\n\nvar rawFeedSchema = new Schema(t...
javascript
edit
0
0
mit
ad5e2272bc1d857fdec6e14f0e8232296fc1aa38
NextCenturyCorporation/EVEREST
models/raw_feed/model.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\n/*\n * Copyright (c) 2019, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.\n *\n * WSO2 Inc. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance ...
javascript
edit
0
0
apache-2.0
8b38fbec1496431c650677b426662fd708db4b12
wso2/carbon-analytics,wso2/carbon-analytics,wso2/carbon-analytics,wso2/carbon-analytics,wso2/carbon-analytics
src/main/resources/tools/build.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\n'use strict';\n\nvar through = require('through')\n\nvar write = function write(chunk) {\n\n var self = this\n\n //read each line\n var data = chunk.toString('utf8')\n var lines = data.split('\\n')\n\n lines.forEach(function (line)...
javascript
edit
0
5
mit
026a8c0f001800c7e4304105af14cf1c1f56e933
digitalsadhu/env-reader
index.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\n/* jshint node: true */\n'use strict';\n\nmodule.exports = {\n name: 'ember-ui-sortable',\n\n included: function(app) {\n this._super.included(app);\n\n //app.import(app.bowerDirectory + '/jquery-ui/ui/data.js');\n //app.impo...
javascript
edit
0
1
mit
c897c1047356ba25fdc111b7a997a34e0fc4cc04
12StarsMedia/ember-ui-sortable,12StarsMedia/ember-ui-sortable
index.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\nmodule.exports = {\n Reddit: require( './reddit.js' ),\n Steam: require( './steam.js' ),\n MiggyRSS: require( './MiggyRSS.js' ),\n};\n\n```\n\nApply this change: Make sure the lint passes" }, { "role": "assistant", ...
javascript
edit
0
0
mit
5de5b0c2b772ea307d2fb74828c85401b31f7ea1
post-tracker/finder
modules/finders/index.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\nconst MAX_PAYLOAD_SIZE = 1024 * 512 // 512KB\n\nfunction batchDocuments(docs) {\n let currentBatch = []\n let currentBatchSize = 0\n const batches = [currentBatch]\n\n docs.forEach(doc => {\n const docSize = JSON.stringify(doc).l...
javascript
edit
0
5
mit
49c0174266ded14f48df30aad1d8f90a809f21cf
sanity-io/sanity,sanity-io/sanity,sanity-io/sanity,sanity-io/sanity
packages/@sanity/import/src/batchDocuments.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\n'use strict';\n\nmodule.exports = {\n type: 'content-api',\n routes: [\n {\n method: 'POST',\n path: '/',\n handler: 'content-api.upload',\n },\n {\n method: 'GET',\n path: '/files/count',\n hand...
javascript
edit
0
0
mit
473a265a16f9c51e0c006b3d49d695700770a9e4
wistityhq/strapi,wistityhq/strapi
packages/core/upload/server/routes/content-api.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\nvar plugin;\nvar slack;\nvar config;\n\nvar events = {}\n\nevents.onLoad = function(plugin) {\n // dependency injection, any better methods for Node?\n this.plugin = plugin;\n config = plugin.getConfig();\n\n // https://www....
javascript
edit
0
2
mit
fe58a8feb7724c074fb37b62b4e180a254416e73
ylt/BotPlug,WritheM/Wallace,WritheM/Wallace,ylt/Wallace,Reanmachine/Wallace,Reanmachine/Wallace,ylt/Wallace
coreplugins/slack/slack.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\nexport function initialize(application) {\n\n const inject = (property, what) => {\n application.inject('controller', property, what);\n application.inject('component', property, what);\n application.inject('route', property, ...
javascript
edit
0
1
apache-2.0
c8e3b4a5c321bfd6826e9fc9ea16157549850844
ritikamotwani/open-event-frontend,CosmicCoder96/open-event-frontend,CosmicCoder96/open-event-frontend,ritikamotwani/open-event-frontend,ritikamotwani/open-event-frontend,CosmicCoder96/open-event-frontend
app/initializers/blanket.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\nvar sidebarOpen = false;\nvar menuText = [\"Menu\", \"Close\"];\nvar menuElement = document.querySelector(\".menu-link\");\nvar sidebarElement = document.querySelector(\".sidebar\");\nvar headerElement = document.querySelector(\"header\...
javascript
edit
0
5
mit
c971b63c3cc2b070643f51675f262f518c86325f
sveltejs/svelte.technology,sveltejs/svelte.technology
src/files/navigation.js
rejected_duplicate
Near-duplicate of sample 76387
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\n'use strict';\n\nconst $ = require('jquery'),\n remote = require('remote');\n\nlet main = remote.getCurrentWindow();\n\n$(function(){\n $('.tools > div').on('click', (e) => main[e.target.className]());\n});\n\n```\n\nApply this ch...
javascript
edit
0
1
mit
9542380f1530e9cbb680e04ac8694c649e5acab8
JamenMarz/vint,JamenMarz/cluster
scripts/ui.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\nexport default () => ({\n persist: jest.fn(data => Promise.resolve(data)),\n restore: jest.fn(() =>\n Promise.resolve({ authenticated: { authenticator: 'test' } })\n )\n})\n\n```\n\nApply this change: Update test storage to better...
javascript
edit
0
1
mit
683d418fd7bede0da8b5c1d7b1250c50a4b0eca9
jerelmiller/redux-simple-auth
test/utils/testStorage.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\nimport React from 'react'\nimport PropTypes from 'prop-types'\nimport {SimpleMenu, MenuAnchor, Icon} from '..'\n\nclass IconMenu extends React.PureComponent {\n static displayName = 'IconMenu'\n\n static propTypes = {\n children: P...
javascript
edit
0
1
mit
2f3f141e1196eaa39ade102d3795cd189f57828f
dimik/react-material-web-components,dimik/react-material-web-components
src/IconMenu/IconMenu.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\nimport React from 'react';\nimport {Link} from 'react-router-dom'\n\nclass Home extends React.Component {\n render() {\n return (\n <div>\n <Link to=\"/add-words\" className=\"button btn-large\">Add new word</Link>\n ...
javascript
edit
0
1
mit
b12455b707f3e720173f0b74ce3f49921697db78
dmatthew/my-secret-language,dmatthew/my-secret-language,dmatthew/my-secret-language
app/src/Home.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\nvar Transport = can.Control.extend({\n\n init: function(element, options) {\n this.status = options.status;\n element.html(can.view('views/transport.ejs'));\n },\n\n sendCommand: function(command) {\n var self = this;\n c...
javascript
edit
0
1
mit
7fff75c2c053e3b4084fddad486a3e03c2afe0fb
danbee/mpd-client,danbee/mpd-client
assets/js/controls/transport.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\nconst commander = require('commander')\n\nclass Options {\n constructor(argv) {\n const args = commander\n .option('--electron-debug',\n 'Show the browser window and keep it open after running features')\n .pa...
javascript
edit
0
1
mit
20135db684aeb8d4f626d62f03c08b41ac8b5900
featurist/cucumber-electron,featurist/cucumber-electron,cucumber/cucumber-electron,cucumber/cucumber-electron,cucumber/cucumber-electron,cucumber/cucumber-electron
cli/options.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\n'use strict';\n\nvar gulp = require('gulp'),\n jshint = require('gulp-jshint'),\n mocha = require('gulp-mocha');\n\nvar paths = {\n scripts: ['./*.js', './test/*.js', '!./lib', '!./gulpfile.js']\n};\n\ngulp.task('lint', functio...
javascript
edit
0
1
mit
4c0ead9c25c3062daa8204c007274758aecda144
jonkemp/node-qunit-phantomjs
gulpfile.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\nmodule.exports = {\n name: 'ToggleSplits',\n type: 'checkbox',\n default: false,\n section: 'accounts',\n title: 'Add a Toggle Splits Button',\n description: 'Clicking the toggle splits button shows or hides the sub-transactions w...
javascript
edit
0
0
mit
7adfdc80661f56070acf94ee2e24e9ea42d1c96c
dbaldon/toolkit-for-ynab,toolkit-for-ynab/toolkit-for-ynab,falkencreative/toolkit-for-ynab,toolkit-for-ynab/toolkit-for-ynab,blargity/toolkit-for-ynab,ahatzz11/toolkit-for-ynab,falkencreative/toolkit-for-ynab,falkencreative/toolkit-for-ynab,toolkit-for-ynab/toolkit-for-ynab,ahatzz11/toolkit-for-ynab,dbaldon/toolkit-for...
sauce/features/accounts/toggle-splits/settings.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\n'use strict';\n\nmodule.exports = {\n fetch: function () {\n\n },\n update: function () {\n\n },\n merge: function () {\n\n },\n};\n\n```\n\nApply this change: Add the base project structure" }, { "role": "assi...
javascript
edit
0
1
mit
4fd9b9584dd1d273274be5734f783d0d4a857a5a
dorian-marchal/phonegap-boilerplate-cli
index.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\n'use strict';\n\nvar fs = require('fs');\nvar spawnSync = require('child_process').spawnSync;\nvar HttpResponse = require('http-response-object');\nrequire('concat-stream');\nrequire('then-request');\nvar JSON = require('./lib/json-buff...
javascript
edit
0
8
mit
cfa32de7fb24d29cd7fbf52e1d1822f61a6db8c5
ForbesLindesay/sync-request,ForbesLindesay/sync-request
index.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\nvar config = require('./Build/Config');\n\nmodule.exports = function(grunt) {\n\t'use strict';\n\n\t// Display the execution time of grunt tasks\n\trequire('time-grunt')(grunt);\n\n\t// Load all grunt-tasks in 'Build/Grunt-Options'.\n\t...
javascript
edit
0
1
mit
d7c647971190893a30dd61068c1edcf266a32201
t3b/t3b_template,t3b/t3b_template,t3b/t3b_template,t3b/t3b_template,t3b/t3b_template
Gruntfile.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\njQuery(function ($) {\n function d(event) {\n event.keyCode === 13 && button.click();\n }\n\n function click() {\n image.attr('src', src + (src.indexOf('?') < 0 ? '?' : '&') + '_=' + +new Date());\n imgv.va...
javascript
edit
0
4
apache-2.0
006a8e25c02f800d4b36cc051c46f736fcc940b2
zjnu-acm/judge,zjnu-acm/judge,zjnu-acm/judge,zjnu-acm/judge,zjnu-acm/judge
site/src/main/resources/static/js/findpassword.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\nvar Prism = require('prismjs');\nvar cheerio = require('cheerio');\n\nmodule.exports = {\n book: {\n assets: './node_modules/prismjs/themes',\n css: [\n 'prism.css'\n ]\n },\n hooks: {\n page: function (page) {\n ...
javascript
edit
0
1
apache-2.0
903456c8c2203d3b86aab36fc70edb0780cf85f1
gaearon/gitbook-plugin-prism
index.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\n/**\n * @author mrdoob / http://mrdoob.com\n * @author Jesús Leganés Combarro \"Piranna\" <<EMAIL>>\n */\n\nfunction EventTarget()\n{\n var listeners = {};\n\n this.addEventListener = function(type, listener)\n {\n\t\tif(!listener) r...
javascript
edit
0
6
mit
72ca5876f553f595582993e800708b707b956b16
ShareIt-project/EventTarget.js
EventTarget.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\n'use strict';\n\nmodule.exports = function (grunt) {\n require('time-grunt')(grunt);\n require('load-grunt-tasks')(grunt);\n\n grunt.initConfig({\n // Configurable paths\n config: {\n lintFiles: [\n ...
javascript
edit
0
1
mit
1c9492dd27e6115c6bc0a8e8305a3165d55c313f
ivanslf/angular-bind-html-compile,incuna/angular-bind-html-compile
Gruntfile.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\n\n'use strict';\n\n// eslint-disable-next-line no-console\nconsole.log(`———————————————————————————————— ${(new Date())} \\n\\n`);\n\ndescribe('MarkTodoItem', () => {\n const test_case_mocks = require('./test-case.mocks');\n\n const M...
javascript
edit
0
1
mit
e5636a64d0e737a63ca7f5e5762c098afbeca578
MelleWynia/mark-todo-item
spec/index.spec.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\nmodule.exports = {\n \"sourceMaps\": true,\n \"presets\": [\n [\"@babel/preset-env\", {\n \"targets\": {\n \"browsers\": [\n \"last 2 Chrome versions\", \"last 2 Firefox versions...
javascript
edit
0
0
apache-2.0
cff4ad9e8273d3560485b8e459d689088a629d9d
vector-im/riot-web,vector-im/riot-web,vector-im/riot-web,vector-im/riot-web,vector-im/vector-web,vector-im/riot-web,vector-im/riot-web,vector-im/vector-web,vector-im/vector-web,vector-im/vector-web,vector-im/vector-web
babel.config.js
rejected_duplicate
Near-duplicate of sample 85568
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\n/* jshint node: true */\n'use strict';\n\nvar replace = require('broccoli-replace');\nvar favicons = require('broccoli-favicon');\n\nvar htmlCache = null;\n\nmodule.exports = {\n\n name: 'ember-cli-favicon',\n\n included: function(app...
javascript
edit
0
4
mit
bae1de8075c538aa67ee233d5bf7c6b808e275c6
davewasmer/ember-cli-favicon,davewasmer/ember-cli-favicon
index.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\n// Some user-accessible config for unit tests\n// Format is: { platform:{ ...settings.. } }\n\n// numDevices - The number of devices the server will start a test with\n// Any other devices after that will just be ignored\n\...
javascript
edit
0
0
mit
79923a9af19fd1b6b7ecb2ee984736404d8f0504
thaliproject/Thali_CordovaPlugin,thaliproject/Thali_CordovaPlugin,thaliproject/Thali_CordovaPlugin,thaliproject/Thali_CordovaPlugin,thaliproject/Thali_CordovaPlugin
test/TestServer/UnitTestConfig.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\n'use strict';\n\nvar assign = require('object-assign');\nvar chalk = require('chalk');\nvar ProgressBar = require('progress');\n\n/**\n * Progress bar download plugin\n *\n * @param {Object} res\n * @api public\n */\n\nmodule.exports = ...
javascript
edit
0
2
mit
29d581091804b1f6b4aa55e0b8cc8d96270ab575
kevva/download-status
index.js
rejected_duplicate
Near-duplicate of sample 100976
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\nimport React from 'react';\nimport '../../aframeComponents/scene-load';\nimport '../../aframeComponents/aframe-minecraft';\nimport AssetLoader from './AssetLoader';\nimport InitialLoading from './InitialLoading';\n\nexport default funct...
javascript
edit
0
2
mit
043adbd2ca8d5ba976f3520132e1743844c55abd
TranscendVR/transcend,TranscendVR/transcend
browser/react/components/App.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\n\r\nexports.up = function(knex, Promise) {\r\n return knex.schema.createTable('taxonomy_term_data', function (table) {\r\n table.increments('id').primary()\r\n table.integer('id_vocabulary').unsigned()\r\n table.foreign('id_vo...
javascript
edit
0
1
mit
ca08af4d5eb1c48698fa52f1b8b651fca4525b60
smanongga/smanongga.github.io,smanongga/smanongga.github.io,smanongga/smanongga.github.io
migrations/20170515084345_taxonomy_term_data.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\n/*\n\tMIT License http://www.opensource.org/licenses/mit-license.php\n\tAuthor Tobias Koppers @sokra\n*/\n\nfunction accesorString(value) {\n\tvar depths = value.split(\".\");\n\tvar length = depths.length;\n\tvar result = \"\";\n\t\n\t...
javascript
edit
0
3
mit
dc9375c8faa47f915d24aaf6ebc1e67a431fa1b9
wuxiandiejia/expose-loader
index.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\nimport { expect, getRenderedComponent, sinon } from '../../spec_helper'\nimport { routeActions } from 'react-router-redux'\n// import * as MAPPING_TYPES from '../../../src/constants/mapping_types'\nimport Container, { Discover as Compon...
javascript
edit
null
null
mit
55c0f4c0908ba79f9d54bb197340358398122548
ello/webapp,ello/webapp,ello/webapp
test/components/streams/DiscoverComponent_test.js
rejected_syntax
Syntax error detected by tree-sitter
false
[ { "role": "user", "content": "Here is the current file:\n```javascript\n---\nlayout: null\n---\n\njQuery(document).ready(function($) {\n /* Method 2: */\n /* var isFirefox = /^((?!chrome|android).)*firefox/i.test(navigator.userAgent); */\n $(\"#btn-print\").click(function() {\n /* Method 1:*/\n if ...
javascript
edit
null
null
mit
19a3015ebaf0d9d058eecff620cc38b7f4008a0d
williamcanin/williamcanin.github.io,williamcanin/williamcanin.github.io,williamcanin/williamcanin.github.io,williamcanin/williamcanin.github.io
assets/javascripts/resume.js
rejected_syntax
Syntax error detected by tree-sitter
false
[ { "role": "user", "content": "Here is the current file:\n```javascript\nmodule.exports = (addDays = 0) => {\n\tlet date = new Date();\n\tdate.setDate(date.getDate() + addDays);\n\tdate.setUTCHours(0);\n\tdate.setUTCMinutes(0);\n\tdate.setUTCSeconds(0);\n\tdate.setUTCMilliseconds(0);\n\treturn date;\n};\n\n`...
javascript
edit
0
1
mit
e252bd17fbbb174182fb322de6138bc6fe53f599
MartinKolarik/relative-day-utc
index.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\n'use strict';\nlet path = require('path');\nlet assert = require('yeoman-generator').assert;\nlet helpers = require('yeoman-generator').test\n\ndescribe('react-webpack-redux:root', () => {\n\n let generatorDispatcher = path.join(__dirn...
javascript
edit
0
1
mit
457a6fe779b4921c88d436a35cdf4fb9f0a9d02b
stylesuxx/generator-react-webpack-redux,stylesuxx/generator-react-webpack-redux
test/generators/root/indexTest.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\n// TODO: This is not a real model or controller\nApp.Graphs = Ember.Controller.extend({\n graph: function(emberId, entityName, entityType, numSeries) {\n entityName = entityName.replace(/\\./g, '-');\n var url = ((!localStorage.a...
javascript
edit
null
null
apache-2.0
cdeca36337d76404cb8ea02f90e84ed9d0ca0c4e
vine77/saa-ui,vine77/saa-ui,vine77/saa-ui
scripts/models/graphs-model.js
rejected_syntax
Syntax error detected by tree-sitter
false
[ { "role": "user", "content": "Here is the current file:\n```javascript\ndescribe('pingPong', function() {\n it(\"is true for a number that is divisible by 3\", function() {\n expect(pingPong(6)).to.equal(true);\n });\n it(\"is true for a number that is divisible by 5\", function() {\n expect(pingPo...
javascript
edit
0
1
mit
e64e0e8cd275c108d9766d4062d4eab77984212f
kcmdouglas/pingpong,kcmdouglas/pingpong
spec/specs.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\n/* @flow */\n\n'use strict';\n\nexport const settings = {\n\tAPI_BASE_URL: 'https://spoonacular-recipe-food-nutrition-v1.p.mashape.com/',\n API_KEY: 'jVDiaXvfpsmshdrtFO7JHibo7Hrtp16UelPjsnBE4Bfzl0CV5u'\n};\n```\n\nApply this change: A...
javascript
edit
0
0
bsd-3-clause
9d6ff0ae59a2314b457475706a4e6f2b5362ff33
hippothesis/Recipezy,hippothesis/Recipezy,hippothesis/Recipezy
app/configurations/settings.js
rejected_duplicate
Near-duplicate of sample 88322
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\nimport React from 'react';\n\nimport { PasswordForgetForm } from '../PasswordForget';\nimport PasswordChangeForm from '../PasswordChange';\nimport { AuthUserContext, withAuthorization } from '../Session';\n\nconst AccountPage = () => (\...
javascript
edit
0
1
apache-2.0
4db4e1b3f9e13c8faa2449a231669ca047b79572
googleinterns/Pictophone,googleinterns/Pictophone,googleinterns/Pictophone,googleinterns/Pictophone
client/src/Account/index.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\nclass CurrentTask {\n constructor() {\n this.currentTask = null;\n }\n\n get() {\n return this.currentTask;\n }\n\n set(task) {\n this.currentTask = task;\n }\n}\n\nangular.module('materialscommons...
javascript
edit
0
1
mit
0ae9a166553e7247913efb44649437cc5abe7987
materials-commons/materialscommons.org,materials-commons/materialscommons.org,materials-commons/materialscommons.org,materials-commons/materialscommons.org,materials-commons/materialscommons.org
website/src/app/project/experiments/experiment/components/tasks/current-task.service.js
rejected_duplicate
Near-duplicate of sample 68820
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\n/** @license\n * Copyright 2016 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n\ngoog.provide('shaka.polyfill');\n\ngoog.require('shaka.util.Iterables');\n\n\n/**\n * @summary A one-stop installer for all polyfills.\n * @see h...
javascript
edit
0
4
apache-2.0
aff3ad78cd1e04e26f9618cdb58bf0e477768f95
shaka-project/shaka-player,tvoli/shaka-player,shaka-project/shaka-player,shaka-project/shaka-player,tvoli/shaka-player,tvoli/shaka-player,shaka-project/shaka-player,tvoli/shaka-player
lib/polyfill/all.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\n#!/usr/bin/env node\n// adapted based on rackt/history (MIT)\nvar execSync = require('child_process').execSync;\nvar stat = require('fs').stat;\n\nfunction exec(command) {\n execSync(command, {\n stdio: [0, 1, 2]\n });\n}\n\nstat('...
javascript
edit
0
3
mit
b78a5d619c86bb2ab1515b4ec7a50aa605b7345f
austinsc/react-gooey,austinsc/react-gooey
lib/post_install.js
rejected_duplicate
Near-duplicate of sample 72473
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\n(function(){\n\tangular\n\t\t.module(\"movieMash\")\n\t\t.factory(\"scoreService\",scoreService);\n\n\t\tscoreService.$inject=['localStorageService','$firebaseArray','firebaseDataService'];\n\n\t\tfunction scoreService(localStorageServi...
javascript
edit
0
2
mit
21e70737e4499c164b04095568ff748b6c0ff32a
emyann/MovieMash,emyann/MovieMash
app/services/scores.service.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\n/**\n * @author Richard Davey <<EMAIL>>\n * @copyright 2018 Photon Storm Ltd.\n * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}\n */\n\n/**\n * Passes each element in the array ...
javascript
edit
0
3
mit
bb29f0cdfce053b339802c3747fa4ee79bdec036
spayton/phaser,BeanSeed/phaser,englercj/phaser,BeanSeed/phaser,TukekeSoft/phaser,pixelpicosean/phaser,TukekeSoft/phaser,mahill/phaser,photonstorm/phaser,photonstorm/phaser,mahill/phaser,spayton/phaser,TukekeSoft/phaser
src/utils/array/Each.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\n// @flow\n\ndeclare module 'redux' {\n declare type Enhancer<Action, State> = mixed;\n\n declare type ReduxStore<Action, State> = {\n dispatch: (action: Action) => void | Promise<void>,\n getState: () => State,\n };\n\n declar...
javascript
edit
null
null
mit
cd8e0a15daa5ef8feaedc43808fc498b746bb133
clarus/redux-ship
decls/redux.js
rejected_syntax
Syntax error detected by tree-sitter
false
[ { "role": "user", "content": "Here is the current file:\n```javascript\nif (document.location.hostname === \"josephduffy.co.uk\") {\n // Don't load analytics for noanalytics.josephduffy.co.uk or onion service\n return;\n}\n\nvar _paq = window._paq || [];\n/* tracker methods like \"setCustomDimension\" sho...
javascript
edit
0
3
mit
7cd44b68d733217e790766e7759e0d83deb623c3
JosephDuffy/josephduffy.co.uk,JosephDuffy/josephduffy.co.uk,JosephDuffy/josephduffy.co.uk
public/load-analytics.js
rejected_duplicate
Near-duplicate of sample 67728
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\nimport Module from '../Module'\n\nexport default class Label extends Module {\n\n constructor(el, name, options) {\n\n const defaults = {\n \"once\": false,\n \"activeClass\": \"is-active\"\n }\n\n super(el, name, op...
javascript
edit
0
2
mit
0dabf910f31ed3b0fdacc742eae9555962462b57
Jaywing/atomic,Jaywing/atomic
src/javascripts/asyncModules/Label.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\n#!/usr/bin/env node\n\nvar program = require('commander');\nvar prompt = require('inquirer');\nvar path = require('path');\n\nvar pkg = require(path.resolve(__dirname, '..', 'package.json'));\n\nprogram.version(pkg.version)\n\nprogram\n...
javascript
edit
0
1
mit
f17aea4fed7652378310b53630191e8a48461716
code-computerlove/slate-cli,code-computerlove/quarry,cartridge/cartridge-cli
bin/cli.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\nvar http = require('scoped-http-client');\n\nvar Responder = function (api, event, match, message) {\n this.api = api;\n this.event = event;\n this.match = match;\n this.message = message;\n};\n\nResponder.prototype.random ...
javascript
edit
0
6
mit
f12db5425cf5246b95fcae2c8b54fdf092fc4158
concierge/Concierge,faizaanmadhani/brianIsTenCarols,faizaanmadhani/brianIsTenCarols,concierge/Concierge
core/modules/hubot/responder.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\nmodule.exports = {\n testEnvironment: 'node',\n preset: '@shelf/jest-mongodb'\n}\n\n```\n\nApply this change: Add root to prevent infinite loop in watch" }, { "role": "assistant", "content": "module.exports = {\n testEnvi...
javascript
edit
0
0
mit
88f86838b7f7f926e5df349edcd6461284fde181
synzen/Discord.RSS,synzen/Discord.RSS
jest.config.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\n(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){\r\n(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),\r\nm=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore...
javascript
edit
0
2
bsd-3-clause
7683a9a714d86a223fb89e9e7126aa7bcb8ac57d
BloodAxe/CloudCV,BloodAxe/CloudCV
public/javascripts/ga.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\n'use strict';\n\n// Declare app level module which depends on views, and components\nangular.module('myApp', [\n 'ngRoute',\n 'drupalService',\n 'myApp.node_add',\n 'myApp.node_nid',\n 'myApp.node',\n 'myApp.taxonomy_t...
javascript
edit
0
1
mit
a341760e3945404a64f597580df23dbcfe226a54
clemens-tolboom/drupal-8-rest-angularjs,clemens-tolboom/drupal-8-rest-angularjs
app/app.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\n/*\n * site: codemelon2012\n * file:\tscripts/main.js\n * author:\tMarshall Farrier\n * date:\t8/24/2012\n * description:\n * main JavaScript for codemelon2012\n * links:\n * http://code.google.com/p/jquery-rotate/ (if needed)\n ...
javascript
edit
0
2
mit
7f4cce36d7509feb926eed95a39f73c3dc28633d
aisthesis/codemelon2012,aisthesis/codemelon2012,aisthesis/codemelon2012,aisthesis/codemelon2012
scripts/main.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\n(function() {\n var csError = require('./csError');\n\n var MalformedPushEventError = csError.createCustomError('MalformedPushEventError', function() {\n var message = 'There are no translators that understand the payload you are s...
javascript
edit
0
1
bsd-3-clause
fe7059841567191c87c61e0e51f11d634db5d138
openAgile/CommitStream.Web,JogoShugh/CommitStream.Web,openAgile/CommitStream.Web,JogoShugh/CommitStream.Web,JogoShugh/CommitStream.Web,openAgile/CommitStream.Web,openAgile/CommitStream.Web,JogoShugh/CommitStream.Web
src/app/middleware/malformedPushEventError.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\n'use strict';\n\nfunction AccountCtrl($scope, $http, $cookieStore, flash, AccountService, LoginService, ServerErrorResponse, Base64) {\n $scope.currentAccount = angular.copy(AccountService.getAccount());\n\n $scope.changePassword ...
javascript
edit
0
1
apache-2.0
24f71bb57f77debde99101c4d03839b0e5792748
GeoKnow/GeoKnowGeneratorUI,GeoKnow/GeoKnowGeneratorUI,GeoKnow/GeoKnowGeneratorUI
src/main/webapp/js/account/account-controller.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\nimport Ember from 'ember';\nimport Map from '../map';\n\nexport default Ember.Component.extend({\n setupMap: Ember.on('init', function() {\n this.map = new Map();\n this.map.set('owner', this);\n }),\n\n setupMapElement: Ember....
javascript
edit
0
2
mit
b3eae251fac261eb3d903c056ebf4e6da531f174
SamvelRaja/google-maps-addon,SamvelRaja/google-maps-addon
addon/components/google-maps-addon.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\nrequire([ \"jquery\" ], function($) {\n\n \"use strict\";\n\n require([\n \"lib/core/base\",\n \"lib/page/scroll_perf\",\n \"flamsteed\",\n \"trackjs\",\n \"polyfills/function_bind\",\n \"polyfills/xdr\"\n ], functi...
javascript
edit
0
3
mit
3516155c660223e394986d8d2c2e4282dcf062d1
lonelyplanet/rizzo,Lostmyname/rizzo,Lostmyname/rizzo,Lostmyname/rizzo,lonelyplanet/rizzo,Lostmyname/rizzo,Lostmyname/rizzo,lonelyplanet/rizzo,lonelyplanet/rizzo,lonelyplanet/rizzo
app/assets/javascripts/app_core.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\ndefine(function () {\n\n var _toString = Object.prototype.toString;\n\n /**\n * Gets the \"kind\" of value. (e.g. \"String\", \"Number\", etc)\n */\n function kindOf(val) {\n return _toString.call(val).slice(8, -...
javascript
edit
0
1
mit
d3cca9554d31b7e20dd9b76eae463b532a2b7767
mout/mout,mout/mout
src/lang/kindOf.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\nvar minimatch = require('minimatch');\nvar is = require('annois');\nvar fp = require('annofp');\nvar zip = require('annozip');\n\n\nmodule.exports = function(model, query, cb) {\n if(!is.object(query) || fp.count(query) === 0) {\n ...
javascript
edit
0
9
mit
be3e40877f72374110b1b27b4c2912c3826dd073
MartinKolarik/api-sync,MartinKolarik/api,jsdelivr/api-sync,2947721120/jsdelivr-api,jsdelivr/api,jsdelivr/api-sync,MartinKolarik/api-sync
lib/get_all.js
rejected_duplicate
Near-duplicate of sample 69980
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\nimport Plugin from './Plugin';\n\nexport default class Multipart extends Plugin {\n constructor(core, opts) {\n super(core, opts);\n this.type = 'uploader';\n }\n\n run(results) {\n console.log({\n class : 'Multipart',...
javascript
edit
0
2
mit
d5a0e4a1d63cffd6e3a9f24a4ed9a110a53a0623
transloadit/uppy,varung-optimus/uppy,transloadit/uppy,varung-optimus/uppy,transloadit/uppy,transloadit/uppy,varung-optimus/uppy
src/plugins/Multipart.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\nconst generators = require('yeoman-generator')\nconst fs = require('fs')\n\nmodule.exports = generators.Base.extend({\n constructor: function () {\n generators.Base.apply(this, arguments)\n this.sourceRoot(__dirname + '/../kit')\...
javascript
edit
0
3
mit
942e1fb57ab588294badf3934f4280a15b550556
muffin/cli,muffinjs/cli
app/index.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\nimport React, { PropTypes } from 'react';\nimport { connect } from 'react-redux';\nimport Helmet from 'react-helmet';\n\nimport Header from 'components/Header';\nimport SignupCard from 'components/SignupCard';\n\nexport class SignupPage...
javascript
edit
0
1
mit
1b4cd822a398eda824c0ea4223e665977abf50e6
kevinnorris/bookTrading,kevinnorris/bookTrading
app/containers/SignupPage/index.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\n/**\n * A list of database constants.\n *\n * @type {Object}\n */\nconst DATABASE_CONSTANTS = Object.freeze({\n GUILD_TABLE_NAME: 'guilds',\n PLAYLIST_TABLE_NAME: 'playllists',\n BLACKLIST_TABLE_NAME: 'blacklists'\n});\n\nmodul...
javascript
edit
0
0
mit
4eaa3f4ca5001f92b4b773c539ca54914a2436f8
Senither/AvaIre
app/constants/DatabaseConstants.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\n// @flow\n\nimport * as React from 'react';\nimport { Helmet } from 'react-helmet';\nimport config from 'app/config';\nimport { type ComponentType, createElement } from 'react';\n\n/**\n * A higher order component that wraps the given c...
javascript
edit
null
null
mit
0f890d943964aad281488ed29b39d08e4b784e4f
webkom/lego-webapp,webkom/lego-webapp,webkom/lego-webapp
app/utils/helmet.js
rejected_syntax
Syntax error detected by tree-sitter
false
[ { "role": "user", "content": "Here is the current file:\n```javascript\n// Import Tinytest from the tinytest Meteor package.\nimport { Tinytest } from \"meteor/tinytest\";\n\n// Import and rename a variable exported by ~fs-name~.js.\nimport { name as packageName } from \"meteor/~fs-name~\";\n\n// Write your...
javascript
edit
0
1
mit
e24150cab1aac5a0a4b1c4cd72b20ad529114052
jdivy/meteor,Hansoft/meteor,chasertech/meteor,Hansoft/meteor,mjmasn/meteor,4commerce-technologies-AG/meteor,mjmasn/meteor,chasertech/meteor,chasertech/meteor,mjmasn/meteor,Hansoft/meteor,chasertech/meteor,Hansoft/meteor,mjmasn/meteor,jdivy/meteor,mjmasn/meteor,jdivy/meteor,jdivy/meteor,4commerce-technologies-AG/meteor,...
tools/static-assets/skel-pack/~fs-name~-tests.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\nvar expect = require('chai').expect;\nvar helper = require('./helper');\n\ndescribe('helper', function () {\n it('should camelCase text', function () {\n expect(helper.camelCase('snake_case')).to.be.equal('snakeCase');\n expect(h...
javascript
edit
0
1
mit
5f7fc53336aeb6b88a24761da99ca3d93c22e40c
RisingStack/swaggity,RisingStack/swaggity
src/helper.spec.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\nglobal.IPC = require('ipc')\n\nvar events = ['unread-changed'];\n\nevents.forEach(function(e) {\n\twindow.addEventListener(e, function(event) {\n\t\tIPC.send(e, event.detail);\n\t});\n});\n\nrequire('./menus');\n\nvar shell = require('s...
javascript
edit
0
7
mit
5cbb7846f152cd61080d7b956a3a8c673b55345a
RocketChat/Rocket.Chat.Electron,RocketChat/Rocket.Chat.Electron,ZedTheYeti/Rocket.Chat.Electron,RocketChat/Rocket.Chat.Electron,ZedTheYeti/Rocket.Chat.Electron,ZedTheYeti/Rocket.Chat.Electron
app/preload.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\n{{#if mutations}}\n{{#each mutations}}\nexport const {{this}} = '{{camelcase this}}';\n{{/each}}\n{{/if}}\n\nexport default {\n namespaced: true,\n state: {\n },\n getters: {\n },\n mutations: {\n {{#if mutations}}\n {{#each...
javascript
edit
null
null
mit
fe0d3891b553b7080b5e9e0f22d1e4ed325e925d
hjeti/vue-skeleton,hjeti/vue-skeleton,hjeti/vue-skeleton
build-tools/template/store/{name_cc}/{name_cc}.js
rejected_syntax
Syntax error detected by tree-sitter
false
[ { "role": "user", "content": "Here is the current file:\n```javascript\n// This is a manifest file that'll be compiled into application.js, which will include all the files\n// listed below.\n//\n// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,\n// or a...
javascript
edit
0
1
mit
adca715e97d97fc7247ca966b55848076d00c6b3
barreyro/steph.rocks,barreyro/steph.rocks,barreyro/steph.rocks
app/assets/javascripts/application.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\ndefine(['react', 'components/common/glyphicon'], function(React, Glyphicon) {\n\n var PageHeader = React.createClass({\n render: function() {\n var help_button = [];\n var help_text = [];\n if ...
javascript
edit
0
3
apache-2.0
496f5e28920513750c5b4e3e5c06523c8162a238
CCI-MOC/GUI-Frontend,CCI-MOC/GUI-Frontend,CCI-MOC/GUI-Frontend,CCI-MOC/GUI-Frontend,CCI-MOC/GUI-Frontend
troposphere/static/js/components/page_header.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\n// This is a manifest file that'll be compiled into application.js, which will include all the files\n// listed below.\n//\n// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,\n// or v...
javascript
edit
0
0
mit
fdf4f520c31b0e5f8b666b02c5a9650929abfdbe
red-spotted-newts-2014/haunted,red-spotted-newts-2014/haunted
app/assets/javascripts/application.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\nimport DashboardWidgetComponent from 'appkit/components/dashboard-widget';\n\nvar GithubTeamNotices = DashboardWidgetComponent.extend({\n\n init: function() {\n this._super();\n this.set(\"contents\", []);\n },\n\n actions: {\n...
javascript
edit
0
2
mit
a2f91c3f13e0440ac8e52f94aff98bdeb96872e0
substantial/substantial-dash-client
app/components/github-team-notices.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\nimport { createSelector } from 'reselect';\n\nconst getTactics = state => state.entities.tactics;\n\nexport const tacticsSelector = createSelector(\n [getTactics], tactics => tactics.items.map(id => tactics.byId[id]),\n);\n\n```\n\nApp...
javascript
edit
0
1
mit
ac658b3bdcd2262b7db7d6b8bebadb05e31a07d4
m-mik/tactic-editor,m-mik/tactic-editor
src/selectors/tactics.js
accepted
null
true
[ { "role": "user", "content": "Write javascript code for the following: Add ADD_TODO and TOGGLE_TODO actions" }, { "role": "assistant", "content": "let todoId = 0;\n\nexport const addTodo = (text) => (\n {\n type: 'ADD_TODO',\n id: todoId++,\n text\n }\n);\n\nexport const toggleTodo = ...
javascript
new_file
0
1
mit
81df543d5c85579952727d19d2d0b8599899584e
divyanshu013/impulse-tabs,divyanshu013/impulse-tabs
src/actions/index.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\n/* jshint node: true */\n\nmodule.exports = function(environment) {\n var ENV = {\n modulePrefix: 'dummy',\n environment: environment,\n baseURL: '/',\n locationType: 'auto',\n EmberENV: {\n FEATURES: {\n // ...
javascript
edit
0
4
mit
0f66ff21eca76d202572e2b2c804292b98f97fa2
minutebase/ember-dynamic-component,minutebase/ember-dynamic-component
tests/dummy/config/environment.js
rejected_duplicate
Near-duplicate of sample 68075
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\nJSONEditor.defaults.templates[\"default\"] = function() {\n return {\n compile: function(template) {\n var matches = template.match(/{{\\s*([a-zA-Z0-9\\-_\\.]+)\\s*}}/g);\n var l = matches.length;\n\n // Shortcut if t...
javascript
edit
0
4
mit
027d53e264619b5839e73cea53f4b7d25b24b9eb
LACabeza/json-editor,jdorn/json-editor,JJediny/json-editor,flibbertigibbet/json-editor,cunneen/json-editor,YousefED/json-editor,azavea/json-editor,flibbertigibbet/json-editor,ZECTBynmo/json-editor,ashwinrayaprolu1984/json-editor,timelyportfolio/json-editor,Tmeister/json-editor,grokify/json-editor,azavea/json-editor,abo...
src/templates/default.js
rejected_duplicate
Near-duplicate of sample 98115
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\n// objectifier\n\n\"use strict\"\n\n// readObject :: [String] -> [String] -> Object String a\nconst readObject = keys => values => {\n var i, obj, value\n\n obj = {}\n for (i = 0; i < keys.length; i++) {\n value = readValue(values...
javascript
edit
0
7
mit
77b56eb68780c1b5d650ff6ecec65de606d540fd
OrgVue/csv-parser
src/objectifier.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\nimport React from 'react';\nimport { BrowserRouter, Route, Switch } from 'react-router-dom';\n\nimport config from './config';\nimport routeConstants from './constants/routeConstants';\n\nimport Dashboard from './components/Dashboard';\...
javascript
edit
0
1
mit
e6817928854023b15842f9fb575e2e2202b2f1fe
leapfrogtechnology/chill-dashboard,leapfrogtechnology/chill-dashboard
src/routes.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\n#!/usr/bin/env node\n\nimport \"babel-polyfill\";\nimport yargs from \"yargs\";\n\nimport * as analyse from \"../commands/analyse\";\nimport * as measure from \"../commands/measure\";\n\nyargs\n .help(\"help\")\n .wrap(100)\n ....
javascript
edit
0
0
apache-2.0
0e1918abc188791976b57e0ff58e49382920950e
performeter/pfmt
src/bin/pfmt.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\nimport { utils } from \"stylelint\"\n\nexport const ruleName = \"extend-require-placeholder\"\n\nexport const messages = utils.ruleMessages(ruleName, {\n rejected: \"Use a placeholder selector (e.g. %some-placeholder) with @extend\",\n...
javascript
edit
0
1
mit
c5a9d228885d03370e854b706508938390a16b8c
kristerkari/stylelint-scss,dryoma/stylelint-scss
src/rules/extend-require-placeholder/index.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\nimport { get } from \"lodash-es\";\nimport React from \"react\";\nimport { connect } from \"react-redux\";\nimport { Icon, Panel } from \"../../base\";\n\nconst Welcome = props => {\n let version;\n\n if (props.version) {\n ...
javascript
edit
0
2
mit
7645a663bab5266ca1d89b6a07ebc756719760e0
igboyes/virtool,virtool/virtool,igboyes/virtool,virtool/virtool
client/src/js/home/components/Welcome.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\nrequirejs.config({\n paths: {\n jquery: \"/vendor/jquery\",\n }\n});\n\ndefine(['jquery'], function ($) {\n var _ = window._,\n Map = function(svg) {\n this.svg = $(svg);\n };\n\n var _mpro = Map.prototype;\n\n ...
javascript
edit
0
1
mit
4dee0a4ef58fca0abb1d040c372be83a17c66a4c
schatten/cartos,schatten/cartos
static/javascript/map.js
rejected_duplicate
Near-duplicate of sample 104777
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\nvar browsers = [\n [ 'chrome', /Chrom(?:e|ium)\\/([0-9\\.]+)(:?\\s|$)/ ],\n [ 'firefox', /Firefox\\/([0-9\\.]+)(?:\\s|$)/ ],\n [ 'opera', /Opera\\/([0-9\\.]+)(?:\\s|$)/ ],\n [ 'ie', /Trident\\/7\\.0.*rv\\:([0-9\\.]+)\\).*Gecko$/ ],\...
javascript
edit
0
1
mit
001c075f06c49ec3507328a0d0c936d26e1426ab
DamonOehlman/detect-browser,baribadamshin/detect-browser,DamonOehlman/detect-browser
browser.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\nModule.preRun = [\n function () \n {\n FS.mkdir('/test');\n FS.mount(NODEFS, { root: '../../Test/test' }, '/test');\n\n FS.mkdir('/resources');\n FS.mount(NODEFS, { root: './resources' }, '/resources');\n }\n]\n```\n\nApp...
javascript
edit
0
1
mit
a178efa101fa6b716e03dbc1a86fe9db68904a6d
Siv3D/OpenSiv3D,Siv3D/OpenSiv3D,Siv3D/OpenSiv3D,Siv3D/OpenSiv3D,Siv3D/OpenSiv3D,Siv3D/OpenSiv3D
Test/Siv3DTest.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\n/**\n * Run each test under ./integration, one at a time.\n * Each one will likely need to pollute global namespace, and thus will need to be run in a forked process.\n */\n\nvar fs = require('fs');\nvar files = fs.readdirSync(fs.realpa...
javascript
edit
0
1
mit
677cbf4b30eaed2ccb9621879ec42b3078e6446a
jay-depot/turnpike,jay-depot/turnpike
test/testIntegration.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\nexport default function createTypeAlias(j, flowTypes, { name, export } = { name: 'Props', export: false }) {\n const typeAlias = j.typeAlias(\n j.identifier(name), null, j.objectTypeAnnotation(flowTypes)\n );\n\n if (export) {\n ...
javascript
edit
0
2
mit
d38ffbb8e604b3cd23eece42137ed2925bbda3c2
billyvg/codemod-proptypes-to-flow
src/helpers/createTypeAlias.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\n// This file makes all join table relationships\nconst database = process.env.DB_DATABASE;\nconst dbHost = process.env.DB_HOST;\nconst dbUser = process.env.DB_USER;\nconst dbPassword = process.env.DB_PASS;\nconst Sequelize = require('se...
javascript
edit
0
0
mit
c35ffdfa5adfa42ac7db1e6475fae2687794aea7
francoabaroa/escape-reality,francoabaroa/escape-reality,lowtalkers/escape-reality,lowtalkers/escape-reality
db/models/index.js
rejected_duplicate
Near-duplicate of sample 76409
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\n/**\n * @file\n * Run validation by CLI\n */\nvar Q = require('q');\n\nvar getOptions = require('../actions/cli/get-options');\nvar suppressMessages = require('../actions/suppress');\nvar validateByW3c = require('../actions/validate-by-...
javascript
edit
0
2
mit
1c00703a3ac96f44da886596dbb1db50ab79069f
andre487/feed-validator,Andre-487/feed-validator,andre487/feed-validator,Andre-487/feed-validator
cli/run.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\nimport Ember from 'ember';\nimport { test } from 'qunit';\nimport moduleForAcceptance from '../../tests/helpers/module-for-acceptance';\n\nconst { get } = Ember;\n\nmoduleForAcceptance('Acceptance | simple relationships', {\n beforeEac...
javascript
edit
0
1
mit
cb5b6c72bffc569c2511af72c309b91dbd308c64
amiel/ember-data-url-templates,amiel/ember-data-url-templates
tests/acceptance/simple-relationships-test.js
accepted
null
true