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\nvar Sails = require('sails');\r\n\r\nbefore(function (done) {\r\n Sails.lift({\r\n //config\r\n }, function (err, sails) {\r\n if (err) return done(err);\r\n // load fixtures, etc\r\n done (err, sails);\r\n });\r\n});\r\n... | javascript | edit | 0 | 2 | apache-2.0 | 0f3c7f95b03b5e6b3b731158185ae12078c9b606 | section-io-gists/vclfiddle,vclfiddle/vclfiddle,vclfiddle/vclfiddle,vclfiddle/vclfiddle,vclfiddle/vclfiddle,section-io-gists/vclfiddle,section-io-gists/vclfiddle,section-io-gists/vclfiddle | web/test/bootstrap.test.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nvar _ = require('underscore');\nvar fs = require('fs');\n\nfunction Config(filePath) {\n var data = this.parse(filePath);\n this.validate(data);\n return Object.freeze(data);\n}\n\nConfig.prototype.parse = function(filePath) {\n var... | javascript | edit | 0 | 2 | mit | 63d2829207a9968412fb332371774f3c1ca00601 | vogdb/pulsar-rest-api-client-node,cargomedia/pulsar-rest-api-client-node | src/config.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nimport React from 'react';\nimport { mount, shallow } from 'enzyme';\nimport App from './App';\nimport TimeTable from 'timetablescreen';\n\ndescribe('App', () => {\n\tbeforeEach( () => {\n\t\tObject.defineProperty(window.location, 'href... | javascript | edit | 0 | 1 | mit | ab050e711d90495e23b8b887df2a3dc58dae6ba3 | kangasta/timetablescreen,kangasta/timetablescreen | app/src/App.test.js | accepted | null | true |
[
{
"role": "user",
"content": "Write javascript code for the following: Add imports to test suite"
},
{
"role": "assistant",
"content": "GLOBAL.projRequire = function (module) {\n\treturn require('../' + module);\n};\n\nconst log = projRequire('lib');\nconst tc = require('test-console');\ncons... | javascript | new_file | 0 | 1 | mit | 5609d591ab892348b17f0bccef800dcd46ca431f | cuvva/cuvva-log-sentry-node,TheTree/branch,TheTree/branch,TheTree/branch | test/index.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n'use strict'\n\n/**\n * @class Elastic\n */\nvar Elastic = {\n klass : klass,\n domain: {\n Layout : LayoutDomain,\n View : ViewDomain,\n Compontnt: ComponentDomain\n },\n exception: {\n Runtime : RuntimeException... | javascript | edit | 0 | 1 | mit | 58b4a325f06e178c398d96513f5ac7bd69ad0b1e | ahomu/Elastic | src/export.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nvar test = require('tape');\nvar robot = require('..');\nvar lastKnownPos, currentPos;\n\ntest('Get the initial mouse position.', function(t) \n{\n\tt.plan(3);\n\tt.ok(lastKnownPos = robot.getMousePos(), 'successfully retrieved mouse po... | javascript | edit | 0 | 1 | mit | 66b31b6659968968d3354fb5d114c77b72aac6af | hristoterezov/robotjs,BHamrick1/robotjs,BHamrick1/robotjs,hristoterezov/robotjs,hristoterezov/robotjs,hristoterezov/robotjs,octalmage/robotjs,BHamrick1/robotjs,octalmage/robotjs,BHamrick1/robotjs,octalmage/robotjs,octalmage/robotjs | test/mouse.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n/**\n * Core constants.\n *\n * Site Kit by Google, Copyright 2021 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obt... | javascript | edit | 0 | 0 | apache-2.0 | 6fad96e50890876712c69221a0cc372a2533a4ed | google/site-kit-wp,google/site-kit-wp,google/site-kit-wp,google/site-kit-wp | assets/js/googlesitekit/constants.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n(function () {\n 'use strict';\n\n function fetchPonyfill(options) {\n var Promise = options && options.Promise || self.Promise;\n var XMLHttpRequest = options && options.XMLHttpRequest || self.XMLHttpRequest;\n var global = ... | javascript | edit | 0 | 5 | mit | 578355c255e533622462c49d2a10b5e2fb5dc029 | qubyte/fetch-ponyfill,qubyte/fetch-ponyfill | fetch-browser.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nimport express from \"express\"\nimport graphqlHTTP from \"express-graphql\"\nimport { graphqlExpress, graphiqlExpress } from \"graphql-server-express\"\nimport bodyParser from \"body-parser\"\nimport mongoose, { Schema } from \"mongoos... | javascript | edit | 0 | 1 | mit | 3bfcbc3ce266e873e43b8faf15d7b9ca87e6a094 | DevNebulae/ads-pt-api | src/server.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n/*\n * Initialize the Restify server.\n */\n\nvar restify = require('restify');\nvar config = require('./config');\nvar routes = require('./routes');\nvar log = require('./logging').getLogger();\n\nexports.create = function () {\n var ... | javascript | edit | 0 | 2 | mit | 932c3d27364eb4cfb09189f90afb92c8bfeaa07c | deconst/content-service,deconst/content-service | src/server.js | accepted | null | true |
[
{
"role": "user",
"content": "Write javascript code for the following: Create an index object that points to a JSON file"
},
{
"role": "assistant",
"content": "var fs = require('fs');\n\nfunction Index(){\n\t'use strict'\n\t\n\tthis.createIndex = function(filePath){\n\t\tfs.readFile(filePath , f... | javascript | new_file | 0 | 1 | mit | b4dddaee7e2f449d65302009eb90c0ff608f6029 | andela-jwarugu/checkpoint-1,andela-jwarugu/checkpoint-1 | jasmine/src/inverted-index.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n\"use strict\";\n\nvar Response = function(error, res) {\n res = res || {};\n this.raw = res.body;\n this.headers = res.headers;\n this.status = res.statusCode || 500;\n\n if (error) {\n this._error = { error: (res... | javascript | edit | 0 | 7 | mit | 86f7ec4efb24be276590df7c2304065a1b81027a | skazska/m2x-nodejs,attm2x/m2x-nodejs | lib/response.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nTemplate.postsList.helpers({\n posts: function() {\n return Posts.find();\n }\n});\n```\n\nApply this change: Sort posts by submitted timestamp."
},
{
"role": "assistant",
"content": "Template.postsList.helpers({\n pos... | javascript | edit | 0 | 1 | mit | feff95896d5d0168943a5ef727733df371f99932 | drainpip/music-management-system,drainpip/music-management-system | app/client/templates/posts/posts_list.js | rejected_duplicate | Near-duplicate of sample 71801 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nimport str from '../src/jsturbo-string'\n\nfunction toStringDMY (date) {\n return [\n str.pad(date.getDate().toString(), 2),\n str.pad((date.getMonth() + 1).toString(), 2),\n str.pad(date.getFullYear().toString(), 4)\n ].join... | javascript | edit | 0 | 1 | mit | 9a3be57d1ea6a2cd88a6e0f029405be65bb305e1 | eduardoportilho/jsturbo | src/jsturbo-date.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nvar log4js = require('log4js');\nvar logger = log4js.getLogger('BOT-LOG');\n\nfunction updateUserList(dyDb, userId){\n\n}\n\nmodule.exports = {\n\tupdateUserList:updateUserList\n}\n\n```\n\nApply this change: Add listTables part into up... | javascript | edit | 0 | 2 | mit | f36b511e9b9fc339a11c8c8acc758dc05009622c | dollars0427/mtrupdate-bot | lib/database.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nexport default {\n today: 'I dag',\n now: 'Nu',\n backToToday: 'Tilbage til i dag',\n ok: 'Ok',\n clear: 'Annuler',\n month: 'Måned',\n year: 'År',\n timeSelect: 'Vælg tidspunkt',\n dateSelect: 'Vælg dato',\n monthSelect: 'Væl... | javascript | edit | 0 | 0 | mit | c82b074e557835334e50276a1f25e98b4567d7e8 | react-component/calendar,react-component/calendar | src/locale/da_DK.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nlet Vue = require('../../node_modules/vue/dist/vue.min');\n\nlet template = '<div style=\"border-radius: 4px; margin:5px; color: #31708f;background-color: #d9edf7; border: 1px solid #bce8f1;text-align: center\">' +\n '<p>{{ message }... | javascript | edit | 0 | 0 | mit | 5fd1908efa1add699d7a5169c8f05a64ec43f27b | funcoding/vuetron-mail,funcoding/vuetron-mail | src/global-components/info.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nimport BiwaScheme from \"./main.js\";\nBiwaScheme.on_node = false;\n\nimport Console from \"./platforms/browser/console.js\"\nBiwaScheme.Console = Console;\n\nimport { current_input, current_output, current_error } from \"./platforms/br... | javascript | edit | 0 | 0 | mit | fbeb60a6f9aefe23ae8c678b601c321166042bf8 | biwascheme/biwascheme,biwascheme/biwascheme,biwascheme/biwascheme | src/main-browser.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nimport App from '../containers/App'\n\nfunction createRedirect(from, to) {\n return {\n path: from,\n onEnter(nextState, replaceState) {\n replaceState(nextState, to)\n },\n }\n}\n\nconst routes = [\n createRedirect('/'... | javascript | edit | 0 | 1 | mit | 3061897a2508c1226dcd1a153542539cdf17fdaa | ello/webapp,ello/webapp,ello/webapp | src/routes/index.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nvar express = require('express');\nvar os = require('os');\n\nvar router = express.Router();\nvar ifaces = os.networkInterfaces();\nvar localAddress = '';\nvar environment = process.env.NODE_ENV === 'production' ? 'production' : 'develo... | javascript | edit | 0 | 4 | mit | 3b850511df407a35f803118ca14c78b7e240cb8f | lrakai/docker-software-delivery,lrakai/docker-software-delivery,lrakai/docker-software-delivery | src/routes/index.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n'use strict';\n\nrequire('../examples/demo-only-stuff/docs');\nvar expect = require('chai').expect;\nvar sinon = require('sinon');\nvar stub = sinon.stub;\nvar utils = require('./helpers/utils');\nvar each = utils.each;\nvar any = utils... | javascript | edit | 0 | 2 | mit | 0c9680bfad90854bc47409466afd77c3f28f62d5 | JakeSidSmith/canvasimo,JakeSidSmith/sensible-canvas-interface,JakeSidSmith/canvasimo | tests/docs.js | rejected_duplicate | Near-duplicate of sample 102284 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nmiqHttpInject(\n angular.module('ManageIQ.toolbar', [\n 'miqStaticAssets', 'ui.bootstrap'\n ])\n .config(['$locationProvider', function ($locationProvider) {\n $locationProvider.html5Mode({\n enabled: true,\n requireB... | javascript | edit | 0 | 1 | apache-2.0 | 5c23d7fc54a8f960340d2f8989a7e4a1da7c362b | kbrock/manageiq,ManageIQ/manageiq,branic/manageiq,mresti/manageiq,NaNi-Z/manageiq,andyvesel/manageiq,tinaafitz/manageiq,agrare/manageiq,billfitzgerald0120/manageiq,durandom/manageiq,jvlcek/manageiq,jrafanie/manageiq,jameswnl/manageiq,juliancheal/manageiq,mzazrivec/manageiq,mresti/manageiq,ailisp/manageiq,mfeifer/manage... | app/assets/javascripts/angular_modules/module_toolbar.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nimport { reaction, runInAction } from 'mobx';\nimport { SettingsWSStore } from './store';\nimport state, { resetState } from './state';\n\nconst debug = require('debug')('Franz:feature:settingsWS');\n\nlet store = null;\n\nexport defaul... | javascript | edit | 0 | 3 | apache-2.0 | 6aea1d4c7d3f7ca44356bc8186fb662483580fa9 | meetfranz/franz,meetfranz/franz,meetfranz/franz | src/features/settingsWS/index.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nconst path = require('path');\nconst fs = require('fs');\nconst sass = require('node-sass');\nconst { promisify } = require('util');\nconst mkdirp = require('mkdirp');\nconst renderAsPromised = promisify(sass.render);\nconst writeFileAs... | javascript | edit | 0 | 2 | apache-2.0 | 4a937b4779f1f8357a0da777846ce5e406222721 | stryker-mutator/stryker-mutator.github.io,stryker-mutator/stryker-mutator.github.io,stryker-mutator/stryker-mutator.github.io,stryker-mutator/stryker-mutator.github.io | tasks/grunt-sass.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n'use strict';\n\nangular.module('lightweight').controller('CheckoutAsGuestController',\n ['$scope', '$rootScope', '$location', '$state', '$timeout', '$stateParams', '$window', 'Global', 'UserService','CartService',\n function($sco... | javascript | edit | 0 | 3 | mit | daa5604ff4397caf02158634803d9a50e3b179a9 | shaishab/BS-Commerce,shaishab/BS-Commerce,shaishab/BS-Commerce | public/themes/lightweight/controllers/cart/checkout.as.guest.controller.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nconst DB = require('./Persistence/database');\nrequire('dotenv').config();\nconst App = require('./app');\n\nDB.init().then((db) => {\n App(db).listen(3000);\n});\n\n```\n\nApply this change: Add support for port changing"
},
{
... | javascript | edit | 0 | 1 | mit | 86d78236569bda8954e157576be7cbdd3078ded2 | RossCasey/SecureDrop,RossCasey/SecureDrop | src/server/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 | 5b9936a84f03a49585d8a5570936b15ed2cff387 | gloit/gloit-component,gloit/gloit-component | tests/dummy/config/environment.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nconst expect = require('chai').expect;\nconst Room = require('../../src/rooms').Room;\nconst Doors = require('../../src/doors').Doors;\nconst Mocks = require('../mocks/mocks.js');\n\nconst testRoom = new Room(Mocks.Room);\n\ndescribe('D... | javascript | edit | 0 | 1 | mit | 03a1b9af8f4fcaa85534e3889a61ea395e5aa19d | seanohue/ranviermud,shawncplus/ranviermud,seanohue/ranviermud | test/src/doors.spec.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\npref(\"extensions.torbirdy.protected\", false);\npref(\"extensions.torbirdy.proxy\", 0);\npref(\"extensions.torbirdy.first_run\", true);\npref(\"extensions.torbirdy.warn\", true);\n\n```\n\nApply this change: Update the preferences to r... | javascript | edit | 0 | 0 | bsd-2-clause | 6a359323b5a4b3a4630f65bfb62e1ed531ac01c7 | ioerror/torbirdy,viggyprabhu/torbirdy,kartikm/torbirdy,DigiThinkIT/TorBirdy,kartikm/torbirdy,u451f/torbirdy,infertux/torbirdy,u451f/torbirdy,ioerror/torbirdy,viggyprabhu/torbirdy,infertux/torbirdy,DigiThinkIT/TorBirdy | defaults/preferences/prefs.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nvar mongoose = require('mongoose');\n\nvar UserSchema = new mongoose.Schema({\n\tfname: String,\n\tlname: String,\n\tusername: String,\n\tpassword: String,\n\tsalt: String\n});\n\nmongoose.model('User', UserSchema);\n```\n\nApply this c... | javascript | edit | 0 | 1 | mit | ed6107f6bcf6dd0bbf917947d67d35a0a58e85c0 | zachloubier/stocks,zachloubier/stocks | models/Users.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n'use strict';\n\nvar request = require('request');\nvar Q = require('q');\nvar config = require('../config');\n\nconst plugins = require('../../plugins');\nconst geoTagController = plugins.getFirst('geo-tag-controller');\nif(!geoTagCont... | javascript | edit | 0 | 3 | mit | 9ccff0afcc20c515804a38e8828317451b15e1bd | CopenhagenCityArchives/kbh-billeder,CopenhagenCityArchives/kbh-billeder,CopenhagenCityArchives/kbh-billeder | lib/controllers/geo-tagging.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n'use strict';\n\nvar app = require('../../app');\nvar should = require('should');\nvar request = require('supertest')(app);\n\ndescribe('No controller home', function() {\n\tit('Must return status 200 when doing GET', function(done... | javascript | edit | 0 | 1 | mit | 8fe68b5a70a10d742d39992714f3b80ca620f88e | brenopolanski/coffee-club,brenopolanski/coffee-club | tests/requests/home.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n'use strict';\n\nvar WM = require('es6-weak-map');\nvar hasNativeWeakMap = require('es6-weak-map/is-native-implemented');\n\n// WeakMap for storing metadata\nvar metadata = hasNativeWeakMap ? new WeakMap() : new WM();\n\nmodule.exports ... | javascript | edit | 0 | 0 | mit | 7f076bd1b43cc53b172c353cf24ee274ea7b5db3 | phated/undertaker,gulpjs/undertaker | lib/helpers/metadata.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n\nfunction HomeController($scope) {\n\n}\n\nfunction ProjectsController($scope, Restangular) {\n var allProjects = Restangular.all('projects');\n allProjects.getList().then(function(projects) {\n $scope.projects = projects;... | javascript | edit | 0 | 1 | mit | 157f5524db00970c99cb91e5e1f65e0be31fb245 | materials-commons/materials,materials-commons/materials | website/app/js/controllers.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nvar Templates = {};\n\nTemplates.ItemListingTemplate = _.template('\\\n\t<div class=\"item media\">\\\n\t\t<img class=\"pull-left\" src=\"<%= imageUrl %>\" />\\\n\t\t<div class=\"media-body\">\\\n\t\t\t<h3 class=\"media-heading\"><%= na... | javascript | edit | 0 | 0 | mit | d962869bf6059568f39d4c8b5af801cfdcf30d0b | burnflare/CrowdBuy,burnflare/CrowdBuy | js/templates.js | rejected_duplicate | Near-duplicate of sample 96558 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n//var thinky = require('thinky');\nvar thinky = require('/home/michel/projects/thinky/lib/index.js');\nvar config = require('./config');\n\n// Initialize thinky\n// The most important thing is to initialize the pool of connection\nthink... | javascript | edit | 0 | 0 | mit | 9d7b781e57e885233eb5a16e6809ed528d0abe87 | gutenye/thinky-websocket,JohnyDays/thinky,soplakanets/thinky,rasapetter/thinky,mbroadst/thinky,bprymicz/thinky,JohnyDays/thinky,gutenye/thinky-websocket,davewasmer/thinky,gjuchault/thinky,soplakanets/thinky,davewasmer/thinky,gutenye/thinky-websocket,rasapetter/thinky | examples/blog/thinky.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nmodule.exports = function(conn) {\n return {\n list: function(businessId, callback) {\n conn.get('/users?businessId=' + businessId, callback);\n }\n }\n};\n\n```\n\nApply this change: Add a wrapper method for retrieving the... | javascript | edit | 0 | 1 | mit | 6caba9f16599101ddf710aa4f322865341582c11 | ventres/foodlogiq-node,FoodLogiQ/foodlogiq-node | lib/foodlogiq-client/users.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n//= require \"lib/moment.min\"\n//= require \"lib/jquery-2.0.3\"\n//= require \"lib/handlebars-v1.1.2\"\n//= require \"lib/ember\"\n//= require \"lib/ember-data\"\n//= require_self\n//= require \"models\"\n//= require \"views\"\n//= req... | javascript | edit | 0 | 1 | mit | 13752fc80af365ae8c80effd323c8ea2e9bb637f | louishawkins/mogo-chat,HashNuke/mogo-chat,sashafklein/bloc-mogo,di-stars/mogo-chat,louishawkins/mogo-chat,sashafklein/bloc-mogo,di-stars/mogo-chat,HashNuke/mogo-chat,HashNuke/mogo-chat,sashafklein/bloc-mogo,di-stars/mogo-chat,louishawkins/mogo-chat | assets/javascripts/application.js | rejected_duplicate | Near-duplicate of sample 93261 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nApp.ChartEditController = App.AuthenticationController.extend({\n actions: {\n registerQuery: function() {\n console.log('registering a query');\n var chart = this.get('model');\n chart.save();\n }\n }\n});\n```\n... | javascript | edit | 0 | 1 | apache-2.0 | 224c56ed7da455e9ec8105e6efd088a4cd8eade2 | with-regard/regard-website | portal/js/controllers/ChartEditController.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nimport React from 'react'\nimport ReactDOM from 'react-dom'\nimport DefaultProps from '../default_props.js'\n\nexport default class Form extends React.Component {\n static displayName = 'FriggingBootstrap.Form'\n\n static defaultProps... | javascript | edit | 0 | 2 | mit | 28415ab520751159162e15d42b205352c6ce1e73 | frig-js/frigging-bootstrap,frig-js/frigging-bootstrap | src/js/components/form.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nconst $ = require('jquery');\n\nfunction DisplayMessage(){\n}\n\nDisplayMessage.prototype.showWinMessage = function(){\n var div = $('#post-game');\n div.empty()\n .show()\n .append(`<h1>You Win!</h1>\n <p>Click t... | javascript | edit | 0 | 1 | mit | ce8df49212f484ef04b03225b02db5f519b12113 | plato721/lights-out,plato721/lights-out | lib/display-message.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nvar express = require('express'),\n schedule = require('node-schedule'),\n cacheService = require('./cache-service.js')(),\n app = express(),\n dataCache = {\n news: null,\n weather: null\n };\n\nsetUpSched... | javascript | edit | 0 | 1 | mit | 3916cb06b6c1d8694eceb25534e67bcd2830ebb2 | AlexanderAntov/scraper-js,AlexanderAntov/scraper-js | app.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nvar Express = require('express');\nvar webpack = require('webpack');\n\nvar config = require('../src/config');\nvar webpackConfig = require('./dev.config');\nvar compiler = webpack(webpackConfig);\n\nvar host = process.env.HOST || 'loca... | javascript | edit | 0 | 2 | mit | c2540b1a40dc84699d3f8debc3ca7cb086f2acf5 | Boelensman1/championpick2 | webpack/webpack-dev-server.js | rejected_duplicate | Near-duplicate of sample 91391 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nimport { createElement as ce } from 'react';\n\nconst connectTypes = require('../../../../json/ConnectionTypes.json');\n\nconst ConnectionLinks = ({ name: memberName, connections }) => (\n ce('div', { className: 'btn-toolbar' },\n c... | javascript | edit | 0 | 2 | mit | d1e7f6719926b94cef11f276e1c13ec04adf59c4 | jkoudys/janeswalk-web,jkoudys/janeswalk-web,jkoudys/janeswalk-web | themes/janeswalk/js/components/pages/Walk/Team/ConnectionLinks.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n//@flow\n\nimport styled, { css } from \"styled-components\";\n\nexport const Wrapper = styled.div`\n\n ${({ theme }: { theme: Theme }) => css`\n\n box-sizing: border-box;\n position: relative;\n width: 100%;\n background-c... | javascript | edit | null | null | mit | 687b8066a908dc6a9bbd4c184e143981dec5493a | slightly-askew/portfolio-2017,slightly-askew/portfolio-2017 | src/features/header/header-main/styled-components/Wrapper.js | rejected_syntax | Syntax error detected by tree-sitter | false |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n#!/usr/bin/node\n\nvar convert = require('../'),\n fs = require('fs'),\n geojson = JSON.parse(fs.readFileSync(process.argv[2])),\n mtl = process.argv[3],\n mtllibs = process.argv.slice(4),\n options = {\n coordToPo... | javascript | edit | 0 | 2 | isc | 78826dbdb3e81b084918f550c34527652f8d5de7 | perliedman/geojson2obj | examples/cli.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n'use strict';\n\nvar _ = require('lodash');\nvar fs = require('fs');\nvar path = require('path');\nvar api = require('../api');\n\nfunction arrayToQueryString(args) {\n var searchString = '?q=' + args._.join('+');\n if (args.user) {\n... | javascript | edit | 0 | 3 | mit | 97e271d4db24cbc89d367d19c6a65ae402972c8e | stillesjo/buh | lib/commands/search.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n'use strict';\n\nfunction Helpers() {\n}\n\nHelpers.prototype = {\n getClassesFromSelector: function (selector) {\n if (!selector) {\n return [];\n }\n var classRegEx = /[_a-zA-Z\\*][_a-zA-Z0-9-]*/g;\n... | javascript | edit | 0 | 2 | mit | 1f59f1a7b1a1a5a3346c3f607a20309d332fd3ac | timeinfeldt/grunt-csschecker,timeinfeldt/grunt-csschecker | lib/helpers/helpers.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nvar async = require(\"async\");\nvar bay6 = require(\"../lib/\");\nvar expect = require(\"chai\").expect;\nvar mongoose = require(\"mongoose\");\nvar request = require(\"supertest\");\n\ndescribe(\"Model\", function() {\n var app;\n v... | javascript | edit | 0 | 2 | mit | 56d7dc2661360d21325ac94338556036c774eb1a | simplyianm/bay6 | test/model.js | rejected_duplicate | Near-duplicate of sample 70789 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nexpress = require('express')\nexpressValidator = require('express-validator')\n\nmodule.exports = (function(){\n function configure(app) {\n app.set('port', process.env.PORT || 3000);\n app.set('host', process.env.HOST || '127.0.... | javascript | edit | 0 | 3 | isc | 18957b36ddcd96b41c8897542609c53c166052c3 | zealord/gatewayd,crazyquark/gatewayd,xdv/gatewayd,xdv/gatewayd,Parkjeahwan/awegeeks,whotooktwarden/gatewayd,Parkjeahwan/awegeeks,crazyquark/gatewayd,whotooktwarden/gatewayd,zealord/gatewayd | config/initializers/middleware.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n'use strict';\n\nvar angular = require('angular');\nvar expect = require('chai').use(require('sinon-chai')).expect;\nvar sinon = require('sinon');\nvar sap = require('sinon-as-promised');\n\ndescribe('animate-change', function ()... | javascript | edit | 0 | 1 | mit | 843c48748261d44331f81ac915621766ce5ca0b6 | bendrucker/angular-animate-change,bendrucker/angular-animate-change | test/index.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nmodule.exports = HtmlFile;\n\nfunction HtmlFile(path) {\n this.path = path;\n}\n\nHtmlFile.prototype.querySelectorAll = function(ph, style, cb) {\n var _this = this;\n return new Promise(function(resolve) {\n ph.createPage(functio... | javascript | edit | 0 | 1 | mit | b1aaf8485740f65770acb7b9a20ca9e35c37b9ad | sinsoku/clairvoyance,sinsoku/clairvoyance | lib/htmlfile.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nconst {Initializer, api} = require('actionhero');\nconst r = require('@lib/r');\n\nmodule.exports = class ApiInitializer extends Initializer {\n constructor() {\n super();\n this.name = 'api-initializer';\n }\n\n ... | javascript | edit | 0 | 1 | mit | 4b14f7745c20c489cb8ee554ee98fbcde2058832 | materials-commons/materialscommons.org,materials-commons/materialscommons.org,materials-commons/materialscommons.org,materials-commons/materialscommons.org,materials-commons/materialscommons.org | backend/servers/mcapid/initializers/api.js | rejected_duplicate | Near-duplicate of sample 94579 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n'use strict';\nconst fs = require('fs');\nconst gulp = require('gulp');\nconst rsync = require('gulp-rsync');\n\n// 'gulp deploy' -- reads rsync credentials file and incrementally uploads site to server\ngulp.task('upload', () => {\... | javascript | edit | 0 | 1 | mit | ceb264e849abfddfb250de15c78b78007287d83e | blogtips/blogtips.github.io,mmistakes/made-mistakes-jekyll,mmistakes/made-mistakes-jekyll,blogtips/blogtips.github.io,mmistakes/made-mistakes-jekyll,blogtips/blogtips.github.io | gulp/tasks/uploading.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n'use strict';\n\nvar bpack = require('browser-pack');\nvar fs = require('fs');\nvar path = require('path');\nvar xtend = require('xtend');\n\nvar preludePath = path.join(__dirname, 'prelude.js');\nvar prelude = fs.readFileSync(preludePa... | javascript | edit | 0 | 1 | mit | 5762d478a22bb76807e3b92a3b881c42686b3b69 | royriojas/browsyquire,royriojas/proxyquireify,royriojas/browsyquire,royriojas/proxyquireify,thlorenz/proxyquireify | lib/replace-prelude.js | rejected_duplicate | Near-duplicate of sample 86120 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n/*\n * TSV\n * Module for parsing TSV (and eventually other formats)\n */\n\nconst trimSplit = separator => str => str.trim().split(separator)\nconst isContentfulRow = row => row && !/^\\s*$/.test(row)\n\nfunction parseTSV(contents) {\n... | javascript | edit | 0 | 2 | mit | 717722bb2a343c00fa00980fcee67717279b6264 | nellh/bids-validator,nellh/bids-validator,Squishymedia/BIDS-Validator,Squishymedia/bids-validator,nellh/bids-validator | bids-validator/validators/tsv/tsvParser.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nvar STATE = (function(){\n var FILE;\n var MSGS;\n \n var selectedChannel;\n \n return {\n uploadFile: function(file){\n FILE = file;\n MSGS = null;\n },\n \n getChannelList: function(){\n var channels =... | javascript | edit | 0 | 5 | mit | 7af9ca83021937683ab538c355b1e6a1a2c8cd8d | chylex/Discord-History-Tracker,chylex/Discord-History-Tracker,chylex/Discord-History-Tracker,chylex/Discord-History-Tracker,chylex/Discord-History-Tracker,chylex/Discord-History-Tracker | src/renderer/scr.state.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nimport Ember from \"ember\";\nexport default Ember.Component.extend({\n classNames: ['liquid-child'],\n attributeBindings: ['style'],\n style: Ember.computed('visible', function() {\n return new Ember.Handlebars.SafeString(this.ge... | javascript | edit | 0 | 4 | mit | f157ca1c747d48ba416ec2896d2153c25ce2a8a8 | ember-animation/liquid-fire-core,byelipk/liquid-fire,davewasmer/liquid-fire,ianstarz/liquid-fire,envoy/liquid-fire,csantero/liquid-fire,ember-animation/liquid-fire-velocity,ember-animation/ember-animated,jamesreggio/liquid-fire,ember-animation/liquid-fire-velocity,jayphelps/liquid-fire,acorncom/liquid-fire,chadhietala/... | app/components/liquid-child.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nvar selftest = require('../tool-testing/selftest.js');\nvar Sandbox = selftest.Sandbox;\n\nselftest.define(\"dynamic import(...) in development\", function () {\n const s = new Sandbox();\n s.createApp(\"dynamic-import-test-app-devel\... | javascript | edit | 0 | 2 | mit | f9de0a7b6535fe2a3129db0a886f6f9cae8d2930 | Hansoft/meteor,Hansoft/meteor,Hansoft/meteor,Hansoft/meteor,Hansoft/meteor,Hansoft/meteor,Hansoft/meteor | tools/tests/dynamic-import.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nimport Trigger from 'ember-basic-dropdown/components/basic-dropdown/trigger';\n\nexport default Trigger.extend({\n didOpen: false,\n\n didReceiveAttrs() {\n let dropdown = this.get('dropdown');\n let oldDropdown = this.get('oldD... | javascript | edit | 0 | 4 | mit | 259d0c00fefb67aeded6f1f1831fbc6784d9fb2a | cibernox/ember-basic-dropdown,cibernox/ember-basic-dropdown,cibernox/ember-basic-dropdown,cibernox/ember-basic-dropdown | tests/dummy/app/components/trigger-with-did-receive-attrs.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n/*\n * Copyright (C) 2013 salesforce.com, inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n ... | javascript | edit | 0 | 2 | apache-2.0 | 41de713c677477bae0548bd9b17c5edb100bc53b | forcedotcom/aura,madmax983/aura,forcedotcom/aura,madmax983/aura,forcedotcom/aura,madmax983/aura,madmax983/aura,forcedotcom/aura,forcedotcom/aura,madmax983/aura,madmax983/aura | aura-components/src/main/components/ui/abstractList/abstractListRenderer.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n/**\n * Jasmine test to check success callback\n */\ndescribe('stan-loader-ok', function() {\n\n\t// Declare status var\n\tvar status;\n\n\t// Activate async\n\tbeforeEach(function(done) {\n\n\t\t// Initiate $STAN loader using normal wi... | javascript | edit | 0 | 1 | apache-2.0 | 10f4293f4ac9ec29d80ddcaaae9cf31f1b054fed | awomersley/stan-loader,awomersley/stan-loader | tests/test-load-ok.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nvar Assert = require('assert');\nvar CacheAllTheThings = require('../');\n\ndescribe('CacheAllTheThings', function() {\n\n it('When asked to boot a Redis instance, it should do so', function() {\n var inst = new CacheAllT... | javascript | edit | 0 | 1 | mit | ce52b37873c55045b97c4288e9d6b8dfdd3a03f8 | andrewhathaway/CacheAllTheThings,andrewhathaway/CacheAllTheThings | test/testCacheAllTheThings.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n/**\n * A worker will listen for jobs on the job queue, and execute them.\n */\nvar async = require('async');\n\nfunction bootstrapWorker (api, config, next) {\n\n var follower = function (cb) {\n api.messaging.listen('seguir-publis... | javascript | edit | 0 | 2 | mit | bf3f03acdfcc7ddb98c820282af6ec5b7ae5c2d9 | tes/seguir,cliftonc/seguir | server/worker/index.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nimport * as Metrics from 'new-dashboard/core/metrics';\nimport store from 'new-dashboard/store';\n\ndescribe('Internal Metrics Tracker', () => {\n describe('sendMetric', () => {\n beforeEach(() => {\n global.fetch = jest.fn();\... | javascript | edit | 0 | 1 | bsd-3-clause | 2a26cba118a63f53321f9285351fa8a1a9ad9484 | CartoDB/cartodb,CartoDB/cartodb,CartoDB/cartodb,CartoDB/cartodb,CartoDB/cartodb | lib/assets/test/spec/new-dashboard/unit/specs/core/metrics.spec.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nPackage.describe({\n summary: \"Update the client when new client code is available\",\n version: '1.1.4'\n});\n\nCordova.depends({\n 'org.apache.cordova.file': '1.3.2',\n 'org.apache.cordova.file-transfer': '0.4.8'\n});\n\nPackage.... | javascript | edit | 0 | 1 | mit | 3ea31603656b25b7d8a6903f432a4d321067cc8a | pandeysoni/meteor,benstoltz/meteor,benjamn/meteor,kengchau/meteor,tdamsma/meteor,ljack/meteor,justintung/meteor,AnjirHossain/meteor,juansgaitan/meteor,somallg/meteor,DAB0mB/meteor,namho102/meteor,jrudio/meteor,calvintychan/meteor,neotim/meteor,chmac/meteor,evilemon/meteor,brettle/meteor,shmiko/meteor,meteor-velocity/me... | packages/autoupdate/package.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n'use strict';\n\nvar http = require('http'),\n spotify = require('spotify-node-applescript');\n\nvar cb = function(request, response) {\n\n debugger;\n\n response.writeHead(200, {'Content-Type': 'text/html'});\n response.write('He... | javascript | edit | 0 | 1 | mit | 809b449002671226018fbd2e9d3285e6e7037ea0 | ilkka/spotkula-server | server/index.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nimport {Entity} from 'draft-js';\n\nexport default (config) => (contentBlock, getEditorState, updateEditorState) => {\n const type = contentBlock.getType();\n if (type === 'image') {\n const entityKey = contentBlock.getEntityAt(0);... | javascript | edit | 0 | 3 | mit | 361524e620348e32061165c02290f04a305cfa76 | dagopert/draft-js-plugins,draft-js-plugins/draft-js-plugins,nikgraf/draft-js-plugin-editor,dagopert/draft-js-plugins,dagopert/draft-js-plugins,draft-js-plugins/draft-js-plugins-v1,nikgraf/draft-js-plugin-editor,draft-js-plugins/draft-js-plugins-v1,draft-js-plugins/draft-js-plugins,koaninc/draft-js-plugins,koaninc/draft... | draft-js-dnd-plugin/src/blockRendererFn.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nPackage.describe({\n summary: \"Makes your Cordova application use the Crosswalk WebView \\\ninstead of the System WebView on Android\",\n version: '1.4.1-rc.1',\n documentation: null\n});\n\nCordova.depends({\n 'cordova-plugin-cros... | javascript | edit | 0 | 0 | mit | 0cebcf119713d523a27fb54fa0bf1f1afe4eb267 | nuvipannu/meteor,jdivy/meteor,AnthonyAstige/meteor,Hansoft/meteor,AnthonyAstige/meteor,nuvipannu/meteor,nuvipannu/meteor,AnthonyAstige/meteor,DAB0mB/meteor,nuvipannu/meteor,chasertech/meteor,AnthonyAstige/meteor,Hansoft/meteor,DAB0mB/meteor,DAB0mB/meteor,4commerce-technologies-AG/meteor,mjmasn/meteor,mjmasn/meteor,chas... | packages/crosswalk/package.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nimport React from 'react'\nimport PieChart from '../../Charts/PieChart/PieChart'\nimport BarChart from '../../Charts/BarChart/BarChart'\nimport Percent from '../../Statistics/Percent/Percent'\n\nconst StatisticsSection = ({metrics}) => ... | javascript | edit | 0 | 1 | mit | 11cec30a94f134f7442867bbbb33fc3490e6a2d2 | sgmap/inspire,sgmap/inspire | src/Section/StatisticsSection/StatisticsSection.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n\"use strict\";\n\n// module Data.Ord\n\nexports.ordArrayImpl = function (f) {\n return function (xs) {\n return function (ys) {\n var i = 0;\n var xlen = xs.length;\n var ylen = ys.length;\n while (i < xlen && i... | javascript | edit | 0 | 6 | bsd-3-clause | 6aae6d6b876c88327ce8ef31dbf3dec8eb60d3a4 | purescript/purescript-prelude,hdgarrood/purescript-prelude | src/Data/Ord.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nimport { types } from './storage.actions';\n\nconst initialState = {\n file: null,\n url: null,\n};\n\nexport default function storageReducer(state=initialState, action={}) {\n switch (action.type) {\n case types.SET_FILE:\n ... | javascript | edit | 0 | 4 | mit | e176f4ed812d0d91646ba62838e1769548b81f39 | n6g7/redux-saga-firebase | example/src/redux/reducer/storage.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n// Modules\nvar prompt = require( 'prompt' );\n\n// // Create a variable x and assign value 3 to it\n// var x = 3;\n\n// // Bind x to value 9\n// x *= x; // or x = x * x;\n// console.log( x );\n\n// read input data from terminal\nprompt... | javascript | edit | 0 | 3 | mit | 336d92edc418ef85c88390b3e33896ca73284c81 | waterlooSunset/computer-science-and-engineering | computer-science/01-introduction-to-cs-and-programming-mit/src/02-lecture.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nmodule.exports = {\n parserOptions: {\n ecmaVersion: 2017,\n sourceType: 'module',\n ecmaFeatures: {\n experimentalObjectRestSpread: true\n }\n },\n rules: {\n 'arrow-body-style': ['error', 'as-needed', {\n r... | javascript | edit | 0 | 0 | mit | 7358e642ffbea4ce3d2dd54da8b26068cd3d0f4d | sevenval/eslint-config-sevenval | rules/es2017.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nfunction runAlarm() {\n chrome.tabs.create({\n url: \"http://example.com\"\n });\n}\nchrome.alarms.onAlarm.addListener(function(alarm) {\n console.log(alarm);\n chrome.tabs.query({}, function(tabs) {\n if (tabs... | javascript | edit | 0 | 2 | mit | b702adaf1fae5e798db51d36b1919254f387f031 | adrianhuna/tabscheduler | js/eventPage.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nvar suite = require('suite.js');\n\nvar convertTag = require('../lib/convert_tag');\n\nsuite(convertTag, [\n 'foo', 'foo',\n 'self help', 'self_help',\n 'self-help', 'self__help',\n 'another self help', 'another_self_help',\... | javascript | edit | 0 | 0 | mit | 987d9722ecbcfa8925a48765086beceb2a913a58 | Kikobeats/blogger2ghost,bebraw/blogger2ghost | tests/test_convert_tag.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nmodule.exports = function(grunt) {\n\n grunt.initConfig({\n pkg: grunt.file.readJSON('package.json'),\n jshint: {\n options: {\n jshintrc: '.jshintrc'\n },\n all: [\n ... | javascript | edit | 0 | 1 | mit | c2a32db5fe2d291f4edd38b484aca17b51f5edae | jamiemill/lux,jamiemill/lux,jamiemill/lux | Gruntfile.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nmodule.exports = function(grunt) {\n\tgrunt.initConfig({\n\t\tbowerPkg: grunt.file.readJSON('bower.json'),\n\t\tkarma: {\n\t\t\tunit: {\n\t\t\t\tconfigFile: 'karma.conf.js',\n\t\t\t\tsingleRun: true,\n\t\t\t\tbrowsers: ['PhantomJS']\n\t... | javascript | edit | 0 | 1 | bsd-2-clause | 439f689096d46eac35c2adfe23b901e220a0f558 | SonicHedgehog/angular-progress-button,SonicHedgehog/angular-progress-button | Gruntfile.js | rejected_duplicate | Near-duplicate of sample 76594 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nconst request = require('request')\n\nfunction getLuke(cb) {\n const lukeInfo = {\n name: 'Luke',\n }\n\n request('https://swapi.co/api/people/1', (error, response, body) => {\n if (error) return cb(error)\n\n co... | javascript | edit | 0 | 2 | mit | 44da4e0035a0a72346b72c696aee73c23096275f | pierreroth64/js-async-tutorial | tests/testWithCallBack.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n/*global module:false*/\nmodule.exports = function(grunt) {\n\n // Project configuration.\n grunt.initConfig({\n // Task configuration.\n csslint: {\n src: ['public/**/*.css'],\n },\n docco: {\n src: ['*.js', 'ro... | javascript | edit | 0 | 1 | mit | ae5cad1e172ecd2a12a380c9f473b8b04af0f814 | nicolasmccurdy/jsbox | Gruntfile.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nimport { mergeSchemas, introspectSchema, makeRemoteExecutableSchema } from \"graphql-tools\"\nimport { createHttpLink } from \"apollo-link-http\"\nimport fetch from \"node-fetch\"\n\nimport localSchema from \"./schema\"\n\nexport defaul... | javascript | edit | 0 | 1 | mit | a3e29bcc9da540c6601c7ce74046c6451775809a | artsy/metaphysics,mzikherman/metaphysics-1,craigspaeth/metaphysics,mzikherman/metaphysics-1,mzikherman/metaphysics-1,mzikherman/metaphysics-1,craigspaeth/metaphysics,artsy/metaphysics,artsy/metaphysics | mergedSchema.js | rejected_duplicate | Near-duplicate of sample 98521 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n\"use strict\";\n\n// Load the libraries and modules\n\nvar assets = require(__dirname + '/data/assets.json');\nvar config = {\n npm: __dirname + '/node_modules/',\n libraries: {\n nodejs: {},\n npm: {}\n },\n ... | javascript | edit | 0 | 0 | mit | 994d14b7619ff6997881cb87b0d4653b6aca645c | SunnyUK/assetlist,SunnyUK/assetlist | app.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n/* jslint node: true */\n'use strict'\n\nmodule.exports = function (grunt) {\n // Project configuration.\n grunt.initConfig({\n nodeunit: {\n files: ['test/**/*_test.js']\n }\n })\n\n // These plugins provide necessar... | javascript | edit | 0 | 1 | mit | b345db1e7fce6d1f67aeaecb480c98f1e72dadf2 | bkimminich/z85-cli | Gruntfile.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nconst { configureStore } = require('../store');\nconst readline = require('readline');\nconst draw = require('./draw');\nconst { keys } = require('./input');\nconst actions = require('../actions');\n\nconst resize = (proc, store) => {\n... | javascript | edit | 0 | 1 | mit | 3e67e31a319630328d2271ad323d43f7f5dd4e1c | andybry/explorer-cli | app/ui/setup.js | rejected_duplicate | Near-duplicate of sample 67759 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n'use strict';\n\n/**\n * Module dependencies.\n */\nconst express = require('express');\nconst compression = require('compression');\nconst bodyParser = require('body-parser');\nconst router = require('./routes/routes'... | javascript | edit | 0 | 1 | mit | df342fe730d44c0141bd169d90df7202f0d3a571 | lostatseajoshua/Challenger | app.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n#!/usr/bin/env node\n\nvar argv = require(\"yargs\").argv;\nvar main = require('../');\n\nvar task = argv._[0];\nvar options = {};\n\nif(task === \"try\"){\n options.env = \"development\";\n \n main.do(\"init\", options, function(){\... | javascript | edit | 0 | 1 | mit | 510dab8128321ab8fa9f2ee4983cff3037b961a8 | Hinaser/sssg,Hinaser/sssg | bin/sssg.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\ndefine([\n 'extensions/collections/collection'\n],\nfunction (Collection) {\n return {\n requiresSvg: true,\n collectionClass: Collection,\n\n collectionOptions: function () {\n var valueAttr = this.model.get('value-attr... | javascript | edit | 0 | 3 | mit | 2e926ceaa52929378444fcaa6394a90de3b8ee44 | tijmenb/spotlight,alphagov/spotlight,alphagov/spotlight,keithiopia/spotlight,tijmenb/spotlight,tijmenb/spotlight,keithiopia/spotlight,keithiopia/spotlight,alphagov/spotlight | app/common/modules/applications.js | rejected_duplicate | Near-duplicate of sample 78790 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nmodule.exports = {\n assetsDir: 'styleguide/',\n css: {\n modules: true\n }\n};\n\n```\n\nApply this change: Correct to the right property"
},
{
"role": "assistant",
"content": "module.exports = {\n css: {\n module... | javascript | edit | 0 | 0 | mit | e49af4ac9be10a34e24672f65bab16c6c1efa5ef | rodet/styleguide,rodet/styleguide | vue.config.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nimport { basename, extname, join, dirname, relative, resolve } from 'path'\nimport { default as put } from 'output-file-sync'\nimport { parallel } from 'async'\n\nconst keys = Object.keys\n\nexport default function createPipeline(pkg, o... | javascript | edit | 0 | 2 | mit | 93204638953bebc77a46a5d8b0b3f9318046fc1a | zambezi/ez-build,zambezi/ez-build | src/pipeline.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nconst fs = require('fs')\n\nfunction fileExist(filename = '') {\n try {\n fs.accessSync(filename)\n } catch (e) {\n return false\n }\n\n return true\n}\n\nfunction writeFile(filename, data) {\n return new Promise((resolve, re... | javascript | edit | 0 | 2 | apache-2.0 | a7114d6f043978002f6d7c9d1974f21c72dddf77 | Mindsers/configfile | lib/fs.utils.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nvar r = require('rethinkdb');\n\nmodule.exports = function messageCreator(pool) {\n return function(message) {\n return pool.runQuery(r.table('messages').insert({\n body: message.body,\n creation: r.now()\n }));\n };\n... | javascript | edit | 0 | 1 | mit | 3eb39cf29563deade1d8a2b6687bbb0f17101ba0 | dingroll/dingroll.com,dingroll/dingroll.com | app/controllers/messages/create.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nconst { client } = require('nightwatch-cucumber')\nconst { defineSupportCode } = require('cucumber')\n\ndefineSupportCode(({ Then }) => {\n const Messages = client.page.Messages()\n\n Then(/^I see the success message$/, async () => {\... | javascript | edit | 0 | 1 | mit | fe97f331b8f2e94c03630f3b6adaec711c0978bd | uktrade/data-hub-frontend,uktrade/data-hub-fe-beta2,uktrade/data-hub-frontend,uktrade/data-hub-frontend,uktrade/data-hub-fe-beta2 | test/acceptance/features/messages/step_definitions/messages.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nimport Entity from '../Entity.js';\nimport printMessage from '../printMessage.js';\nimport action from '../action.js';\nimport time from '../time.js';\n\nexport class AlarmClock extends Entity {\n constructor() {\n super();\n thi... | javascript | edit | 0 | 2 | mit | 71af63a1dbbf93b49b26bed20f11e9f5abbcb591 | TEAMBUTT/LD35 | app/webpack/entities/alarmClock.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n'use strict';\n\nmodule.exports = {\n 'rules': {\n // Enforce trailing commas in multiline object literals\n 'comma-dangle': [2, 'always-multiline'],\n },\n};\n\n```\n\nApply this change: Enable more core “Errors” ru... | javascript | edit | 0 | 0 | mit | f4f55a8ed829910cdec7d4025b4ea07ee606271b | nutshellcrm/eslint-config-nutshell | rules/errors.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nimport React from 'react';\n\nexport default React.createClass({\n propTypes: {\n backIsDisabled: React.PropTypes.bool.isRequired,\n launchIsDisabled: React.PropTypes.bool.isRequired,\n advancedIsDisabled: React.... | javascript | edit | 0 | 2 | apache-2.0 | 64e91980f64ca6299b774f2d47a7c352503b6466 | CCI-MOC/GUI-Frontend,CCI-MOC/GUI-Frontend,CCI-MOC/GUI-Frontend,CCI-MOC/GUI-Frontend,CCI-MOC/GUI-Frontend | troposphere/static/js/components/modals/instance/launch/components/InstanceLaunchFooter.react.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nimport React, {PropTypes} from 'react'\nimport styles from '../styles/DeskTool.css'\nimport PaneResolver from 'config:desk-tool/pane-resolver'\n\nDeskTool.propTypes = {\n location: PropTypes.shape({\n pathname: PropTypes.string.isRe... | javascript | edit | 0 | 2 | mit | f659cc0dee2d9ed1df80793d87a1337a1403d7bc | sanity-io/sanity,sanity-io/sanity,sanity-io/sanity,sanity-io/sanity | packages/@sanity/desk-tool/src/DeskTool.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nangular.module('umbraco').controller('Our.Umbraco.Nexu.BaseDeleteController',\n ['$scope', '$controller', 'Our.Umbraco.Nexu.Resource',\n function ($scope, $controller, nexuResource) {\n // inherit core delete contr... | javascript | edit | 0 | 2 | mit | 071992c3a29c44ae565bd81c18b7144f87d356ff | dawoe/umbraco-nexu,dawoe/umbraco-nexu,dawoe/umbraco-nexu | Source/Our.Umbraco.Nexu.Core/Client/controllers/base-delete-controller.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nvar express = require('express');\nvar router = express.Router();\nvar JsonDB = require('node-json-db');\nvar _ = require('lodash');\n\n// Recipes listing\nrouter.get('/', function (req, res, next) {\n var db = new JsonDB('db', false, ... | javascript | edit | 0 | 4 | mit | d13350e6592dce99e3d3b508b335e2b9f73000eb | adamsea/recipes-api | routes/recipes/index.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nmodule.exports = function(grunt, config, parameters, done) {\n\n\tfunction endForError(e) {\n\t\tprocess.stderr.write(e.message || e);\n\t\tdone(false);\n\t}\n\n\ttry {\n\t\tvar rimraf = require('rimraf'),\n\t\t\tfs = require('fs'),\n\t... | javascript | edit | 0 | 2 | mit | f0d97a53499a0b5810179b0c3518087e0b9b5c07 | haeflimi/concrete5,jaromirdalecky/concrete5,mainio/concrete5,deek87/concrete5,haeflimi/concrete5,mlocati/concrete5,MrKarlDilkington/concrete5,MrKarlDilkington/concrete5,haeflimi/concrete5,hissy/concrete5,olsgreen/concrete5,KorvinSzanto/concrete5,deek87/concrete5,jaromirdalecky/concrete5,concrete5/concrete5,biplobice/co... | build/tasks/build-release/start.js | rejected_duplicate | Near-duplicate of sample 76439 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nwindow.onerror = function(message, url, line) {\n $.ajax('/api/Error', {\n data: {\n message: message,\n url: url,\n line: line\n }\n });\n};\n\n```\n\nApply this change: Fix for fail... | javascript | edit | 0 | 2 | bsd-3-clause | 0f8269236553c431ad68f22d2f82939911bf5fea | developmentseed/bones,developmentseed/bones,Wiredcraft/bones,Wiredcraft/bones | assets/debug.js | rejected_duplicate | Near-duplicate of sample 100299 | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.