messages listlengths 2 2 | language stringclasses 8
values | prompt_type stringclasses 2
values | lint_errors int64 0 129 ⌀ | cyclomatic_complexity int64 0 32 ⌀ | license stringclasses 7
values | commit stringlengths 40 40 | repos stringlengths 5 116k | new_file stringlengths 4 220 | status stringclasses 6
values | error stringlengths 26 74 ⌀ | is_valid_syntax bool 2
classes |
|---|---|---|---|---|---|---|---|---|---|---|---|
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n// extensions initialisation\n\nimport _ from \"lodash\";\nimport {registerComponents} from '../common/module-utils';\nimport {dynamicSections, dynamicSectionsByKind} from \"../dynamic-section/dynamic-section-definitions\";\n\nimport db... | javascript | edit | 0 | 2 | apache-2.0 | 9a01fa812bd92c7ac94639f9321072f3194d3b1f | davidwatkins73/waltz-dev,rovats/waltz,rovats/waltz,rovats/waltz,kamransaleem/waltz,khartec/waltz,kamransaleem/waltz,rovats/waltz,davidwatkins73/waltz-dev,khartec/waltz,kamransaleem/waltz,davidwatkins73/waltz-dev,khartec/waltz,davidwatkins73/waltz-dev,kamransaleem/waltz,khartec/waltz | waltz-ng/client/extensions/extensions.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nfunction createNavLink(id, args = {}) {\n const {text, to, href, authenticated, rest} = args;\n return {\n authenticated,\n id,\n text: text || id.charAt(0).toUpperCase() + id.slice(1),\n to: to || '/' + id,\n href,\n ... | javascript | edit | 0 | 3 | cc0-1.0 | cf1af1b56d8caa3da7a94fb4593cc4106aacb3f7 | cape-io/acf-client,cape-io/acf-client | src/defaultState.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nimport fs from 'fs'\nimport http from 'http';\nimport path from 'path';\n\nimport React from 'react';\nimport Baobab from 'baobab';\nimport {root} from 'baobab-react/higher-order';\n\nimport defaultData from './data';\nimport Html from ... | javascript | edit | 0 | 1 | mit | 217e16f748783b176626b83e5a69bfaafa0c8132 | kompot/rjanko-forms | examples/users/src/renderApp.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n'use strict';\n\nvar config = require('../config/configuration.js');\n\nfunction htmlReplace(str) {\n return str.replace(/<\\/?[^>]+\\/?>/g, ' ').replace(/ +/g, ' ').replace(/ ?\\n ?/g, '\\n').trim();\n}\n\nmodule.exports = function(pa... | javascript | edit | 0 | 6 | mit | bd1de87adff7cffb6ebcee0ff05ef6ac6e58c96a | AnyFetch/embedmail-hydrater.anyfetch.com | lib/index.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nconst CLIEngine = require('eslint').CLIEngine;\n\nfunction makeFixer(options) {\n if (!options || !Array.isArray(options.rules) || !options.rules.length) {\n return false;\n }\n const rulesToFix = options.rules;\n\n return functi... | javascript | edit | 0 | 4 | mit | 688f1ddac6a963dfff49e9747d0ecbfe634b7766 | IanVS/eslint-filtered-fix | src/filtered-fix.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nvar BfsSetupSearch = BfsSetupSearch || {};\n\nBfsSetupSearch.init = function() {\n $(function() {\n $('div.quickfindContainer input#setupSearch').val(' ');\n });\n}\n\nchrome.storage.sync.get({\n 'setupsearch': true\n}, function(i... | javascript | edit | 0 | 3 | mit | b615ce24fac767ae611480492be174a6f471eaf1 | mattsimonis/boostr,mattsimonis/boostr | app/js/setupsearch.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nvar spark = require('textspark');\n\nvar generateMetricParams = function(namespace, metric, unit, instance_id, dimension, period) {\n var endDate = new Date();\n var startDate = new Date(endDate);\n var durationMinutes = 60... | javascript | edit | 0 | 4 | mit | 391dc74a28e4935b8b407b2e880d71269fbdbce8 | msempere/hal9001 | lib/utils.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nmodule.exports = {\n entry: {\n \"demo-perseus\": \"./src/demo-perseus.js\",\n \"frame-perseus\": \"./src/perseus-frame.js\",\n },\n output: {\n path: \"./build\",\n publicPath: \"/build/\",\n ... | javascript | edit | 0 | 0 | mit | d229a64300fc82e116bb16475295a40e294b64d1 | learningequality/perseus,ariabuckles/perseus,learningequality/perseus,ariabuckles/perseus,ariabuckles/perseus,ariabuckles/perseus | webpack.config.demo-perseus.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nimport Ember from 'ember';\nimport config from 'ember-get-config';\n\nexport default Ember.Service.extend({\n store: Ember.inject.service(),\n id: config.PREPRINTS.provider,\n\n provider: Ember.computed('id', function() {\n ... | javascript | edit | 0 | 3 | apache-2.0 | c3b59b1839814a562ea96e4bd20f4b71ba23a80c | pattisdr/ember-preprints,caneruguz/ember-preprints,pattisdr/ember-preprints,baylee-d/ember-preprints,CenterForOpenScience/ember-preprints,CenterForOpenScience/ember-preprints,laurenrevere/ember-preprints,caneruguz/ember-preprints,laurenrevere/ember-preprints,baylee-d/ember-preprints | app/services/theme.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nimport { createGlobalStyle } from 'styled-components';\n\nexport const GlobalStyle = createGlobalStyle`\n * {\n box-sizing: border-box;\n }\n\n html, body {\n margin: 0;\n padding: 0;\n color: #1c1c1c;\n background-col... | javascript | edit | 0 | 0 | mit | f8b410e287d4a63a2192947712eb7ae268d97dca | mnbbrown/mnbbrown.github.io,mnbbrown/mnbbrown.github.io | src/global-style.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nimport React from 'react';\nimport { connect } from 'react-redux';\n\nimport { doControl } from '../../actions/app-actions';\n\nclass NodeDetailsControlButton extends React.Component {\n constructor(props, context) {\n super(props, ... | javascript | edit | 0 | 2 | apache-2.0 | 802559e5277858bb33add1f7c9b6ab7afbf1c9c0 | alban/scope,kinvolk/scope,kinvolk/scope,alban/scope,weaveworks/scope,weaveworks/scope,weaveworks/scope,weaveworks/scope,weaveworks/scope,alban/scope,kinvolk/scope,alban/scope,kinvolk/scope,alban/scope,weaveworks/scope,kinvolk/scope,kinvolk/scope,alban/scope | client/app/scripts/components/node-details/node-details-control-button.js | rejected_duplicate | Near-duplicate of sample 84096 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n/*\n * textnodes\n * \n *\n * Copyright (c) 2014 Mark Florian\n * Licensed under the MIT license.\n */\n\n(function($) {\n\n // Collection method.\n $.fn.textnodes = function() {\n return this.each(function(i) {\n // Do someth... | javascript | edit | 0 | 6 | mit | 3142fa2c23f679c81da725a61266089ff9c7f563 | yougov/jquery.textnodes | src/textnodes.js | accepted | null | true |
[
{
"role": "user",
"content": "Write javascript code for the following: Add exports for new components"
},
{
"role": "assistant",
"content": "export { BaseStepperButton } from './BaseStepperButton';\nexport { BaseStepperInput } from './BaseStepperInput';\nexport { StepperInputWithLabel } from './... | javascript | new_file | 0 | 0 | mit | ecb01074c9edef9cdab109aa1ebd155f456fb656 | sussol/mobile,sussol/mobile,sussol/mobile,sussol/mobile | src/widgets/StepperInputs/index.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nmodule.exports = function(config) {\n config.set({\n basePath: '.',\n frameworks: ['jquery-3.2.1', 'jasmine-jquery', 'jasmine'],\n browsers: ['ChromeHeadless'],\n files: [\n 'spec/helpers/tampermonkeyStubs.js',\n ... | javascript | edit | 0 | 1 | mit | b0a4355a9ff25a0702c5c7c3c0f3deac6a027443 | rslifka/fate_of_all_fools,rslifka/fate_of_all_fools | karma.conf.js | rejected_duplicate | Near-duplicate of sample 71798 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nimport '../../api/server';\nimport '../facebook';\nimport seedData from '../seed-data';\n\nMeteor.startup(() => {\n process.env.MAIL_URL = Meteor.settings.MAIL_URL;\n\n seedData();\n});\n\n```\n\nApply this change: Set Meteor methods ... | javascript | edit | 0 | 1 | apache-2.0 | 3c7c5e732eee6d45e5b8d8e311e2f5321bb12bf6 | evancorl/skate-scenes,evancorl/portfolio,evancorl/skate-scenes,evancorl/portfolio,evancorl/portfolio,evancorl/skate-scenes | imports/server/startup/index.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n// Karma configuration\n\n// base path, that will be used to resolve files and exclude\nbasePath = '';\n\n// list of files / patterns to load in the browser\nfiles = [\n JASMINE,\n JASMINE_ADAPTER,\n 'app/bower_components/angular/ang... | javascript | edit | 0 | 0 | mit | 5ea672766e2a22dc2594d2ace695cbe7227a7095 | CruGlobal/conf-registration-web,CruGlobal/conf-registration-web,CruGlobal/conf-registration-web,CruGlobal/conf-registration-web | karma.conf.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n/* global IntersectionObserver */\nvar scroller = document.querySelector('#scroller');\nvar sentinel = document.querySelector('#sentinel');\nvar counter = 1;\n\nfunction loadItems(n) {\n for (var i = 0; i < n; i++) {\n var newItem =... | javascript | edit | 0 | 2 | apache-2.0 | 86c182e99ee66a2d44ab3fc8abf4786a61690040 | beaufortfrancois/samples,beaufortfrancois/samples,GoogleChrome/samples,GoogleChrome/samples,GoogleChrome/samples,beaufortfrancois/samples,beaufortfrancois/samples,GoogleChrome/samples,GoogleChrome/samples | intersectionobserver/demo.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nconst getMarkdown = require('./getMarkdown')\nconst config = require('../config.js')\n\nmodule.exports = (root) => new Promise((resolve, reject) => {\n getMarkdown(`${root}/*`)\n .then((mdArr) => {\n resolve(\n mdArr.map... | javascript | edit | 0 | 2 | mit | a821342a742ac3be80df344bff605856bd127f4f | Kriegslustig/lucaschmid.net,Kriegslustig/lucaschmid.net,Kriegslustig/lucaschmid.net | common/lib/getArticles.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nvar os = require('os')\r\n\t, path = require('path')\r\n\t, express = require('express')\r\n\t, less = require('less-middleware')\r\n\t, tmp = path.join(os.tmpDir(), 'TesselKey')\r\n\t, root = __dirname\r\n\t, pub ... | javascript | edit | 0 | 1 | mit | da68678ece4aa2e958dd1b46303bda6617a6f4d3 | OlsonDev/TesselKey | src/server.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nconst path = require('path');\nvar DuplicatePackageCheckerPlugin = require('../');\n\nmodule.exports = {\n entry: './entry.js',\n context: __dirname,\n output: {\n path: path.resolve(__dirname, 'dist'),\n filename: 'bundle.js'\... | javascript | edit | 0 | 0 | mit | f0e021d7f47fb9b525ce1327dab77ead85bee780 | darrenscerri/duplicate-package-checker-webpack-plugin | test/webpack.config.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n\"use strict\";\n\nvar m = require(\"mithril\"),\n \n db = require(\"../lib/firebase\"),\n \n layout = require(\"./layout\"),\n listings = require(\"./content/listings\");\n\nmodule.exports = {\n controller : functio... | javascript | edit | 0 | 2 | mit | 31f2cac94b4d660325a7243d79782b22e689e72b | tivac/anthracite,Ryan-McMillan/crucible,Ryan-McMillan/crucible,kevinkace/crucible,tivac/anthracite,tivac/crucible,tivac/crucible,kevinkace/crucible | src/pages/content.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nimport NumberType from './number';\n\nconst { round, abs } = Math;\n\nclass IntType extends NumberType {\n constructor(min, max) {\n super(min, max);\n\n this.validators.push(val => (abs(val) - round(abs(val))) === 0);\n }\n}\n\... | javascript | edit | 0 | 1 | mit | 28314b06df803219263b6c1f48817b33dee0960f | TeslaCtroitel/twconf | src/types/int.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nvar _ = require('lodash')\nvar fs = require('fs')\nvar gzip = require('gzip-size')\nvar filesize = require('filesize')\nvar cssstats = require('cssstats')\n\nvar module = require('tachyons-images/package.json')\nvar moduleCss = fs.readF... | javascript | edit | 0 | 0 | mit | 45409e7aed1c0605031cdbc765a5fc47cf41746d | pietgeursen/pietgeursen.github.io,getfrank/tachyons,topherauyeung/portfolio,topherauyeung/portfolio,fenderdigital/css-utilities,matyikriszta/moonlit-landing-page,topherauyeung/portfolio,cwonrails/tachyons,tachyons-css/tachyons,fenderdigital/css-utilities | lib/images.js | rejected_duplicate | Near-duplicate of sample 67327 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n'use strict'\nconst mongoose = require('mongoose')\n\nvar tweetSchema = new mongoose.Schema({\n embed_id: String\n}, {_id: false})\n\nvar articleSchema = new mongoose.Schema({\n title: String,\n description: String,\n source: String... | javascript | edit | 0 | 1 | mit | f201db2fbda03a04cbdf6e9db787badb58122f02 | SentiSocial/backend,SentiSocial/sentisocial-backend | src/models/trend.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nimport {addLocaleData} from 'react-intl';\nimport {updateIntl as superUpdateIntl} from 'react-intl-redux';\nimport languages from '../languages.json';\nimport messages from '../../locale/messages.json';\nimport {IntlProvider, intlReduce... | javascript | edit | 0 | 2 | bsd-3-clause | 7e3ef0c48b1390d2c6622197c927e0620786f24e | cwillisf/scratch-gui,LLK/scratch-gui,cwillisf/scratch-gui,cwillisf/scratch-gui,LLK/scratch-gui | src/reducers/intl.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n/**\n * Patterns pat-polyfill-colour - Polyfill for colour inputs.\n *\n * Copyright 2014 Marko Durkovic\n * Copyright 2014 Simplon B.V. - Wichert Akkerman\n */\ndefine([\n \"pat-registry\",\n \"spectrum\"\n], function(registry) {... | javascript | edit | 0 | 1 | bsd-3-clause | f1fc563e4f448da4c5b4377208ee203838d7e247 | garbas/Patterns,janga1997/Patterns,janga1997/Patterns,garbas/Patterns,garbas/Patterns,janga1997/Patterns | src/pat/colour-picker.js | rejected_duplicate | Near-duplicate of sample 84547 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nmodule('constructor');\n\ntest('create from document.createElement', function() {\n var time = document.createElement('local-time');\n equal('LOCAL-TIME', time.nodeName);\n});\n\ntest('create from constructor', function() {\n var tim... | javascript | edit | 0 | 1 | mit | 950924eb51469a1ac919ee628e17f1e51941bf26 | shield-9/time-elements-ja,zenorocha/time-elements,zenorocha/time-elements,ATofighi/time-elements-jalali,shield-9/time-elements-ja,github/time-elements,github/time-elements,ATofighi/time-elements-jalali | test/constructor.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n'use strict';\n\nvar URLArgsProvider = require('../providers/URLArgsProvider');\nvar RequestRouter = require('../RequestRouter');\nvar ContextFactory = require('../ContextFactory');\nvar ModuleApiProviderBase = require('../base/ModuleAp... | javascript | edit | 0 | 2 | mit | 95eae32ec99d6b6512f437b7b4cc81d1ca345679 | catbee/catbee,markuplab/catbee,markuplab/catbee | lib/base/BootstrapperBase.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\ndefine([], function() {\n \"use strict\"\n\n const EvalUtils = {\n \n evalOrError(text) {\n let result\n try {\n result = EvalUtils.eval(\"(\" + text + \")\")\n } catch... | javascript | edit | 0 | 3 | mit | b0430ebb4ecfe5c15f4f34b46d757d79c906ed70 | pdfernhout/Twirlip7,pdfernhout/Twirlip7,pdfernhout/Twirlip7 | src/ui/EvalUtils.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nvar API_URL = 'http://127.0.0.1:8000'\n\n$().ready( function(){\n\n var $emailField = $('#email-field')\n var $signupButton = $('#signup-button')\n var $form = $('#signup-form')\n var $errorContainer = $('#signup-result .res... | javascript | edit | 0 | 1 | mit | 441b1ff107264b86b9be298d85518b78f7d8a3f9 | ldiqual/buildnumber.io,ldiqual/buildnumber.io,ldiqual/buildnumber.io,ldiqual/buildnumber.io,ldiqual/buildnumber.io | static/js/app.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n// irc.js\n//\n// Defines helper functions for working with IRC messages in Javascript.\nvar irc = (function(window){\n var my = {};\n\n // The regex used to parse IRC messages. I swear, it works.\n my.IRCRegex = /^(?:\\:(\\S+)... | javascript | edit | 0 | 7 | mit | ceaa561a408168291fc06ef02ff6801338d178da | Lukasa/pyrc,Lukasa/pyrc | static/js/irc.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n'use strict';\n\nvar request = require(\"request\");\nvar defaultUserAgent = require(\"./user_agent\");\n\nmodule.exports = {\n\n // @param {string} apiToken the Dialog API token\n // @param {string} botId the Dialog bot Id\n // @par... | javascript | edit | 0 | 1 | mit | 859bf8f4e7aa642bdfae0d781ddc0d93bb249f45 | dialoganalytics/dialog-node | lib/dialog.js | rejected_duplicate | Near-duplicate of sample 87385 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nexport const networkMaskMax = 32\nexport const networkMaskMin = 0\n\n/**\n * Convert decimal value to binary representation\n * @param {Number} decimal - decimal value to convert to binary\n * @returns {String} string containing binary ... | javascript | edit | 0 | 2 | mit | a3276b1417ed9d062da907bdd23382b7682b6714 | ciena-frost/ember-frost-bunsen,ciena-frost/ember-frost-bunsen,sophypal/ember-frost-bunsen,sandersky/ember-frost-bunsen,sandersky/ember-frost-bunsen,ciena-frost/ember-frost-bunsen,sandersky/ember-frost-bunsen,sophypal/ember-frost-bunsen,sophypal/ember-frost-bunsen | addon/validator/custom-formats/utils.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\ndefine([\n 'streamhub-map/point',\n 'streamhub-map/views/marker-view',\n 'inherits',\n 'd3',\n 'colorbrewer'\n],\nfunction (Point, MarkerView, inherits, d3, colorbrewer) {\n\n var SymbolView = function (point, opts) {\... | javascript | edit | 0 | 2 | mit | 1613e2e98961b03138cba0d7a76c061b2728485f | cheung31/streamhub-map,Livefyre/streamhub-map,Livefyre/streamhub-map | src/views/symbol-view.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n$(window).load(function(){\nvar timerMessage = 'It is time to work: ';\nvar workToggle = true;\nvar minWorked = 0;\nvar minGoofed = 0;\nvar bell = document.createElement('audio');\nbell.setAttribute('src', 'http://soundbible.com/grab.ph... | javascript | edit | 0 | 2 | mit | b0bcf10a5fbcca3b07260c87c66988c727f6c892 | tdreid/Tenntoo,tdreid/Tenntoo | js/script.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nconst path = require('path')\nconst WorkboxPlugin = require('workbox-webpack-plugin')\n\nconst DIST_DIR = 'dist'\n\nmodule.exports = {\n plugins: [\n new WorkboxPlugin({\n globDirectory: DIST_DIR,\n globPatterns: ['**/*.{h... | javascript | edit | 0 | 0 | mit | 9bb87b1f540f5bffca75df1179d9e3a480becc13 | Holi0317/bridge-calc,Holi0317/bridge-calc,Holi0317/bridge-calc | webpack-cfg/workbox.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n// Copyright (c) 2017 The Regents of the University of Michigan.\n// All Rights Reserved. Licensed according to the terms of the Revised\n// BSD License. See LICENSE.txt for details.\n\nmodule.exports = function() {\n return {\n \"r... | javascript | edit | 0 | 1 | bsd-3-clause | aaaae2e08610fc3e3342fbed105bacf97043202e | daaang/awful-mess | lib/mock/changing-filesystem.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n\"use strict\";\n\nconst filelistSymbols = require(\"./file-symbols\");\n\nmodule.exports = function (core) {\n class FileList {\n constructor() {\n if (!(this instanceof FileList)) {\n throw new TypeError(\"DOM object c... | javascript | edit | 0 | 2 | mit | fc79d594d34a51c9986e4ed8fe382d2f658a1c0d | Joris-van-der-Wel/jsdom,mbostock/jsdom,nicolashenry/jsdom,Joris-van-der-Wel/jsdom,Sebmaster/jsdom,mbostock/jsdom,snuggs/jsdom,fiftin/jsdom,Sebmaster/jsdom,Zirro/jsdom,tmpvar/jsdom,nicolashenry/jsdom,mzgol/jsdom,Zirro/jsdom,mzgol/jsdom,fiftin/jsdom,mzgol/jsdom,mbostock/jsdom,Joris-van-der-Wel/jsdom,snuggs/jsdom,tmpvar/j... | lib/jsdom/living/filelist.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nvar lodash = require('lodash');\n\nvar formats = {\n lowercase: /^[a-z][a-z\\d]*$/,\n underscore: /^[a-z][a-z\\d]*(_[a-z][a-z\\d]*)*$/,\n dash: /^[a-z][a-z\\d]*(-[a-z][a-z\\d]*)*$/,\n camel: /^[a-zA-Z][a-zA-Z\\d]*$/\n};\n\nm... | javascript | edit | 0 | 2 | isc | 3d03b3169f5a5c9a3feabed355ba4cc03b596f5e | htmllint/htmllint,KrekkieD/htmllint,KrekkieD/htmllint,htmllint/htmllint | lib/knife/get_format_test.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n'use strict';\n\nglobal.Log = new (require('winston').Logger);\nglobal.Config = require('nconf');\n\nConfig.defaults({\n // The S3 Source module uses some Config parameters as defaults\n index: {\n path: 'index.json',\n interval... | javascript | edit | 0 | 0 | mit | 1936cb974883665850772000c13e7e91e1c80b5b | rapid7/propsd,rapid7/propsd,rapid7/propsd | test/lib/helpers.js | accepted | null | true |
[
{
"role": "user",
"content": "Write javascript code for the following: Add a simple test for Map shim."
},
{
"role": "assistant",
"content": "var data = [\n\n [\"foo\", \"bar\"],\n [\"constructor\", \"zootsuit\"],\n [1, {}],\n [NaN, \"hello\"],\n [Infinity, \"world\"]\n \n];\n\... | javascript | new_file | 0 | 1 | mit | 7ba848e88b73e87e0777c868c677cbd7406bb377 | zenparsing/esdown,zenparsing/es6now,zenparsing/es6now | test/shim/mapset.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nimport Vue from 'vue'\nimport Router from 'vue-router'\nimport index from '@/components/index'\nimport four from '@/components/four'\n\nVue.use(Router)\n\nexport default new Router({\n mode: 'history',\n routes: [\n {\n path: ... | javascript | edit | 0 | 1 | apache-2.0 | e77948638946f6b78777c32925a877d47614a16f | nluedtke/linux_kernel_cves,nluedtke/linux_kernel_cves | ui/src/router/index.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nimport { inject as service } from '@ember/service';\nimport Component from '@ember/component';\n\nexport default class ClassFieldDescription extends Component {\n @service\n legacyModuleMappings;\n\n get hasImportExample() {\n ret... | javascript | edit | 0 | 1 | mit | f1cb13d6c4cc7ea8b3aa2ae64fb64fd6edfe4b19 | ember-learn/ember-api-docs,ember-learn/ember-api-docs | app/components/class-field-description.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nimport React from 'react'\nimport { FormattedMessage } from 'react-intl'\n\nexport const TelegramDetails = ({ measurement }) => {\n return (\n <div>\n {measurement.test_keys.telegram_tcp_blocking === false &&\n <div>\n ... | javascript | edit | 0 | 5 | bsd-2-clause | 9d6ec6b922b87661d8ef3265799f086b11793a28 | TheTorProject/ooni-wui,TheTorProject/ooni-wui | src/routes/Measurements/components/nettests/Telegram.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n(function() {\n\tnew App.Routers.Router();\n\tBackbone.history.start({pushState: false});\n})();\n```\n\nApply this change: ADD INSTANTIATED ROUTERS TO GLOBAL VARIABLE\n\nIn order to access the Router defined by App.Routers.Router(), it... | javascript | edit | 0 | 1 | mit | d5c6375e1454490619de23fa25ac50ef659cdacd | iiiepe/simplelogs,iiiepe/simplelogs | public/js/app.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nvar webpack = require('webpack');\n\nmodule.exports = {\n devtool: 'eval',\n entry: [\n 'webpack-dev-server/client?http://localhost:3000',\n 'webpack/hot/only-dev-server',\n './scripts/index'\n ],\n output: {\n path: __d... | javascript | edit | 0 | 0 | mit | 1c1c9481bcebaf95125c451b31c18c83bf18114c | DelvarWorld/cats-react,Ehesp/react-flux-webpack-boilerplate,michaelBenin/react-hot-boilerplate,atlonis/teach-react,bedrich/gimme-react,rikukissa/flappy-bird,meta-meta/react-synonym-game,autozimu/react-hot-boilerplate,lyhoanglong/react-hot-boilerplate,miknonny/reflux_stores,mjxm/loadingscreen,Eol217/redux-course,alphanu... | webpack.config.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nmodule.exports = function(email) {\n if (!email) return null\n if ('string' !== typeof email) return null\n var domain\n , username\n\n email = email.toLowerCase()\n email = email.trim()\n\n if (!~email.indexOf('@')) return nul... | javascript | edit | 0 | 11 | mit | 925d08293baf2c8e3b7f6de5e525df157274ba16 | evanlucas/verigy | lib/index.js | rejected_complexity | Cyclomatic complexity too high: 11 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nvar Sequelize = require('sequelize'),\n _ = Sequelize.Utils._;\n\nmodule.exports = function(target) {\n if (target instanceof Sequelize.Model) {\n // Model\n createHook(target);\n } else {\n // Sequelize instance\n targ... | javascript | edit | 0 | 3 | mit | ef8be93f19890404db4764819d9eaf3c1b26da33 | ackerdev/sequelize-attribute-roles | lib/index.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nvar authController = (models, _validate, _h, jwt, co) => {\n var Authenticate = (req, res) => {\n _validate.validateAuthParams(req, function (err) {\n co(function* () {\n if (err) return res.status(400).json(err);\n ... | javascript | edit | 0 | 5 | mit | 7e49c2c619a2d9ed99156dd5493a7e9cf7eecf4f | andela-blawrence/DMS-REST-API,andela-blawrence/DMS-REST-API | app/server/controllers/auth-controller.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nvar NodeGit = require(\"../\");\n\nvar Status = NodeGit.Status;\n\nmodule.exports = Status;\n\n```\n\nApply this change: Add override methods for Status"
},
{
"role": "assistant",
"content": "var NodeGit = require(\"../\");\... | javascript | edit | 0 | 1 | mit | a843a9a71e1e7565401a25a15991da58df88e784 | IonicaBizauKitchen/nodegit,cwahbong/nodegit,dkoontz/nodegit,srajko/nodegit,StephanieMak/nodegit,jdgarcia/nodegit,bengl/nodegit,cwahbong/nodegit,jfremy/nodegit,kenprice/nodegit,bengl/nodegit,eunomie/nodegit,freder/nodegit,Naituw/nodegit,kenprice/nodegit,chasingmaxwell/nodegit,nodegit/nodegit,StephanieMak/nodegit,jfremy/... | lib/status.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nmodule.exports = {\n Env: process.env.NODE_ENV || 'development',\n Permissions: {\n viewPage: 'viewPage'\n },\n boxWidth: 55,\n boxHeight: 30,\n Difficulties: {\n 1: {\n name: 'Easy',\n ... | javascript | edit | 0 | 0 | mit | ae6385dbb29141cf6af3803cfac4edd83cecf742 | EnzoMartin/Minesweeper-React,EnzoMartin/Minesweeper-React | config/Definitions.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n/** facebook.js\n* @file: /config/passport/facebook.js\n* @description: Handles passport authentication for Facebook strategy\n* @parameters: Object(config)\n* @exports: Facebook authentication for Passport\n*/\n\nvar FacebookStrategy =... | javascript | edit | 0 | 1 | unlicense | cd48d80f918e571999dc28c549541d0deb5a9f1e | Vegosvar/Vegosvar,Vegosvar/Vegosvar,Vegosvar/Vegosvar | src/config/passport/facebook.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\ncore.Module(\"unify.core.Statics\", {\n\tannotate: function(Clazz, statics) {\n\t\tvar clsname = (\"\"+Clazz).substring(7);\n\t\tclsname = clsname.substring(0, clsname.length-1);\n\t\tcore.Main.addStatics(clsname, statics);\n\t}\n});\n`... | javascript | edit | 0 | 1 | mit | 73772bc36de57b873c8e1d4f94bce7411e37b835 | unify/unify,unify/unify,unify/unify,unify/unify,unify/unify,unify/unify | unify/framework/source/class/unify/core/Statics.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nimport Class from \"./class.js\"\nimport * as _ from \"../deps/underscore-1.10.2-esm.js\"\n\n//\n// Errors\n//\n\nconst BiwaError = Class.create({\n initialize: function(msg){\n this.message = \"Error: \"+msg;\n },\n toString: fun... | javascript | edit | 0 | 1 | mit | 15644911d3462088357055041c7769a88e6c5391 | biwascheme/biwascheme,biwascheme/biwascheme,biwascheme/biwascheme | src/system/error.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n/* eslint import/no-extraneous-dependencies: 0 */\n\nconst ExtractTextPlugin = require('extract-text-webpack-plugin');\nconst path = require('path');\n\nmodule.exports = {\n watch: false,\n devtool: 'cheap-eval-source-map',\n e... | javascript | edit | 0 | 0 | mit | e0fcca9ad0b2dc71c624aa305101d8b9e4dd93ad | codeofsumit/leaflet.pm,codeofsumit/leaflet.pm | webpack.build.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nconst chai = require(\"chai\");\r\nconst CNJokes = require(\"./index.js\");\r\n\r\nconst sinon = require(\"sinon\");\r\n\r\ndescribe(\"get chucknorris joke\", function() {\r\n let sandbox;\r\n let server;\r\n beforeEach(() => {\r... | javascript | edit | 0 | 1 | mit | a1c2396f6f2f6e18c86c993a63dc5bb9f4698a1e | muhtarudinsiregar/chucknorris-quotes | tests.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nconst { assign } = require('../../common')\n\n\nconst OPTION_PROPERTIES = {\n long: {\n type: 'boolean',\n default: true,\n },\n short: {\n type: 'boolean',\n default: true,\n },\n positional: {\n type: 'boolean',\n ... | javascript | edit | 0 | 1 | isc | 0f3a2b8833bfc2e0f4b45ed1707298d08edfaf6b | alex-shnayder/comanche | src/plugins/cli/modifySchema.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nimport React from \"react\";\nimport ImageGallery from \"react-image-gallery\";\n\nclass ItemGallery extends React.Component {\n constructor(props) {\n super(props);\n this.defineImage = this.defineImage.bind(this);\n this.get... | javascript | edit | 0 | 3 | mit | 59a5481836605bf3dc6177e643bdcebfef88696e | participedia/frontend,participedia/frontend | src/containers/Case/ItemGallery.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nconst mongoose = require('mongoose')\nconst Store = mongoose.model('Store')\n\nexports.addStore = (req, res) =>\n res.render('edit', { title: 'Add Store' })\n\nexports.createStore = async (req, res) => {\n const store = await (new Sto... | javascript | edit | 0 | 1 | mit | 66cc470d2301d48e00cadb4a81634b7269e0e97e | kutyel/learn-node,kutyel/learn-node | controllers/store.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nimport Core from './core';\n\n// A search result for a Bible reference search\nclass Reference {\n\n // Build the JSON for a search result\n constructor({name, uid, book, query, version, content}) {\n\n if (book && query && version... | javascript | edit | 0 | 8 | mit | a4ffc5aaf7b565734aaf32098b437ceb9aa44177 | caleb531/youversion-suggest-chrome,caleb531/youversion-suggest-chrome | src/scripts/models/reference.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n// This file merely configures the store for hot reloading.\n// This boilerplate file is likely to be the same for each project that uses Redux.\n// With Redux, the actual stores are in /reducers.\n\nimport {createStore, compose, applyM... | javascript | edit | 0 | 3 | mit | 998be6f92b472095090eabb69b0a5299bd224fad | t103z/interview,t103z/interview,t103z/interview,t103z/interview | src/store/configureStore.dev.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nimport * as React from \"react\";\nimport {render} from \"react-dom\";\nimport {App} from \"./App\";\n\n// Render our App Component to element with ID == target\nconst target = 'root';\nrender (\n\t<App name = 'Sam'/>,\n\tdocument.getEl... | javascript | edit | 0 | 0 | apache-2.0 | d21fa5783d39907bb3fb7757a18024376f6dea87 | googleinterns/step240-2020,googleinterns/step240-2020,googleinterns/step240-2020,googleinterns/step240-2020 | src/main/webapp/index.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nmyApp.controller('CustomersController', ['$scope', function($scope) {\n $scope.sortBy = 'name';\n $scope.reverse = false;\n $scope.customers = [{name:'John', city:'London', joined:'2014-12-02', orderTotal:212.5}, \n\t\t\t{name:'Paul'... | javascript | edit | 0 | 1 | mit | 68a25f744dcdce580e9a4b8f674b706dd2faf527 | cunctat0r/learn-angular-2,cunctat0r/learn-angular-2 | public/vendor/js/app/controllers/customersController.js | rejected_duplicate | Near-duplicate of sample 87686 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n(function (root, factory) {\n if (typeof define === 'function' && define.amd) define(['exports'], factory);\n else if (typeof exports === 'object') factory(exports);\n else factory(root.Inverse = {});\n})(this, function (export... | javascript | edit | 0 | 5 | mit | 482a060ee84148472d397fd6aa19b3a893d2ba9b | mcordingley/Inverse.js,GrgDmr/Inverse.js | inverse.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nuser_perf(\"privacy.userContext.enabled\", true);\nuser_perf(\"privacy.userContext.ui.enabled\", true);\nuser_pref(\"browser.ctrlTab.previews\", true);\nuser_pref(\"browser.fixup.alternate.enabled\", false);\nuser_pref(\"browser.newtab.... | javascript | edit | 0 | 0 | mit | f85f47855a20b85926b21321c5bb7f2785d4cbe4 | craighurley/dotfiles,craighurley/dotfiles,craighurley/dotfiles | applications/firefox/user.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nimport React from 'react'\nimport { NavLink } from 'react-router-dom'\nimport EditTools from './EditTools'\nimport PreviewTools from './PreviewTools'\n\nimport styles from './Toolbar.styl'\n\nexport default ({ params, project, layout, t... | javascript | edit | 0 | 3 | mit | 897c940b4fd8948ec95402bec40fdb7f3e0c7708 | Literasee/literasee,Literasee/literasee | routes/edit/screens/project/components/toolbar/index.js | rejected_duplicate | Near-duplicate of sample 68629 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nimport { configure, addDecorator } from '@storybook/react';\nimport { setDefaults } from '@storybook/addon-info';\nimport { setOptions } from '@storybook/addon-options';\nimport backgroundColor from 'react-storybook-decorator-background... | javascript | edit | 0 | 1 | mit | d64412260f871ba367eabcbdae393ec8e6d6bb37 | teamleadercrm/teamleader-ui | .storybook/config.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n/**\n * Get the network speed from zebedee/ping endpoint and output the network health\n **/\n\nfunction networkStatus(ping) {\n if (ping > 0 && ping < 100) {\n $('.icon-status div').css({\"opacity\": \"1.0\"});\n } else i... | javascript | edit | 0 | 8 | mit | a341e0d4f0be371a06c244d90974a8310235ebac | ONSdigital/florence,ONSdigital/florence,ONSdigital/florence,ONSdigital/florence | src/main/web/florence/js/functions/_getNetworkStatus.js | rejected_duplicate | Near-duplicate of sample 81792 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nvar express = require('express');\nvar passport = require('passport');\n\nvar router = express.Router();\n\n/* GET users listing. */\nrouter.get('/login', function(req, res, next) {\n res.render('login2');\n});\n\nrouter.post('/login/p... | javascript | edit | 0 | 1 | unlicense | 38b1bc9e377c8137a07b7e3482b97f8e9815964e | passport/express-4.x-local-example | routes/auth.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nvar Reflux = require('./index'),\n _ = require('./utils');\n\nmodule.exports = function(listenable,key){\n return {\n getInitialState: function(){\n if (!_.isFunction(listenable.getInitialState)) {\n ... | javascript | edit | 0 | 4 | bsd-3-clause | 516c1bf7bfa1462fa112316053221fd2c9908c34 | juliankrispel/refluxjs,simonvizzini/refluxjs,williamle8300/refluxjs,ericf89/reflux-core,watonyweng/refluxjs,misnet/refluxjs,Mayho/refluxjs,robert-chiniquy/refluxjs,reflux/reflux-core,yetone/refluxjs,StephenGrider/refluxjs,vebin/refluxjs,taskworld/refluxjs,GerHobbelt/refluxjs,uniphil/refluxjs,insionng/refluxjs,Sipree/re... | src/connect.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n'use strict';\n\nconst jwt = require('jsonwebtoken');\n\nconst auth = (req, res, next) => {\n // Get the token for request\n const token = req.body.token || req.headers['x-access-token'];\n\n if (token) {\n // TODO: reimplement se... | javascript | edit | 0 | 3 | mit | 8efd70709939646fa6e9644dc16cd28c5b867e2a | andela-oolutola/document-management-system-api | middleware/authentication.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n(function () {\n 'use strict'\n\n $('.partner-profile-contact-email a').click(function (e) {\n analytics.track('Clicked Contact Gallery Via Email', {\n partner_id: $(e.currentTarget).data('partner-id'),\n partner_slug: $(... | javascript | edit | 0 | 1 | mit | 4e2d78d3d547e286c1f4d7bf891e1ec9bd050452 | damassi/force,cavvia/force-1,mzikherman/force,artsy/force-public,izakp/force,izakp/force,cavvia/force-1,erikdstock/force,oxaudo/force,izakp/force,oxaudo/force,erikdstock/force,anandaroop/force,anandaroop/force,xtina-starr/force,artsy/force-public,joeyAghion/force,oxaudo/force,joeyAghion/force,mzikherman/force,erikdstoc... | mobile/analytics/partners.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nmodule.exports = {\n title: 'Test Styleguide',\n overviewPath: 'test/projects/scss-project/source/test_overview.md',\n appRoot: '/my-styleguide-book',\n extraHead: [\n '<link rel=\"stylesheet\" type=\"text/css\" href=\"your/custo... | javascript | edit | 0 | 0 | mit | bba91067331983868c7019bd657564c882e6683c | kraftner/sc5-styleguide,kraftner/sc5-styleguide,jkarttunen/sc5-styleguide,lewiscowper/sc5-styleguide,hannu/sc5-styleguide,junaidrsd/sc5-styleguide,soulfresh/sc5-styleguide,hence-io/sc5-styleguide,ifeelgoods/sc5-styleguide,varya/sc5-styleguide,lewiscowper/sc5-styleguide,ifeelgoods/sc5-styleguide,hannu/sc5-styleguide,jka... | test/integration/test-config.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nvar assert = require('chai').assert;\nvar sinon = require('sinon');\nvar localStorage = require('../../store/localStorage');\n\ndescribe(\"storage/localStorage()\", function() {\n var mockLocalStorageData = null, mockLocalStorage = {... | javascript | edit | 0 | 1 | mit | ea9dafe8e8ebd427c61edc53f4ff6b48249dee25 | jsor/carty,jsor/carty | test/store/localStorage-test.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nvar exec = require('child_process').exec;\nvar express = require('express');\nvar fs = require('fs');\nvar socket = require('./socket').socket;\n\nvar serve = function () {\n exec('mkdir -p test-project/gen/ && cat dasBoot/**.js > test... | javascript | edit | 0 | 1 | apache-2.0 | f2165cd5b49338a08634a29c316a74f8ca85fb01 | ninjadev/nin,ninjadev/nin,ninjadev/nin | nin/serve.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nvar webpack = require(\"webpack\");\n\nmodule.exports = {\n resolve: true,\n html: {\n template: \"./src/templates/index.html\",\n title: \"Kakimasu\",\n baseURL: \"https://kakimasu.rakujira.jp\",\n description: \"Learn to... | javascript | edit | 0 | 1 | mit | e43c447590a41902ea006540ff1069da44cb5934 | jaames/kakimasu,jaames/kakimasu,jaames/kakimasu,jaames/kakimasu | poi.config.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n'use strict';\n\nvar DataStore = require('./data-store/data-store');\nvar Messenger = require('./messenger/messenger');\nvar Deployer = require('./deploy/deployer');\nvar helpers = require('./helpers/helpers');\n\nvar deployer = new Dep... | javascript | edit | 0 | 1 | mit | d846085a9d2e795f6a105dfdfa471847607c6ec4 | ildarsamit/framework,infamous/framework,SvitlanaShepitsena/shakou,infamous/famous-framework,jeremykenedy/framework,ildarsamit/framework,SvitlanaShepitsena/remax-banner,colllin/famous-framework,infamous/framework,woltemade/framework,Famous/framework,SvitlanaShepitsena/remax-banner,tbossert/framework,tbossert/framework,S... | browser/runtime/lib/index.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n'use strict';\n\ndefine(['ChoPidoTurnos', 'services/usersService'], function(ChoPidoTurnos) {\n ChoPidoTurnos.controller('RecoverPasswordCtrl', ['$stateParams', 'usersService', '$state', function($stateParams, usersService, $state) {\n... | javascript | edit | 0 | 3 | mit | e4602a9de7cd876e7d730ed95421084c746b00b6 | jsuarezb/paw-2016-4,jsuarezb/paw-2016-4,jsuarezb/paw-2016-4,jsuarezb/paw-2016-4 | webapp/src/main/frontend/app/scripts/controllers/RecoverPasswordCtrl.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n// Description:\n// PM's you as a Service\n//\n// Dependencies:\n// None\n//\n// Configuration:\n// None\n//\n// Commands:\n// hubot pm me\n//\n// Author:\n// J3RN\n\n'use strict';\n\nmodule.exports = (robot) => {\n robot.r... | javascript | edit | 0 | 1 | mit | 05d8aa0c4edb4848a9f4ec82cabbf5e60cb228c0 | J3RN/J3RNBOT,J3RN/J3RNBOT | scripts/pm.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nconst express = require('express');\nconst morgan = require('morgan');\nconst path = require('path');\n\nconst app = express();\n\n// Setup logger\napp.use(morgan(':remote-addr - :remote-user [:date[clf]] \":method :url HTTP/:http-versi... | javascript | edit | 0 | 1 | mit | 36d157e9e0df0842a733645b2f73e4d30cab0533 | escudero89/my-npc-manager,escudero89/my-npc-manager | server/app.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nvar test = require('tape');\nvar path = require('path');\nvar curli = require(path.join(__dirname, '..'));\nvar server = require(path.join(__dirname, './server.js')).createServer();\n\nserver.listen(0, function() {\n var port = server.... | javascript | edit | 0 | 1 | mit | 7a5c3bbf68ecdd9a924db2131d2d7526924d14a1 | joshgillies/node-curli | test/test-errors.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nvar SparqlParser = require('../lib/sparql');\n\nvar fs = require('fs'),\n expect = require('chai').expect;\n\nvar queriesPath = __dirname + '/../queries/';\nvar parsedQueriesPath = __dirname + '/../test/parsedQueries/';\n\ndescribe('... | javascript | edit | 0 | 2 | mit | 41c2dcb28fa72827c5b8b30a342ffa23ba875877 | DieterDePaepe/SPARQL.js,yamalight/SPARQL.js,aindlq/SPARQL.js,namlook/SPARQL.js | test/sparql-test.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nconst { getSkinToReview } = require(\"../../s3\");\nconst Utils = require(\"../utils\");\n\nasync function reviewSkin(message) {\n const { md5 } = await getSkinToReview();\n await Utils.postSkin({\n md5,\n title: filename => `Re... | javascript | edit | 0 | 5 | mit | f2c6835ee1112fcc00a97abaac5ea0ece769c304 | captbaritone/winamp2-js,captbaritone/winamp2-js,captbaritone/winamp2-js | experiments/skin-database/discord-bot/commands/review.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n\nmodule.exports = {\n ping: (message) => {\n message.reply('pong!');\n },\n\n echo: (message, _, msg) => {\n if (msg) {\n message.channel.send(msg);\n }\n },\n};\n\n```\n\nApply this change: ... | javascript | edit | 0 | 2 | mit | 226e934533f6a3566454f04258f4df70b2ca8ba2 | Rafer45/soup | commands/testing_commands.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nvar socket = io.connect('http://fueledby.us');\nvar name_has_been_set = false;\n\nsocket.on('download', function (data) {\n console.log(\"Received broadcast: \" + data);\n $('#content').html(data);\n});\n\nsocket.on('show names', ... | javascript | edit | 0 | 2 | mit | 1df4227aaf89a6ae8ff3192bc993d0e90dd7922b | nullsix/fueledby.us-demo | client.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nvar Bot = require( 'nodemw' ),\n\treadline = require( 'readline' ),\n\tfs = require( 'fs' ),\n\tc = require( 'ansicolors' ),\n\trl = readline.createInterface( {\n\t\tinput: process.stdin,\n\t\toutput: process.stdout\n\t} ),\n\tclient = ... | javascript | edit | 0 | 3 | bsd-2-clause | 6365fcf220d95e160d1a5f671e41a3daaf7cbe2b | macbre/nodemw | examples/scribuntoRemoteDebug.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\ndefine(['tip',\n 'anchor/class'],\nfunction(Tip, clazz) {\n \n // TODO: Improve compatibility with Twitter Bootstrap styles.\n \n function Popover(el, options) {\n Popover.super_.call(this, el, options);\n options = opt... | javascript | edit | 0 | 3 | mit | dd1500cbb3255049bcb391bb27cf558f1b7389e3 | sailjs/popover | popover.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\ndefine(\n [\"ember\",\"./machine\",\"exports\"],\n function(__dependency1__, __dependency2__, __exports__) {\n \"use strict\";\n var Mixin = __dependency1__.Mixin;\n var computed = __dependency1__.computed;\n var Machine =... | javascript | edit | 0 | 2 | mit | 9f8c212c0aa1d078deb10e558c4d23882db1d25b | heycarsten/ember-fsm,heycarsten/ember-fsm | dist/amd/stateful.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n(function(){\n\n'use strict';\n\nangular\n .module('secondLead')\n \n .controller('RegisterCtrl', [\n 'store',\n 'Restangular',\n '$state', \n 'UserModel',\n function (store, Restangular, $state, UserModel) {\n var r... | javascript | edit | 0 | 2 | mit | 26a154cd5fef3eeb04d0660129e0c610134f60f8 | ac-adekunle/secondlead,ac-adekunle/secondlead,ac-adekunle/secondlead | app/assets/javascripts/angular/main/register-controller.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nvar userController = require('./users/userController.js');\n\nmodule.exports = function (apiRouter) {\n\n /*\n * All routes begin with /api/\n */\n\n apiRouter.get( '/login', userController.login);\n apiRouter.post('/signup... | javascript | edit | 0 | 1 | mit | 0e58ef3762c8879837b444293b7a4ae3a8c3fe7b | cyhtan/RoadMapToAnything,delventhalz/RoadMapToAnything,RoadMapToAnything/RoadMapToAnything,sreimer15/RoadMapToAnything,GMeyr/RoadMapToAnything,GMeyr/RoadMapToAnything,delventhalz/RoadMapToAnything,RoadMapToAnything/RoadMapToAnything,cyhtan/RoadMapToAnything,sreimer15/RoadMapToAnything | server/api/apiRouter.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nvar TEST_METADATA_STR;\nif (Meteor.isClient) {\n TEST_METADATA_STR = meteorEnv.TEST_METADATA;\n} else {\n TEST_METADATA_STR = process.env.TEST_METADATA;\n}\n\nvar TEST_METADATA = JSON.parse(TEST_METADATA_STR || \"{}\");\n\n// Note tha... | javascript | edit | 0 | 5 | mit | a5492c3727bba0394b4a9e5ef6f7e8476adeac61 | DAB0mB/meteor,lorensr/meteor,mjmasn/meteor,DAB0mB/meteor,nuvipannu/meteor,DAB0mB/meteor,chasertech/meteor,mjmasn/meteor,4commerce-technologies-AG/meteor,mjmasn/meteor,4commerce-technologies-AG/meteor,Hansoft/meteor,4commerce-technologies-AG/meteor,AnthonyAstige/meteor,AnthonyAstige/meteor,Hansoft/meteor,4commerce-techn... | packages/meteor/test_environment.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n// Copyright 2010 Michael Geary\n// http://mg.to/\n// Free Beer and Free Speech License (any OSI license)\n// http://freebeerfreespeech.org/\n\ndocument.write(\n\t'<script type=\"text/javascript\" src=\"http://ajax.googleapis.com/ajax/l... | javascript | edit | 0 | 0 | unlicense | 8a9f24bbb221180fa2a32c453bbd05e393c0d13b | geary/election-gadgets.egypt-staging,geary/election-gadgets.staging,tectronics/election-gadgets.egypt,geary/election-gadgets-egypt,geary/election-gadgets.staging,tectronics/election-gadgets.egypt-staging,tectronics/election-gadgets.egypt,tectronics/election-gadgets.egypt-staging,geary/election-gadgets-egypt,tectronics/... | voter-info/voter-info.js | rejected_duplicate | Near-duplicate of sample 87235 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n// ==UserScript==\n// @name Rightmove Enhancement Suite\n// @namespace https://github.com/chigley/\n// @description Keyboard shortcuts\n// @include http://www.rightmove.co.uk/*\n// @version 1\n// @grant GM_addStyl... | javascript | edit | 0 | 1 | mit | f29f61a3b1161421b2147085c6fb1f5de596ec47 | chigley/rightmove-enhancement-suite | Rightmove_Enhancement_Suite.user.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nPackage.describe({\n name: 'meteor-base',\n version: '2.0.0-beta230.2',\n // Brief, one-line summary of the package.\n summary: 'Packages that every Meteor app needs',\n // By default, Meteor will default to using README.md for doc... | javascript | edit | 0 | 1 | mit | 9f1d259be9c2e0c2efe0545795c35dffaa705999 | Hansoft/meteor,Hansoft/meteor,Hansoft/meteor,Hansoft/meteor,Hansoft/meteor,Hansoft/meteor,Hansoft/meteor | packages/meteor-base/package.js | rejected_duplicate | Near-duplicate of sample 76180 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n/**\n * @license\n * Copyright (C) 2018 The Android Open Source Project\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 ... | javascript | edit | 0 | 1 | apache-2.0 | 51832361e40144e0b944f2bfd907d2c61a1efe5b | WANdisco/gerrit,WANdisco/gerrit,GerritCodeReview/gerrit,WANdisco/gerrit,WANdisco/gerrit,GerritCodeReview/gerrit,GerritCodeReview/gerrit,qtproject/qtqa-gerrit,GerritCodeReview/gerrit,qtproject/qtqa-gerrit,GerritCodeReview/gerrit,GerritCodeReview/gerrit,qtproject/qtqa-gerrit,qtproject/qtqa-gerrit,WANdisco/gerrit,GerritCo... | polygerrit-ui/app/externs/plugin.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n\"use strict\";\n\n// DOUBLY-LINKED LIST\n\n// define constructor\nfunction Node(val) {\n\tthis.data = val;\n\tthis.previous = null;\n\tthis.next = null;\n}\n\nfunction DoublyLinkedList() {\n\tthis._length = 0;\n\tthis.head = null;\n\tt... | javascript | edit | 0 | 2 | mit | 9959cfcf64f6e6f8ea5a6fa638578e5cde8a3033 | derekmpham/interview-prep,derekmpham/interview-prep | doubly-linked-list.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nimport Resolver from 'ember-resolver';\n\nResolver.reopen({\n pluralizedTypes: {\n ability: 'abilities'\n }\n});\n\nexport default {\n name: 'setup-ember-can',\n initialize: function(application) {\n // make sure we create new... | javascript | edit | 0 | 2 | mit | 51df78afaf1e36ee9c77b3d89dac737467f6ff81 | minutebase/ember-can,minutebase/ember-can | app/initializers/setup-ember-can.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nconst express = require('express');\nconst router = express.Router();\nconst puppeteer = require('puppeteer');\n\n\nrouter.get('/', function (req, res, next) {\n puppeteer.launch().then(async browser => {\n const page = await browse... | javascript | edit | 0 | 3 | apache-2.0 | 68cf09bbc633ae0c14ed6eec3626d81c3a606f8c | frocher/bnb_probe | routes/screenshot.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n// Cron.js - in api/services\n\n\"use strict\";\nconst CronJob = require('cron').CronJob;\nconst _ = require('lodash');\n\nconst crons = [];\n\nmodule.exports = {\n start: () => {\n sails.config.scientilla.crons.forEach(cron =... | javascript | edit | 0 | 2 | mit | 5cc217b853eb0c65e74127b33ba38c52eb93b688 | scientilla/scientilla,scientilla/scientilla,scientilla/scientilla | api/services/Cron.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nvar insertWrapper = function(wrapper) {\n var cursor = $('.cursor');\n if (cursor.length > 0) {\n var container = cursor.parent().data('eqObject');\n if (cursor.parent().hasClass('squareEmptyContainer')) {\n ... | javascript | edit | 0 | 5 | mit | 94dd3dee0526fd913b09a4ca783e7a645ecb13c5 | camdenre/equation-editor,camdenre/equation-editor | refactored/src/app/js/addWrapperUtil.js | accepted | null | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.