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\nimport React from 'react';\nimport PropTypes from 'prop-types';\nimport cx from 'classnames';\n\nconst propTypes = {\n children: PropTypes.node.isRequired,\n className: PropTypes.string,\n};\n\nconst defaultProps = {\n className: nul...
javascript
edit
0
1
mit
bdcd0f382efcb77415813955bc0ca4e0ece4f8c6
ProAI/react-essentials
src/Form/FormText.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\n'use strict';\nvar _ = require('lodash');\nvar fs = require('fs');\nvar path = require('path');\n\nvar convert = {\n moduleToFolder: moduleToFolder,\n pathToModule: pathToModule\n};\n\nfunction pathToModule(dir, entered) {\n var modu...
javascript
edit
0
5
mit
db4c7348e66753a969de4888e6c01608c1e49129
sysgarage/generator-sys-angular,sysgarage/generator-sys-angular
utils/convert.js
accepted
null
true
[ { "role": "user", "content": "Write javascript code for the following: Add insert fxn to insertion sort" }, { "role": "assistant", "content": "var insert = function(array, rightIndex, value) {\n for(var index = rightIndex;\n index >= 0 && array[index] > value;\n index--){\n array[...
javascript
new_file
0
3
mit
1d11599d6d881b7cbd4a96d50aa92566e38384d2
aftaberski/algorithms,aftaberski/algorithms
sort/insertion_sort.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\nimport addons from '@storybook/addons';\nimport { EVENT_ID } from '../shared';\n\n// init function will be executed once when the storybook loads for the\n// first time. This is a good place to add global listeners on channel.\nexport f...
javascript
edit
0
3
mit
bef736ad7309b7a1e60b8d9935e546aced0c2531
storybooks/storybook,kadirahq/react-storybook,rhalff/storybook,storybooks/react-storybook,rhalff/storybook,rhalff/storybook,rhalff/storybook,storybooks/storybook,kadirahq/react-storybook,storybooks/storybook,storybooks/storybook,storybooks/react-storybook,storybooks/react-storybook,storybooks/storybook,storybooks/story...
addons/options/src/preview/index.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\nexport default class {\n constructor (name) {\n this.name = name;\n this.mode = 'disabled';\n this.element = undefined;\n\n //\n this.data = {};\n this._options = {};\n this._configuration = {};\n }\n\n get confi...
javascript
edit
0
4
mit
5184b5963cd48452546d6ff1e0df518cd8473cdf
chafey/cornerstoneTools,cornerstonejs/cornerstoneTools,cornerstonejs/cornerstoneTools,cornerstonejs/cornerstoneTools
src/base/baseTool.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\n'use strict';\n\nangular.module('myApp.students', ['ngRoute'])\n\n.config(['$routeProvider', function($routeProvider) {\n $routeProvider.when('/students', {\n templateUrl: 'components/students/students.html',\n controller: 'Stude...
javascript
edit
0
1
mit
1b96576cea9138cb95e332a1d12e3a1e1887be56
andrewalexander/hackpsu_registration,andrewalexander/hackpsu_registration,andrewalexander/hackpsu_registration,andrewalexander/hackpsu_registration
app/components/students/students.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\n// @flow\n\nimport CodePush from 'react-native-code-push';\nimport { AppRegistry, YellowBox } from 'react-native';\nimport {\n SingleHotelStandalonePackage,\n NewHotelsStandAlonePackage,\n} from '@kiwicom/react-native-app-hotels';\n\n...
javascript
edit
0
1
mit
a9ee91d3920d0fa876bd16f5e51a7bad2f29f818
mrtnzlml/native,mrtnzlml/native
app/native.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\nTemplate.viewerMain.helpers({\n 'toolbarOptions': function() {\n var toolbarOptions = {};\n\n var buttonData = [];\n\n buttonData.push({\n id: 'resetViewport',\n title: 'Reset Viewport',\n ...
javascript
edit
0
1
mit
48c22bda06a7f6ea3592c942db50d7a4236f8605
OHIF/Viewers,HorizonPlatform/Viewers,HorizonPlatform/Viewers,HorizonPlatform/Viewers,OHIF/Viewers,HorizonPlatform/Viewers,OHIF/Viewers
LesionTracker/client/components/viewerMain/viewerMain.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\n// https://eslint.org/docs/user-guide/configuring\n\nmodule.exports = {\n root: true,\n parserOptions: {\n parser: \"babel-eslint\",\n sourceType: \"module\"\n },\n env: {\n browser: true\n },\n // required to lint *.vue ...
javascript
edit
0
0
mit
d27ae97ff6e764ac9e40c4b03b91eab8a30d32cc
homoluden/fukami,homoluden/fukami,homoluden/fukami
web/.eslintrc.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\n'use strict';\n\nvar bind = require('function-bind');\nvar ES = require('es-abstract/es7');\nvar slice = bind.call(Function.call, String.prototype.slice);\n\nmodule.exports = function padLeft(maxLength) {\n\tvar O = ES.RequireObjectCoer...
javascript
edit
0
8
mit
dd123262b95f39224b7851ceaaf785399c9de0c0
ljharb/String.prototype.padLeft,ljharb/String.prototype.padStart,es-shims/String.prototype.padStart,es-shims/String.prototype.padLeft
implementation.js
rejected_duplicate
Near-duplicate of sample 86995
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\n$(document).ready(function(){\n\n $(\".metronome-parameters\").on(\"submit\", function(event){\n event.preventDefault();\n var tempo = $(\"#tempo-field\").val();\n var beatsPerMeasure = $(\"#beats-field\").val();\n metronom...
javascript
edit
0
2
mit
5684a7a2746bce64504d3ee598c9403315d3211e
dmilburn/beatrice,dmilburn/beatrice
js/application.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\nimport React, { Component } from 'react';\nimport AceEditor from 'react-ace';\nimport githubTheme from 'brace/theme/github';\nimport markdownSyntax from 'brace/mode/markdown';\n\nimport styles from './CodeEditor.styl';\n\nexport default...
javascript
edit
0
2
mit
2fa060f4dd23a5074b788330c1a8464f79bdadef
Literasee/literasee,Literasee/literasee
routes/edit/screens/App/screens/Project/components/CodeEditor.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\n(function() {\n 'use strict';\n\n angular\n .module('annualTimeBlock')\n .controller('MainController', MainController);\n\n /** @ngInject */\n function MainController($timeout, webDevTec, toastr) {\n var vm = this;\n\n v...
javascript
edit
0
1
mit
ec5f0a6ded1d50773cda52d32f22238bcb019d56
EdwardHinkle/annualTimeBlock,EdwardHinkle/annualTimeBlock
src/app/main/main.controller.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\nimport React from \"react\";\nimport { connect } from \"react-redux\";\nimport { push } from \"react-router-redux\";\nimport { parse } from \"qs\";\nimport { downloadJournal } from \"../actionCreators\";\n\nclass Auth extends React.Comp...
javascript
edit
0
1
mit
552a0ff648af26ec23415abb24de858bb229e92e
captbaritone/markdown.today,captbaritone/markdown.today,captbaritone/markdown.today
src/components/Auth.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\nimport { ControllerProvider } from './controller';\n\nconst testModuleName = 'hot-reload-demo';\n\nfdescribe('ControllerProvider', () => {\n describe('creating a controller through the provider', () => {\n var ctrl;\n\n beforeEac...
javascript
edit
0
2
mit
4dc0b40c4a6f54952cf7bfaa0492872539b88d40
noppa/ng-hot-reload,noppa/ng-hot-reload,noppa/ng-hot-reload
src/controller.spec.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\n$(document).on('ready', function() {\n\n $('nav a').on('click', function(event) {\n event.preventDefault();\n var targetURI = event.target.dataset.pagePartial;\n $.ajax({\n cache: false,\n url: targetURI\n }).done...
javascript
edit
0
1
mit
2d5bd5583ed75904284b32b7ba4ff3294267315e
RoyTuesday/RoyTuesday.github.io,peternatewood/peternatewood.github.io,peternatewood/peternatewood.github.io,peternatewood/peternatewood.github.io,RoyTuesday/RoyTuesday.github.io
scripts/single-page.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\nvar EventEmitter = require('events').EventEmitter;\nvar util = require('util');\nvar expat = require('../build/default/node-expat');\n\n/**\n * Simple wrapper because EventEmitter has turned pure-JS as of node\n * 0.5.x.\n */\nexports.P...
javascript
edit
0
1
mit
1ec3d3a1c7b8b664c7d5a0455e23e4185eb3bf23
node-xmpp/node-expat,Moharu/node-expat,noahjs/node-expat,Moharu/node-expat,noahjs/node-expat,julianduque/node-expat,noahjs/node-expat,node-xmpp/node-expat,julianduque/node-expat,node-xmpp/node-expat,julianduque/node-expat,Moharu/node-expat
lib/node-expat.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\nvar stexDev = require(\"stex-dev\");\nvar gulp = stexDev.gulp();\nvar plugins = stexDev.gulpPlugins();\nvar paths = stexDev.paths;\n\n\n// composite gulp tasks\ngulp.task('default', ['test']);\ngulp.task('dist', ['']);\ngulp.t...
javascript
edit
0
0
isc
fb67dd5793ba6163e66f325fa3adcb12c4fc8038
Payshare/stellar-wallet,stellar/stellar-wallet,stellar/stellar-wallet,Payshare/stellar-wallet
gulpfile.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\nimport React from 'react';\n\nclass JewelryProducts extends React.Component {\n render() {\n return (\n <h1>Jewelry Products</h1>\n );\n }\n}\n\nexport default JewelryProducts;\n\n```\n\nApply this change: Make an example f...
javascript
edit
0
2
mit
bb913af7a765a1092233c3b73970a800e8fd8dcc
jfanderson/KIM,jfanderson/KIM
client/app/components/JewelryProducts.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\n\"format cjs\";\n\nvar loader = require('@loader');\n\nvar isNode = typeof process === \"object\" &&\n\t{}.toString.call(process) === \"[object process]\";\n\nif(isNode) {\n\texports.systemConfig = {\n\t\tmeta: {\n\t\t\t'jquery': {\n\t\...
javascript
edit
0
0
mit
ce690f942c693ef3e8083b224153f624d58b7913
donejs/done-ssr,donejs/done-ssr
lib/system_config.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\nvar gulp = require('gulp');\nvar fse = require('fs-extra');\n\ngulp.task('clean', function(done) {\n fse.removeSync('dist');\n fse.mkdirSync('dist');\n done();\n});\n\ngulp.task('default', ['clean'], function() {\n return gulp\n ...
javascript
edit
0
1
apache-2.0
9a9e537e01b410efbe5aae0429c60a1363f431e3
zalun/mercurius,zalun/mercurius,marco-c/mercurius,marco-c/mercurius,marco-c/mercurius
gulpfile.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\nangular.module('bolt.controller', [])\n\n.controller('BoltController', function($scope, $location, $window){\n $scope.session = $window.localStorage;\n $scope.startRun = function() {\n if (document.getElementById(\"switch_3_left\")...
javascript
edit
0
3
mit
cdcf48dc3afdb347303cec910a37cf7a34bd03db
thomasRhoffmann/Bolt,elliotaplant/Bolt,gm758/Bolt,elliotaplant/Bolt,boisterousSplash/Bolt,boisterousSplash/Bolt,gm758/Bolt,thomasRhoffmann/Bolt
client/app/controllers/boltController.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\nconst del = require('del')\nconst { dest, series, src } = require('gulp')\nconst {\n init: sourceMapsInit,\n write: sourceMapsWrite,\n} = require('gulp-sourcemaps')\nconst { createProject } = require('gulp-typescript')\n\nconst tsProj...
javascript
edit
0
1
mit
1ee6d04bf95b1525aed47e964934b271a05f686a
IsaacLean/bolt-ui,IsaacLean/bolt-ui
gulpfile.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\n\nconst fs = require(\"fs\");\nconst objectEquals = require(\"./objectEquals\");\n\nconst { DEFAULT_TOKENS_FILENAME } = require(\"../lib/constants\");\n\nconst tokensManager = function tokensManager (filename = DEFAULT_TOKENS_FILENAME) ...
javascript
edit
0
3
mit
ace61513a0b03b9409ccdceef288f3676a6476ac
luispablo/tokenauth
lib/tokensManager.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\nimport React, { Component, PropTypes } from 'react'\nimport { playAudio } from '../utils/audioplayer'\n\nexport default class Tap extends Component {\n\n static PropTypes = {\n receivedTaps: PropTypes.object,\n users: PropTypes.o...
javascript
edit
0
5
apache-2.0
fe3c32c0361a1b6779b8ee9830df88f13e5653ab
hbierlee/digital-shoulder-tap,hbierlee/digital-shoulder-tap
app/components/Tap.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\n/**\n * Detect platform-specific things.\n */\n\n\ngoog.provide('onfire.utils.detection');\n\n\n/**\n * @type {boolean}\n */\nonfire.utils.detection.IS_NODEJS = (typeof module !== 'undefined' && !!module.exports);\n\n```\n\nApply this c...
javascript
edit
0
0
mit
df36577dd72440c7e581d304cf86d6edd036bed3
isabo/onfire
src/utils/detection.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\nimport Ember from 'ember';\n\nexport default Ember.Controller.extend({\n session: Ember.inject.service(),\n actions: {\n invalidateSession () {\n this.get('session').invalidate();\n },\n login () {\n const lockOptio...
javascript
edit
0
1
bsd-2-clause
d2adb620304c51e85903f97d9015ac2e6ce340fb
barberscore/barberscore-web,barberscore/barberscore-web,barberscore/barberscore-web
app/controllers/application.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\n'use strict';\n\nmodule.exports = function ($interpolate, $parse) {\n return {\n require: '^bdSubmit',\n restrict: 'A',\n compile: function (element, attributes) {\n if (!attributes.type) {\n attributes.$set('type'...
javascript
edit
0
3
mit
b38008623b2d0cd3a9912481dcafe4fe37b22d3b
bendrucker/angular-form-state
src/submit-button.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\n/**\n * @param {Boolean} renderEmsChoices\n * @param {Object} emsChoices\n */\nfunction createSchema(renderEmsChoices, emsChoices) {\n let fields = [{\n component: 'text-field',\n name: 'name',\n validate: [{\n type: 'req...
javascript
edit
0
2
apache-2.0
b2eff2b6ba5ea37838a2111f0dc109c56a6b6d09
ManageIQ/manageiq-ui-classic,ManageIQ/manageiq-ui-classic,ManageIQ/manageiq-ui-classic,ManageIQ/manageiq-ui-classic
app/javascript/components/cloud-tenant-form/create-form.schema.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\nfunction easing(time) {\n return 1 - (--time) * time * time * time;\n};\n\n/**\n * Given a start/end point of a scroll and time elapsed, calculate the scroll position we should be at\n * @param {Number} start - the initial value\n * @p...
javascript
edit
0
2
mit
cbcc919782649d8bcfd7e86e86a20a82fc4dd109
clauderic/react-infinite-calendar
src/utils/animate.js
rejected_duplicate
Near-duplicate of sample 80306
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\nimport { withSeriesType } from 'react-jsx-highcharts';\nexport {\n Chart,\n Credits,\n Debug,\n Loading,\n Legend,\n Series,\n Subtitle,\n Title,\n Tooltip,\n HighchartsContext,\n HighchartsChartContext,\n HighchartsAxisCont...
javascript
edit
0
0
mit
1aca5fcc9668cc9eeec2750acf4ebd1e850a1d1c
whawker/react-jsx-highcharts,whawker/react-jsx-highcharts
packages/react-jsx-highmaps/src/index.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\nconst models = require('../../models');\nlet Project = models.projects;\n\nmodule.exports = function(connection, done) {\n connection.createChannel(function(err, ch) {\n console.log(err);\n var ex = 'chiepherd.main';\n ch.asse...
javascript
edit
0
2
mit
df075c083b7541c32666fc71549465d97ca20c21
CHIEPHERD/chiepherd_api,CHIEPHERD/chiepherd_api,CHIEPHERD/chiepherd_api
jobs/projects/create.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\nimport Model from '../base/model';\n\n\nexport default class ViewSwitcher {\n constructor(app, element) {\n this.app = app;\n this.element = element;\n\n this.currentView = null;\n }\n\n switchView(ViewClass, args) {\n if...
javascript
edit
0
3
mit
0ccd1659f8e5b4999191cf1a8a1cd1960517c46c
despawnerer/theatrics,despawnerer/theatrics,despawnerer/theatrics
client/app/js/core/view-switcher.js
rejected_duplicate
Near-duplicate of sample 78155
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\nvar pkg = require(\"../package.json\");\n\nglobal.navigator = global.navigator || {\n\tuserAgent: \"Mozilla/5.0 \" + \"done-ssr/\" + pkg.version\n};\n\nmodule.exports = function(loader){\n\t// Ensure the extension loads before the main....
javascript
edit
0
5
mit
11a15c61e4e9ad0f4c5efe4c56bc308e37006198
donejs/done-ssr,donejs/done-ssr
lib/configure_loader.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\nimport { createStore, applyMiddleware } from \"redux\";\nimport thunk from \"redux-thunk\";\nimport { composeWithDevTools } from \"redux-devtools-extension\";\nimport reducer from \"./reducers\";\nimport mediaMiddleware from \"./mediaMi...
javascript
edit
0
2
mit
e9ff9befd71167f2fe17045e8c370c70ca97b61e
captbaritone/winamp2-js,captbaritone/winamp2-js,captbaritone/winamp2-js
js/store.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\n'use strict';\nconst {app, dialog} = require('electron');\nconst {autoUpdater} = require('electron-updater');\n\nfunction appUpdater() {\n\t// Log whats happening\n\tconst log = require('electron-log');\n\tlog.transports.file.level = 'i...
javascript
edit
0
2
apache-2.0
35a42f3873ae041e59952888ce4282a3163debe5
zulip/zulip-electron,zulip/zulip-desktop,zulip/zulip-desktop,zulip/zulip-desktop,zulip/zulip-electron,zulip/zulip-desktop,zulip/zulip-electron
app/main/autoupdater.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\nimport React, { PureComponent } from 'react';\n\nclass LoadingBar extends PureComponent {\n render() {\n return null;\n }\n}\n\nexport default LoadingBar;\n\n```\n\nApply this change: Create SVG containing a rectangle as SVG is per...
javascript
edit
0
1
mit
3b81a97838b7c176ad0ae1c3c0e4323780446a39
teamleadercrm/teamleader-ui
components/loadingBar/LoadingBar.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\nvar page = tabris.create(\"Page\", {\n title: \"Actions\",\n topLevel: true\n});\n\nvar proposals = [\"baseball\", \"batman\", \"battleship\", \"bangkok\", \"bangladesh\", \"banana\"];\n\nvar textView = tabris.create(\"TextView\", {\n...
javascript
edit
0
1
bsd-3-clause
710f79a9aba647161fca92d79af554d412fa25e8
eclipsesource/tabris-js,eclipsesource/tabris-js,eclipsesource/tabris-js
snippets/action-search/search-action.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\ndefine(function() {\n\n 'use strict';\n \n function open(item) {\n console.log(item);\n }\n \n return open;\n\n});\n\n```\n\nApply this change: Add some fields to local file header" }, { "role": "assistant", "conten...
javascript
edit
0
2
mit
f6b974940964241d0980b15efb3f030452c70c82
radishengine/drowsy,radishengine/drowsy
ext/open_ZIP.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\ndescribe(\"value\", function() {\n \"use strict\";\n\n var div, input;\n\n beforeEach(function() {\n div = DOM.create(\"div>a+a\");\n input = DOM.create(\"input[value=foo]\");\n });\n\n it(\"should replace child element(s) fr...
javascript
edit
0
1
mit
df3a6e16525e2764ea018a48bc178ff75c0bb467
suenot/better-dom,suenot/better-dom,chemerisuk/better-dom,chemerisuk/better-dom
test/spec/element/value.spec.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\nExt.define('SlateAdmin.view.progress.interims.Manager', {\n extend: 'Ext.Container',\n xtype: 'progress-interims-manager',\n requires: [\n 'SlateAdmin.view.progress.interims.SectionsGrid',\n 'SlateAdmin.view.progr...
javascript
edit
0
0
mit
72b64f7e83fdfb1a20311b86e271359529dc4abf
SlateFoundation/slate-admin,SlateFoundation/slate,SlateFoundation/slate,SlateFoundation/slate-admin,SlateFoundation/slate-admin,SlateFoundation/slate,SlateFoundation/slate-admin,SlateFoundation/slate,SlateFoundation/slate-admin,SlateFoundation/slate
sencha-workspace/SlateAdmin/app/view/progress/interims/Manager.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\n// Copy file\n// Credit: Isaac Schlueter\n// http://groups.google.com/group/nodejs/msg/ef4de0b516f7d5b8\n\n'use strict';\n\nvar util = require('util')\n , fs = require('fs');\n\nmodule.exports = function (source, dest, cb) {\n\tfs.ls...
javascript
edit
0
3
mit
5206759e482853b788126022ef4682958dccec30
medikoo/node-ext
lib/fs/copy.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\nvar defaultEncoding\n/* istanbul ignore next */\nif (process.browser) {\n defaultEncoding = 'utf-8'\n} else if (process.version) {\n var pVersionMajor = parseInt(process.version.split('.')[0].slice(1), 10)\n\n defaultEncoding = pVers...
javascript
edit
0
0
mit
449e510f861f56ed673613d8102f6b1a3e680ced
crypto-browserify/pbkdf2,crypto-browserify/pbkdf2
lib/default-encoding.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\nvar _ = require('underscore');\n\nmodule.exports = function(opts) {\n\n var config = {\n redis_pool: {\n max: 10, \n idleTimeoutMillis: 1, \n reapIntervalMillis: 1,\n port: 6336\n ...
javascript
edit
0
2
bsd-3-clause
283cce3b70e3a71279bbc805c973fd5d6e8b0aa2
CartoDB/node-redis-mpool
test/support/config.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\n/*global angular */\n/*jslint browser: true */\n(function () {\n 'use strict';\n\n var app;\n\n app = angular.module('thin.gsApp', ['ngRoute', 'ngSanitize', 'alerts', 'auth'])\n .config(['$routeProvider', '$locationProvi...
javascript
edit
0
1
mit
40403c636b6ca29e01dff10b0e761389c8f07468
henvic/thin.gs
app/scripts/app.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\n// This file exists because it is the file in the tool that is not automatically\n// transpiled by Babel\n\n\"use strict\";\n\nfunction babelRegister() {\n const meteorBabel = require(\"meteor-babel\");\n const path = require(\"path\"...
javascript
edit
0
1
mit
cbacc31ddebbd2b7c8d3a809d55739ccfca962a6
Hansoft/meteor,Hansoft/meteor,Hansoft/meteor,Hansoft/meteor,Hansoft/meteor,Hansoft/meteor,Hansoft/meteor
tools/tool-env/install-babel.js
accepted
null
true
[ { "role": "user", "content": "Write javascript code for the following: Add API and frontend routes" }, { "role": "assistant", "content": "var proxy = require('redbird')({port: 8080});\n\nproxy.register('localhost/event', 'http://localhost:3000');\nproxy.register('localhost/event/api/...
javascript
new_file
0
0
mit
c3d2b30dc74391b221665849f2a32fb4c6f0ad30
haimich/event,haimich/event,haimich/event
proxy/server.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\n/** @jsx hJSX */\nimport {run, Rx} from '@cycle/core';\nimport {makeDOMDriver, hJSX} from '@cycle/dom';\n\nfunction main(drivers) {\n let secondsElapsed$ = Rx.Observable.interval(1000)\n .map(i => i + 1)\n .startWith(0);\n let v...
javascript
edit
0
1
mit
26b49206e60a8c527ae4b7e595ab511f4a724987
mikekidder/cycle-examples,cyclejs/cycle-examples,cyclejs/cycle-examples,mikekidder/cycle-examples,mikekidder/cycle-examples
jsx-seconds-elapsed/src/main.js
rejected_duplicate
Near-duplicate of sample 76953
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\nimport React from \"react\";\n\nimport Container from \"./Container.js\";\nimport Button from \"./../Shared/Button.js\";\n\nimport setCurrentScreenAction from \"../../actions/ScreenActions.js\";\nimport { GAME_SCREEN } from \"../../acti...
javascript
edit
0
1
mit
754071878da574b3912710d7ea2a681bcc2a74bb
Lingvokot/Tic-Tac-Toe-React,Lingvokot/Tic-Tac-Toe-React,Lingvokot/Tic-Tac-Toe-React
src/components/MenuScreen/MenuScreen.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\n\"use strict\";\n\nlet https = require('https');\n\n\nlet keys = require(\"./secretKeys.js\");\n\nexports.init = function (mainCallback) {\n\n\tlet options = {\n\t\thost: \"api.carriots.com\",\n\t\tpath: \"/streams/?max=1&order=-1\",\n\...
javascript
edit
0
3
mit
4446bd48ebd8ced9f5001b202b8d0fa2b8b36a74
Zenika/bottleopener_iot,Zenika/bottleopener_iot,Zenika/bottleopener_iot,Zenika/bottleopener_iot
server/src/connectors/carriots.module.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\nexport default {\n 'CORE - METRORAIL': 'red',\n 'CORE - METRORAPID': '#f24d6e',\n 'CORE - LIMITED': '#649dce',\n 'CORE - RADIAL': '#5190c8',\n 'CORE - FEEDER': '#3d84c2',\n 'CORE - EXPRESS/FLYERS': '#3777ae',\n 'CORE - CROSSTOWN'...
javascript
edit
0
0
mit
ee805b8617ecbc03cef0c421124bb799890b9ef8
jga/capmetrics-web,jga/capmetrics-web
app/utils/service-colors.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\n(function() {\n \"use strict\";\n GOVUK.Tracker.load();\n var cookieDomain = (document.domain === 'www.digitalmarketplace.service.gov.uk') ? '.digitalmarketplace.service.gov.uk' : document.domain;\n var property = (document.domain =...
javascript
edit
0
2
mit
fd1fcc6f35f2e36290fe1143edcea2334e079267
alphagov/digitalmarketplace-buyer-frontend,AusDTO/dto-digitalmarketplace-buyer-frontend,alphagov/digitalmarketplace-buyer-frontend,AusDTO/dto-digitalmarketplace-buyer-frontend,AusDTO/dto-digitalmarketplace-buyer-frontend,alphagov/digitalmarketplace-buyer-frontend,alphagov/digitalmarketplace-buyer-frontend,AusDTO/dto-di...
app/assets/javascripts/_analytics.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\n'use strict';\n\nangular.module('angularjsRundownApp')\n .factory('facebookApi', ['$q', 'facebookAppId', function($q, facebookAppId) {\n // Public API here\n return {\n favoriteMovie: function(movie) {\n var defer = $...
javascript
edit
0
1
mit
813cb6ded01ba962935588bad4793febfcb74154
wlepinski/kinetoscope,wlepinski/kinetoscope
app/scripts/services/facebook_api.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\nimport m from 'mithril';\n\nexport const OptionsDisplayTableHeader = () => ({\n view() {\n return m('thead', [\n m('tr', [\n m('th', 'Name'),\n m('th', 'Pattern'),\n m('th', 'Selector'),\n m('th', 'E...
javascript
edit
0
1
mit
4b9ab7d113fd714efe1821e69ae403cfecb96816
solkaz/source-copy,solkaz/source-copy
src/options_ui/options-display-table.js
accepted
null
true
[ { "role": "user", "content": "Write javascript code for the following: Add getAllLikedRecipes method, to get all liked recipes for a single user" }, { "role": "assistant", "content": "import { postgresConnection as cn } from '../../config/helpers.js';\nconst pgp = require('pg-promise')();\nconst...
javascript
new_file
0
2
mit
f45deeef6b6162a086dc40269dfca3e1e8157e50
rompingstalactite/rompingstalactite,rompingstalactite/rompingstalactite,forkful/forkful,forkful/forkful,forkful/forkful,rompingstalactite/rompingstalactite
server/APIv1/likes/likesController.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\n/*\n * Copyright (C) 2012 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
4
apache-2.0
c19901ca8b5cc613eb66183d26f50b617275d326
lcnbala/aura,madmax983/aura,forcedotcom/aura,lhong375/aura,TribeMedia/aura,forcedotcom/aura,lcnbala/aura,lhong375/aura,TribeMedia/aura,forcedotcom/aura,DebalinaDey/AuraDevelopDeb,badlogicmanpreet/aura,navyliu/aura,navyliu/aura,igor-sfdc/aura,madmax983/aura,lcnbala/aura,madmax983/aura,badlogicmanpreet/aura,DebalinaDey/A...
aura-components/src/main/components/auradocs/search/searchController.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\nimport gql from 'graphql-tag';\nimport { graphql } from 'react-apollo';\n\nimport Profile from '../components/Profile';\n\nconst ownProfileQuery = gql`\n {\n viewer {\n me {\n id\n username\n firstName\n ...
javascript
edit
0
3
bsd-3-clause
44a011e00c2884e192d6e0f72ca05aa215d4a3a2
exponentjs/exponent,exponentjs/exponent,exponent/exponent,exponentjs/exponent,exponentjs/exponent,exponent/exponent,exponentjs/exponent,exponent/exponent,exponent/exponent,exponent/exponent,exponentjs/exponent,exponentjs/exponent,exponent/exponent,exponentjs/exponent,exponent/exponent,exponentjs/exponent,exponent/expon...
js/Home/containers/MyProfileContainer.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\nimport ghost from 'ghostjs'\nimport assert from 'assert'\n\nimport localServer from './fixtures/server.js'\n\ndescribe('Navigation', () => {\n\n localServer()\n\n it('navigates', async () => {\n await ghost.open('http://localhost:8...
javascript
edit
0
1
mit
f3ef2a4bd4f53306b973c5fc8d7da4c6507aa8af
KevinGrandon/ghostjs,KevinGrandon/ghostjs
ghostjs-examples/test/navigation_test.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\nvar Sequelize = require('sequelize');\nvar sequelize = new Sequelize('c-far', 'root', '123456@', {\n host: '192.168.99.100',\n dialect: 'mysql',\n\n pool: {\n max: 5,\n min: 0,\n idle: 10000\n },\n});\n\nmodule.exports = se...
javascript
edit
0
0
mit
c40a768c17d54f4ebb71d6e9aafb0bff086bffde
tom19960222/C-FAR-Website,tom19960222/C-FAR-Website,tom19960222/C-FAR-Website,tom19960222/C-FAR-Website
C-FAR/db.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\n/* jshint node: true */\n/* global require, module */\n\nvar EmberAddon = require('ember-cli/lib/broccoli/ember-addon');\n\nvar app = new EmberAddon();\n\n// Use `app.import` to add additional libraries to the generated\n// output files...
javascript
edit
0
0
mit
c42aaec157d14e9f0173575d4fbac272c0917b5f
aravindranath/ember-cli-datepicker,topaxi/ember-bootstrap-datepicker,maladon/ember-cli-bootstrap-datepicker,Hanastaroth/ember-cli-bootstrap-datepicker,jesenko/ember-cli-bootstrap-datepicker,aravindranath/ember-cli-datepicker,lazybensch/ember-cli-bootstrap-datepicker,lazybensch/ember-cli-bootstrap-datepicker,jelhan/embe...
Brocfile.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\nvar global = {\n domain: 'http://subdomain.yourdomain.com/',\n secretUrlSuffix: 'putSomeAlphanumericSecretCharsHere'\n};\n\nvar projects = [\n {\n repo: {\n owner: 'yourbitbucketusername',\n slug: 'your-bitbucket-repo-na...
javascript
edit
0
0
mit
003becf56e1cfc3b9737ee5c43824ebd12ffc252
mplewis/statichook
sampleConfig.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\n/* eslint-env jquery */\n\nstart();\nfunction start () {\n 'use strict';\n\n $(document).ready(() => {\n $('form').submit(event => {\n event.preventDefault();\n const username = $('#username').val();\n const password...
javascript
edit
0
1
apache-2.0
f7df94c004677304e33e3deae35f1478b004292b
ailijic/era-floor-time,ailijic/era-floor-time
public/js/login.js
rejected_duplicate
Near-duplicate of sample 99239
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\nimport * as ACTION_TYPES from '../constants/action_types'\n\nfunction extractToken(hash, oldToken) {\n const match = hash.match(/access_token=([^&]+)/)\n let token = !!match && match[1]\n if (!token) {\n token = oldToken\n }\n r...
javascript
edit
0
4
mit
e7f535483c0aea83523bca5d12584fad95980567
ello/webapp,ello/webapp,ello/webapp
src/networking/auth.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\nimport log from \"../../shared/library/log.js\";\nimport { dispatch } from \"../redux/index.js\";\nimport { setAuthToken } from \"../../shared/actions/dropbox.js\";\n\nconst BUTTERCUP_DOMAIN_REXP = /^https:\\/\\/buttercup.pw\\//;\nconst...
javascript
edit
0
4
mit
f7adbbb625830a472f278d696123981b1d96317d
buttercup-pw/buttercup-browser-extension,buttercup-pw/buttercup-browser-extension,perry-mitchell/buttercup-chrome,perry-mitchell/buttercup-chrome
source/background/library/browserEvents.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\n// Importing Node modules and initializing Express\nconst express = require('express'),\n app = express(),\n bodyParser = require('body-parser'),\n logger = require('morgan'),\n mongoose = require('mongoose'),\n router = ...
javascript
edit
0
1
mit
a4a733f8d852eb9928686e933895a46696d567c0
davdkm/battlerite-base
server/index.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\nconst AppTokenUtil = {\n getAppTokensBasedOnQuery: getAppTokensBasedOnQuery\n};\n\nfunction getAppTokensBasedOnQuery(query, desktopAppId) {\n let userDisabledMap = new Map();\n let userIdsSet = new Set();\n\n let appTokens = Push.ap...
javascript
edit
0
4
mit
ca2181185d72669297f855ddca9887dcba84fce0
okgrow/push,staceesanti/push
lib/server/appTokenUtil.js
rejected_duplicate
Near-duplicate of sample 97827
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\nconst router = require('express').Router()\n\nconst { allPermissionsOr403 } = require('../../../../middleware/conditionals')\nconst { submit, renderAdvisers, form } = require('./controllers/advisers')\n\nrouter.get('/', renderAdvisers)\...
javascript
edit
0
0
mit
fb4536068ef6050a2903e7ba8fb6c02ccff01439
uktrade/data-hub-frontend,uktrade/data-hub-fe-beta2,uktrade/data-hub-fe-beta2,uktrade/data-hub-frontend,uktrade/data-hub-frontend
src/apps/companies/apps/advisers/router.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\nmodule.exports.globals = {\n proxy: process.env.PROXY_URL || 'http://localhost:4200',\n proxyEnabled: process.env.PROXY_ENABLED === undefined ? false : process.env.PROXY_ENABLED === 'true',\n\n redisHost: process.env.REDIS_HOST || 'l...
javascript
edit
0
0
mit
ba78bb8f7a90558a2fe67f91e3305d63dbfdc70f
TheConnMan/missd,TheConnMan/missd,TheConnMan/missd
config/globals.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\nconst router = require('express').Router();\n\nrouter.get('/*', (req, res, next) => {\n const seFree = require('se-free'),\n domainName = parseDomainFromUrlPath(req.originalUrl),\n domainLookup = seFree(domainName);\n\n ...
javascript
edit
0
2
mit
05fdcac6fa83207956f67bc3fa7b0ad8270543d0
kpalmvik/isfree.se,kpalmvik/isfree.se
routes/domain-lookup.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\nimport reactDOMRunner from './reactDOMRunner';\n\nexport const endpoint = 'https://happo.now.sh';\nexport const include = '**/@(*-snaps|snaps).@(js|jsx)';\nexport const stylesheets = [];\nexport const targets = {};\nexport const configF...
javascript
edit
0
1
mit
9afe827941349417a8ef416ca2e0255020d28706
enduire/happo.io,enduire/happo.io
src/DEFAULTS.js
rejected_duplicate
Near-duplicate of sample 85166
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\n'use strict';\n\nvar _ = require('lodash');\n\nmodule.exports = function (answers) {\n this.prompts = {};\n this.prompts.projectName = answers.projectName;\n this.prompts.authorName = answers.useBranding ?...
javascript
edit
0
6
mit
558bb084d6d09f4a212f022640142ee812e61352
xfiveco/generator-xh,xhtmlized/generator-xh,xfiveco/generator-xh,xhtmlized/generator-xh
app/utils/setPrompts.js
accepted
null
true
[ { "role": "user", "content": "Write javascript code for the following: Create initial color & horse arrays" }, { "role": "assistant", "content": "var colors = [\"red\", \"blue\", \"magenta\", \"yellow\"]\nvar names = [\"Dan\", \"Dave\", \"Eleanor\", \"Rupert\"]\n\ncolors.push(\"green\")\nnames.p...
javascript
new_file
0
0
mit
3c9a7fa6231d10c8b7d3dff621f8a26b9f6015e4
elliedori/phase-0-tracks,elliedori/phase-0-tracks,elliedori/phase-0-tracks
js/data_structures.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\nrequire.config({\n baseUrl: '../src',\n\n paths: {\n // Vendor libraries\n async: '../bower_components/requirejs-plugins/async',\n sinon: '../bower_components/sinon/index',\n jasmine: '../bower_components/jasmine/lib/jasmi...
javascript
edit
0
1
bsd-3-clause
b7a96d30f240e46b1307105eaaca2b24c13eac18
aerisweather/googlemaps-amd,aerisweather/googlemaps-amd
test/specrunner.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\nangular.module('notely')\n .service('NotesService', NotesService);\n\n// NotesService\n// Handle CRUD operations against the server.\nNotesService.$inject = ['$http'];\nfunction NotesService($http) {\n var self = this;\n self.notes =...
javascript
edit
0
3
mit
93b377d3c66d96ab82b7722e5bcc409e53f1b66d
FretlessJS201511/notely,FretlessJS201511/notely
client/app/services/notes-service.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\ndescribe(\"About Expects\", function() {\n\n //We shall contemplate truth by testing reality, via spec expectations. \n it(\"should expect true\", function() {\n expect(true).toBeTruthy(); //This should be true\n });\n\n //To un...
javascript
edit
0
1
mit
5bda50aca253dced7089fd9eb98aff9dce37cb87
garronmichael/javascript-koans,garronmichael/javascript-koans,garronmichael/javascript-koans
koans/AboutExpects.js
rejected_duplicate
Near-duplicate of sample 71488
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\nimport { initLog } from 'roc';\nimport Dredd from 'dredd';\n\nconst log = initLog();\n\nexport default ({ context: { config: { settings } } }) => () => {\n const port = process.env.PORT || settings.runtime.port;\n\n const dredd = ...
javascript
edit
0
4
mit
0b76375e1ebc40067e9fe1afacf5cf499d903c8a
voldern/roc-plugin-dredd
extensions/roc-plugin-dredd/src/actions/dredd.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\nangular\n .module('app')\n .controller('LessonModalController', LessonModalController);\n\nfunction LessonModalController(self, $mdDialog, lesson, AuthService) {\n if (lesson && lesson.startTime) {\n lesson.startTime = n...
javascript
edit
0
3
mit
70a8010b001d9a7960915468c63c38449fcf4d67
TriumGroup/ReCourse,TriumGroup/ReCourse,TriumGroup/ReCourse
src/main/webapp/app/controllers/lessons/modals/lessonModal.controller.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\nimport React from 'react';\nimport { StyleSheet, Text, View, TextInput, Button } from 'react-native';\nimport { SearchBar } from 'react-native-elements'\n\nexport let SEARCH_QUERY = ''\nconst Home = ({ navigation: { navigate }}) => {\n ...
javascript
edit
0
1
mit
e5dae645d220a22a70babc7ac2216b79ebb2a136
bnovf/react-native-github-graphql-app
components/stateless/screens/Home.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\n#!/usr/bin/env node\n\nexports.command = {\n description: 'resolve a path to a project',\n arguments: '<path>'\n};\n\nif (require.main !== module) {\n return;\n}\n\nvar path = require('path');\nvar storage = require('../lib/storage.j...
javascript
edit
0
4
mit
afa164de11eec71948252f1eb469a7ed9c981dac
beaugunderson/projects,beaugunderson/projects
bin/projects-resolve.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\nimport Board from '../../../../frontend/src/shogi/board';\nimport Piece from '../../../../frontend/src/shogi/piece';\nimport memo from 'memo-is';\nimport _ from 'lodash';\n\ndescribe('black', () => {\n context('match the piece of coord...
javascript
edit
0
1
mit
20ba9b777292c4f74c28e942801ea928af6b7a9b
mgi166/usi-front,mgi166/usi-front
test/src/board/movable_point/lance_test.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\nmodule.exports = ({types: t}) => {\n return {\n pre(file) {\n const opts = this.opts;\n if (\n !(\n opts &&\n typeof opts === 'object' &&\n Object.keys(opts).every(key => (\n op...
javascript
edit
0
6
mit
4dd28119cb553ffa71cc2ab8a67e37295f6732b8
mopedjs/babel-plugin-import-globals
src/index.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\nimport { Game } from 'cervus/modules/core'; \nimport { Plane, Box } from 'cervus/modules/shapes';\nimport { basic } from 'cervus/modules/materials';\n\nconst game = new Game({\n width: window.innerWidth,\n height: window.innerHeight,\...
javascript
edit
0
1
isc
509b334c79b75adb2cd2d7bfa193b89e14a7dfd6
piesku/moment-lost,piesku/moment-lost
src/index.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\n\nimport {Video} from 'kaleidoscopejs';\nimport {ContainerPlugin} from 'clappr';\n\nexport default class Video360 extends ContainerPlugin {\n constructor(container) {\n super(container);\n this.listenTo(this.container, 'container...
javascript
edit
0
3
mit
4b81900bbe4bbf113fbfb967ff37938ac96f071f
thiagopnts/video-360,thiagopnts/video-360
src/index.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\n// @flow\n\nimport 'source-map-support/register';\nimport 'babel-polyfill';\nimport 'colors';\n// import async from 'async';\n// import _ from 'lodash';\nimport console from 'better-console';\n\nimport './fib-gen';\nimport './table';\ni...
javascript
edit
0
0
mit
cd1b69dfb75def40203f6783dbae7e4ebbe6f36a
abhisekp/Practice-Modern-JavaScript
src/index.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\nmodule.exports = {\n router: {\n base: '/test/'\n },\n cache: true,\n plugins: ['~plugins/test.js'],\n loading: '~components/loading',\n env: {\n bool: true,\n num: 23,\n string: 'Nuxt.js'\n }\n}\n\n```\n\nApply this ...
javascript
edit
0
1
mit
c026131558cdfd02d62d6d60bf494e93fd2d5285
jfroffice/nuxt.js,cj/nuxt.js,jfroffice/nuxt.js,cj/nuxt.js,mgesmundo/nuxt.js,mgesmundo/nuxt.js
test/fixtures/with-config/nuxt.config.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\n'use strict';\n\n(function () {\n var Peeracle = {};\n Peeracle.Media = require('./media');\n Peeracle.Peer = require('./peer');\n Peeracle.Tracker = require('./tracker');\n module.exports = Peeracle;\n})();\n\n```\n\nApply this ch...
javascript
edit
0
1
mit
1861155258d041d1c4b0c00dfb5b5e7407a37f0c
peeracle/legacy
src/peeracle.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\nimport React from 'react'\nimport ReactDOM from 'react-dom'\nimport { createGlobalStyle } from 'styled-components'\n\nimport { App } from './App'\nimport woff2 from './fonts/source-sans-pro-v11-latin-regular.woff2'\nimport woff from './...
javascript
edit
0
0
mit
ffe28bfd85557e4b6be741ecae96d79fded7223c
joelgeorgev/file-hash-verifier,joelgeorgev/file-hash-verifier
src/index.js
rejected_duplicate
Near-duplicate of sample 79789
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\nmodule.exports = function (creep) {\n\t// Aquire target\n\tif(creep.memory.currentTarget.ticksToRegeneration === undefined || !creep.memory.currentTarget.energy || !creep.memory.movement.path.length) {\n\t\tcreep.memory.currentTarget = ...
javascript
edit
0
7
mit
465fe8a992b6a277f0371fe175309b68688c77fe
pmaidens/screeps,pmaidens/screeps
creep.Harvester.behaviour.Harvest.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\nconst reviews = (state=[], action) => {\n switch (action.type) {\n case 'ADD_REVIEW':\n return [\n ...state, { \n id: action.id,\n reviewer: action.reviewer,\n text: action.text,\n rating: action....
javascript
edit
0
7
mit
037af037f4b392ebc51da482ff654b8915f8f448
andela-emabishi/immutable-redux
reducers/es5/reviews.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\n//var http = require('http');\nvar express = require('express');\n\nvar app = module.exports = express();\n\n/*http.createServer(function (req, res) {\n res.writeHead(200, {'Content-Type': 'text/plain; charset=utf-8'});\n res.end(...
javascript
edit
0
1
mit
29071eee23739d47dd9957b7fbdfacd5dd2918d7
pieszynski/test
app.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\n'use strict';\n\nclass TwitterService {\n // House Keeping of our connection/server\n constructor() {\n this.server = undefined;\n }\n\n start(done) {\n require('../server').then((server) => {\n this.server = server;\n ...
javascript
edit
0
2
mit
17f04695e0548e093533d8b498d2b741bdc9daeb
FritzFlorian/true-parrot,FritzFlorian/true-parrot
test/twitterService.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\n/* @flow */\nimport React from 'react';\nimport { Route, IndexRoute } from 'react-router';\n\nimport { App, NotFound } from './components/App.js';\nimport Home, { Who, How } from './components/Pages.js';\nimport { LogIn, SignUp } from '...
javascript
edit
0
0
mit
909be0fe839a61616bc62e93176a7ceb7f8fdd55
iansinnott/react-static-webpack-plugin,iansinnott/react-static-webpack-plugin
example/redux/client/routes.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\n/* Require modules */\n\nvar nodeTelegramBot = require('node-telegram-bot')\n , config = require('./config.json')\n , request = require(\"request\")\n , cheerio = require(\"cheerio\");\n\n/* Functions */\n\n/**\n * Uses the req...
javascript
edit
0
3
mit
2a780f2132c867a996e78c1c0f1e9ef92d4a86fa
frdmn/telegram-WhatToEatBot
bot.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\nvar gulp = require('gulp');\nvar jshint = require('gulp-jshint');\nvar stylish = require('jshint-stylish');\nvar mocha = require('gulp-mocha');\n\ngulp.task('lint', function() {\n gulp.src(['src/**/*.js', 'test/**/*.js'])\n .p...
javascript
edit
0
1
mit
092931766b842f4be71c27ab467f3549e1acf901
MadaraUchiha/chusha
Gulpfile.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// Escape a string for regexp use\nfunction escapeRegExp(string) {\n return string.replace(/[.*+?^$...
javascript
edit
0
3
mit
074039a1aa2c9f184e15c1fb78944e1096a78cd3
adamsea/recipes-api
routes/recipes/index.js
rejected_duplicate
Near-duplicate of sample 67447
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\nvar getDefaultHistory = require('./history/getHistory');\n\n\n/**\n * Bootstraps the app by getting the initial state.\n */\nfunction attach(Router, element, opts) {\n if (!opts) opts = {};\n var router = new Router();\n var history ...
javascript
edit
0
3
mit
9731f408a89cf848959f7e593277cc2e67b1a437
matthewwithanm/monorouter
lib/attach.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\n#!/usr/bin/env node\n/*\n *\n * Copyright 2015 gRPC authors.\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...
javascript
edit
0
2
apache-2.0
fe752be0c1f02be11ae2feb53b4e730fee9d9d42
grpc/grpc-node,grpc/grpc-node,grpc/grpc-node,grpc/grpc-node
packages/grpc-tools/bin/protoc_plugin.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\n// Cache system is a bit outdated and could do with work\n\nmodule.exports = function(window, options, logger) {\n var cache = null;\n if (options.env !== 'development') {\n try {\n cache = (typeof(window.localSt...
javascript
edit
0
6
apache-2.0
e45f7eb62428aa8e5b00afeca2fa0bed5aeb9c21
pkdevbox/less.js,dyx/less.js,MrChen2015/less.js,less/less.js,xiaoyanit/less.js,royriojas/less.js,bendroid/less.js,cypher0x9/less.js,PUSEN/less.js,mishal/less.js,christer155/less.js,paladox/less.js,lvpeng/less.js,ridixcr/less.js,miguel-serrano/less.js,NaSymbol/less.js,SomMeri/less-rhino.js,yuhualingfeng/less.js,jjj117/l...
lib/less-browser/cache.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\n/**\n * Figlet JS node.js module\n * \n * Copyright (c) 2010 Scott González\n * Dual licensed under the MIT (MIT-LICENSE.txt)\n * and GPL (GPL-LICENSE.txt) licenses.\n * \n * http://github.com/scottgonzalez/figlet-js\n */\n\nvar Figlet ...
javascript
edit
0
2
mit
c77cf00a60d489aaf3ceb45eb9f08ba7a85d2097
olizilla/figlet-js
figlet-node.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\n/*\n * Test-unit framework for sqlCommands.js\n */\n\nconst assert = require('assert');\n\nconst vows = require('vows');\n\nconst Sql = require('../../src/database/sql-related/sqlCommands');\n\nconst sqlCommands = new Sql();\n\nconst is...
javascript
edit
0
3
mit
91e3c6bddf1345970b7e2f8a34a487ccf9dc5224
nus-mtp/sashimi-note,nus-mtp/sashimi-note,nus-mtp/sashimi-note
sashimi-webapp/test/database/sqlCommands_test.js
accepted
null
true