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\nconst childProcess = require('child_process')\nconst command = 'wmic logicaldisk get caption'\n\nmodule.exports = function () {\n return new Promise((resolve, reject) => {\n childProcess.exec(command, (err, stdout) => {\n if (e... | javascript | edit | 0 | 2 | isc | 4cc5faafc36b0e85c10f50dff5c9e5d7364b18e5 | bhj/karaoke-forever,bhj/karaoke-forever | server/lib/getDriveLetters.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n/* jshint node: true */\n\n\nmodule.exports = function(environment) {\n var ENV = {\n modulePrefix: 'dummy',\n environment: environment,\n baseURL: '/',\n locationType: 'auto',\n contentSecurityPolicy: {\n 'img-src'... | javascript | edit | 0 | 4 | mit | c848cdb32bfdbd1730e2b78baa5316992cd64c0d | open-tux/ember-bulma,open-tux/ember-bulma | tests/dummy/config/environment.js | rejected_duplicate | Near-duplicate of sample 80006 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nvar Rx = require('rx'),\n _ = require('lodash');\n\nfunction receiveMessage(sqs, params, callback) {\n sqs.receiveMessage(params, function (err, data) {\n callback(err, data);\n receiveMessage(sqs, params, callback);... | javascript | edit | 0 | 4 | mit | 8593d0f6a3202a569adb5031d3b20cf28e98fcb8 | lebek/RxSQS | index.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n/**\r\n * Created by dell on 2015/7/20.\r\n * This is gulp init\r\n */\r\n(function(){\r\n\r\n \"use strict\";\r\n\r\n var gulp = require('gulp');\r\n var loadPlugins = require('gulp-load-plugins');\r\n var plugins = loadPlu... | javascript | edit | 0 | 1 | mit | 07eed5b6047b8b8fc2fcbb518ca320d6cd64b897 | FrancisWeb/web-manager,liuwei9413/web-manager,FrancisWeb/web-manager,liuwei9413/web-manager,WindWen/angular-blog-static,WindWen/angular-blog-static | gulpfile.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n// import external dependencies\nimport 'jquery';\n\n// Import everything from autoload\nimport \"./autoload/**/*\"\n\n// import local dependencies\nimport Router from './util/Router';\nimport common from './routes/common';\nimport home... | javascript | edit | 0 | 1 | mit | 5338cc7a82f766242892b74d4c716f986bcdbaee | gkmurray/sage,gkmurray/sage,gkmurray/sage,gkmurray/sage | resources/assets/scripts/main.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nfunction Board(submitBtn, options) {\n this.submitBtn = submitBtn;\n this.options = options;\n}\n\nBoard.prototype.prepareBoard = function() {\n this.hideButton(this.submitBtn);\n var board = this;\n this.options.forEach(... | javascript | edit | 0 | 1 | mit | b3c44a194cb437e1e4667ad05067892bbf030efc | RadicalZephyr/tic_tac_toe,RadicalZephyr/tic_tac_toe | public/js/Board.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nexport function CORDOVA_ASSET_TEMPLATE(assetType, platform, {src, d, w, h} = {}) {\n return `<${assetType} src=\"${src}\" platform=\"${platform}\"${d?` density=\"${d}\"`:``}${w?` width=\"${w}\"`:``}${h?` height=\"${h}`:``}\" />`;\n}\... | javascript | edit | 0 | 3 | mit | ead727bf13bdea8cb71eb9f4c89328a3fab7f75d | kerrishotts/cordova-tasks | src/transforms/cordova-assets.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nvar PythonShell = require('python-shell');\n\nvar options = {\n\tscriptPath: 'realclearpolitics-scraper',\n\targs: [\n\t\t'http://www.realclearpolitics.com/epolls/2016/president/nv/nevada_democratic_presidential_caucus-5337.html',\n\t\t... | javascript | edit | 0 | 2 | mit | a0c1d78c271a01f6e531d93b8dcd505994b335e1 | fpagnoux/berniemetrics,fpagnoux/berniemetrics,Rumel/berniemetrics,dpxxdp/berniemetrics,Rumel/berniemetrics,Rumel/berniemetrics,dpxxdp/berniemetrics,Rumel/berniemetrics,dpxxdp/berniemetrics,fpagnoux/berniemetrics,dpxxdp/berniemetrics,fpagnoux/berniemetrics | private/scraper.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n'use strict';\n\nexport class PromiseQueue {\n\tconstructor() {\n\t\tthis.promises = [];\n\t\tthis.endCallback;\n\t\tthis.exceptionCallback;\n\t\tthis.running;\n\t}\n\trun() {\n\t\tif(!this.running) {\n\t\t\tif(this.promises.isEmpty()) ... | javascript | edit | 0 | 5 | unlicense | 0765eeec064535ee601c33e5413063486b5cfad9 | matco/js-tools | promisequeue.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n/**\n * The \"Initial\"/\"Main\" prompts\n */\n\"use strict\";\nmodule.exports = [\n {\n type: \"list\",\n name: \"main\",\n message: \"Welcome to git-labelmaker!\\nWhat would you like to do?\",\n choices: [ \"... | javascript | edit | 0 | 0 | mit | 646532f753338a2b5f4f869b3453db5d520f5e76 | himynameisdave/git-labelmaker | prompts/mainMenu.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n#!/usr/bin/env node\n\n'use strict';\n\nvar stdin = process.openStdin();\n\nvar async = require('async');\nvar reachableUrl = require('reachable-url')\n\nif (require.main === module) {\n main();\n} else {\n module.exports = resolv... | javascript | edit | 0 | 2 | mit | f062a7e0868ec8918767e32978a83c81c45a0c04 | bebraw/blog-utils | resolve/urls.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nconst ChildProcess = require('child_process')\nconst path = require('path')\n\nconst version = require('../package').version + '.0'\n\nconst command = path.join(__dirname, '..', 'node_modules', '.bin', 'electron-windows-store.cmd')\ncon... | javascript | edit | 0 | 1 | mit | b0e5c4b6affd5939014ed138f970a05624376e29 | PanCheng111/XDF_Personal_Analysis,blep/electron-api-demos,blep/electron-api-demos,PanCheng111/XDF_Personal_Analysis,electron/electron-api-demos,electron/electron-api-demos,blep/electron-api-demos,blep/electron-api-demos,PanCheng111/XDF_Personal_Analysis,electron/electron-api-demos | script/windows-store.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nvar\n\tfs = require('fs')\n\t, path = require('path')\n\t, util = require('util')\n\t, events = require('events')\n\t, argv = require(path.resolve(__dirname, 'app', 'argv'))\n\t, client = require(path.resolve(__dirname, 'app', 'client')... | javascript | edit | 0 | 1 | mit | 07b55fa1e6c40d982d615ce4c501ee6e0c81bf49 | denwilliams/client,ninjablocks/client,denwilliams/client,ninjablocks/client | client.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n/* jshint browser: true */\n'use strict';\n\n// returns true if the image is loaded and decoded,\n// or a number, if it didn't find one single image,\n// or a helpful error if it wasn't an image,\n// or the path, if it found some non-lo... | javascript | edit | 0 | 7 | bsd-3-clause | d5c15e9995004dc26c2d0713c3bde95b62fddc94 | testiumjs/testium-driver-sync | lib/assert/imgLoaded_client.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nvar OngoingGames = require(\"../models/OngoingGames\");\n\nvar playerQueue = [];\n\nexports.startGame = function(req, res) {\n\n var player1 = req.body.username;\n\n var game = OngoingGames.findGame(player1);\n\n // player has ongoin... | javascript | edit | 0 | 4 | mit | d613efbae1abfb14ce95539594039d184932dde7 | andereld/progark,andereld/progark | server/controllers/Matchmaker.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n/// <reference types=\"cypress\" />\n\ncontext('Actions', () => {\n beforeEach(() => {\n cy.visit('http://localhost:8000')\n });\n\n it('All + elements are clickable', () => {\n cy.get('.step-up').click( { multiple: true } );\n... | javascript | edit | 0 | 1 | mit | be062ae3aa729eb253a17973bf92f00a35b7d961 | CodeForPhilly/chime,CodeForPhilly/chime,CodeForPhilly/chime | e2e/cypress/integration/tests/actions.spec.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nconst jsdom = require('jsdom');\n\nconst f = (context, cb) => {\n const wikipediaUrl = context.data['article-url'];\n jsdom.env({\n url: `${ wikipediaUrl }?printable=yes`,\n scripts: ['http://code.jquery.com/jquery.js'],\n do... | javascript | edit | 0 | 1 | mit | c4ea61c303a3e9b554f1bc7e6cda7ee927b05c2b | cosmowiki/cosmowiki,cosmowiki/cosmowiki,cosmowiki/cosmowiki,cosmowiki/cosmowiki | webtasks/wikipedia-article-extract.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nExpression.prototype.polar = function() {\n\tvar ri = this.realimag();\n\tvar two = new Expression.Integer(2);\n\treturn Expression.List.ComplexPolar([\n\t\tri[0]['^'](two)['+'](ri[1]['^'](two)),\n\t\tGlobal.atan2.default(Expression.Vec... | javascript | edit | 0 | 1 | mit | a9f6329ba17dcb1d8d90137ba3d452a11d14a1f3 | aantthony/javascript-cas,kwangkim/javascript-cas,kwangkim/javascript-cas | src/14.Expression.polar.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nvar fs = require(\"fs\");\nvar queryString = require(\"querystring\");\n\nfunction start(response, postData) {\n console.log(\"Request handler 'start' was called.\");\n\n fs.readFile(\"./public/index.html\", \"utf8\", functio... | javascript | edit | 0 | 1 | apache-2.0 | 09d283ff9d4f003619d16434c657d7a9983279e6 | imurchie/node-basic-server | requestHandlers.js | accepted | null | true |
[
{
"role": "user",
"content": "Write javascript code for the following: Fix gender definition not exists in zh-Hant-TW."
},
{
"role": "assistant",
"content": "export {default as name} from './name';\nexport {default as gender} from './gender';\nexport {default as firstName} from './firstName';\ne... | javascript | new_file | 0 | 0 | mit | cf6cc3461dbe98486e08ddc41d4c0eb6aab713b0 | hychen/ke-e,hychen/ke-e | src/types/person/definitions/zh-Hant-TW/index.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nimport React from 'react';\nimport Button from 'react-bootstrap/lib/Button';\nimport Panel from 'react-bootstrap/lib/Panel';\n\nimport Icon from './icon.react';\n\nexport default class Example extends React.Component {\n constructor(pr... | javascript | edit | 0 | 1 | mit | ea000bd9840b4e2ba7126669901047d6fc158da0 | tangrams/tangram-play,tangrams/tangram-play | src/js/components/map-panel.react.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nimport { Firebase, firebaseAuth, firebaseRef } from './firebase'\n\nexport const login = () => {\n const provider = new firebaseAuth.GithubAuthProvider()\n provider.addScope('repo')\n // TODO on mobile, sign in without redirect\n fi... | javascript | edit | 0 | 2 | mit | cf2f654e240f0f7c1ad2e3651e1d07b1bca87a18 | olinlibrary/signage,olinlibrary/signage,olinlibrary/signage | src/api/auth.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nconst path = require(\"path\");\n\nmodule.exports = function(config) {\n config.set({\n frameworks: [\"jasmine\"],\n proxies: {\n '/lib/css/': '/base/lib/css'\n },\n files: [\n { patt... | javascript | edit | 0 | 1 | mit | ab7e266766c6033da2af477058e50a307481de7b | FlippieCoetser/Events,FlippieCoetser/Events | karma.conf.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nimport React, { Component } from 'react';\nimport Chart from 'chart.js';\n\nclass ChartComponent extends Component {\n\n componentDidMount() {\n this.renderChart(this.props.measurement.measurements);\n }\n\n componentWillUpdate(ne... | javascript | edit | 0 | 2 | isc | a3d990fe0ecf43e2a9629e9889db3447265b0f7a | RamonGebben/react-perf-tool | src/components/ChartComponent.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nfunction tryMe() {\n if (document.getElementsByClassName(\"_48e9\").length < 1) {\n window.requestAnimationFrame(tryMe);\n } else {\n startBlock();\n }\n}\ntryMe();\n\nfunction startBlock() {\n chrome.storage.sync.get(\"blind_... | javascript | edit | 0 | 5 | mit | 77c009d145ddb11a2149a676e3cf8d6d50300eed | carolkng/blind-messenger,carolkng/blind-messenger | scripts/blinder.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nconst MySql = require(\"./MySql.js\");\nconst entities = require(\"entities\");\nconst moment = require(\"moment\");\n\nclass Meet{\n constructor(obj){\n Object.keys(obj).forEach(k=>this[k]=entities.decodeHTML(obj[k]));\n }\n\n as... | javascript | edit | 0 | 1 | mit | 62b0bc23502bb6d5b2e1ab1273a86432d4fe62cf | severnbronies/Sail | DataAccess/Meets.js | rejected_duplicate | Near-duplicate of sample 84532 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n/**\n * Add targets -> node -> current as per this comment https://github.com/babel/babel/issues/5085#issuecomment-363242788\n */\nmodule.exports = {\n env: {\n test: {\n presets: [\n [\n ... | javascript | edit | 0 | 0 | apache-2.0 | d1b6d0ed15ffc053efa9499e0f12352fb7a7e656 | tharikaGitHub/carbon-apimgt,nuwand/carbon-apimgt,nuwand/carbon-apimgt,jaadds/carbon-apimgt,praminda/carbon-apimgt,sanjeewa-malalgoda/carbon-apimgt,bhathiya/carbon-apimgt,tharindu1st/carbon-apimgt,praminda/carbon-apimgt,ruks/carbon-apimgt,harsha89/carbon-apimgt,wso2/carbon-apimgt,Rajith90/carbon-apimgt,prasa7/carbon-api... | features/apimgt/org.wso2.carbon.apimgt.publisher.feature/src/main/resources/publisher/babel.config.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nimport {subscribe, getTodo} from '../todo'\nimport renderGraph from './render'\n\nlet graphArea\nconst unsubscribe = {\n store: null,\n todo: null,\n}\n\nexport default toggleGraph\n\nfunction toggleGraph() {\n if (graphArea) {\n ... | javascript | edit | 0 | 2 | mit | 2e71c94cca41e9a6c1b2dc228196a9b9c552f361 | kbeloborodko/webpack-deep-dive,kbeloborodko/webpack-deep-dive | src/graph/index.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n/*!\n * JS-Tricks main script\n */\n\n(function (w, d) {\n // Touch detection ( ͡ᵔ ͜ʖ ͡ᵔ)\n // @see http://localhost:8080/detect-touch-devices-using-javascript\n if('ontouchstart' in window) {\n var htmlEl = d.getElementsByTagName... | javascript | edit | 0 | 4 | mit | 8f61a75a30f1e5560dd49e38b7a61b71b1b56c40 | rasshofer/frontend-development,rasshofer/frontend-development,rasshofer/js-tricks.com,rasshofer/js-tricks.com,fapprik/js-tricks.com,fapprik/js-tricks.com | source/javascripts/main.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nimport React from 'react'\nimport { Route, IndexRoute } from 'react-router'\n\nimport App from './app'\n\nimport VehicleLoader from './utilities/vehicle-loader'\nimport VehicleListContainer from './vehicle-list/container'\nimport Vehicl... | javascript | edit | 0 | 0 | mit | 08f922461fa6548a75863b71d17871619d8754cf | SonofNun15/react-on-rails-ui,SonofNun15/react-on-rails-ui | source/app/routes.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n'use strict';\n\nrequire('dotenv').config({ path: __dirname + '/.env', silent: true });\n\n// load deps\nconst lab = exports.lab = require('lab').script();\nconst chai = require('chai');\n\n// chai plugins\nchai.use(require('chai-things... | javascript | edit | 0 | 1 | isc | bd98f5e62182c4a59669b90c66b5ab3f6424fcf0 | thebergamo/ecommerce.js,thebergamo/ecommerce.js,thebergamo/ecommerce.js | test/index.spec.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n// Generated by CoffeeScript 1.10.0\n(function() {\n $(\"blockquote\").each((function(_this) {\n return function(i, element) {\n var contents;\n contents = $(element).contents();\n console.log(contents);\n conten... | javascript | edit | 0 | 2 | mit | 6c29b4495a8e848674f1a4dcb984f13e870bf996 | kubkon/email-chattifier,kubkon/email-chattifier | chattify.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nconst renders = require('../test/renders');\nconst pretty = require('pretty');\nimport assert from 'power-assert';\n\nconst AllComponents = require('../lib/components').default;\nconst templates = require('../lib/templates').default;\n\... | javascript | edit | 0 | 1 | mit | 87176554753cd3cbcadd46b873ba7207642be827 | formio/formio.js,formio/formio.js,formio/formio.js | src/render.spec.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n#!/usr/bin/env node\n\n\"use strict\";\n\nvar path = require(\"path\");\nvar fs = require(\"fs\");\n\nvar commander = require(\"commander\");\n\nvar libPath = path.join(path.dirname(fs.realpathSync(__filename)), \"../lib/main.js\");\nva... | javascript | edit | 0 | 1 | apache-2.0 | 8eb3cb6f6418ad66dd55efa86e86b145cb55b72c | leeatkinson/CloudFormationPreProcessor | bin/main.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n// Mixin ############################################################################\n\n/**\n * Mix a key-value into Storm, protecting Storm from\n * having a pre-existing key overwritten. Of course,\n * items can be directly assigned ... | javascript | edit | 0 | 3 | mit | 2324aebe1e718a10c44827b68703eb1c0e6af045 | JosephClay/StormJS | src/Mixin.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nif (! window._babelPolyfill) {\n require(\"babel-polyfill\");\n}\n\nimport reducers from './reducers';\nimport sagas from './sagas';\nimport {\n getResource,\n listResource,\n allResource,\n updateResource,\n createResource,\n de... | javascript | edit | 0 | 0 | mit | 3980d5959ad1dbb5c43b5f36d4be3e4d9768a082 | gadventures/gapi-redux | src/index.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nimport get from 'lodash.get';\nimport isFunction from 'lodash.isfunction';\n\nexport function combineReducers(stateReducerMap, rootPath) {\n return function(state, action) {\n let changed = false;\n\n const nextState = {};\n O... | javascript | edit | 0 | 4 | mit | 22cb17fe3a8c4ff2280972c87148ddd2abbc1356 | Mtnt/reduxModuleCreator | src/Utils/index.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n'use strict';\n\nmodule.exports = {\n deref: deref\n};\n\nfunction deref (pointer, doc) {\n const segments = compact(pointer.split('/'));\n\n if(segments.length === 0) {\n return doc;\n }\n\n let context = doc;\n segments.forEa... | javascript | edit | 0 | 2 | mit | a84addc9327b639d88c09357955cfce28c010a04 | toboid/js-pointer | src/index.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n#!/usr/bin/env node\n\nimport fs from 'fs'\nimport path from 'path'\nimport postcss from 'postcss'\nimport defaultConfig from './defaultConfig'\nimport program from 'commander'\nimport tailwind from './tailwind'\n\nlet splitFileName = f... | javascript | edit | 0 | 2 | mit | 8e776fe16ba03c2f843e1b72444623e8e64238ee | tailwindlabs/tailwindcss,tailwindcss/tailwindcss,tailwindlabs/tailwindcss,tailwindlabs/tailwindcss | src/index.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n// Return Promise\nconst mergeImages = (sources = [], options = { format: 'image/png' }) => new Promise(resolve => {\n\t// Setup browser/node specific variables\n\tconst canvas = options.Canvas ? new options.Canvas() : window.document.c... | javascript | edit | 0 | 3 | mit | 2abb4d507a855aaf08e8a91c037484348125e642 | lukechilds/merge-images | src/index.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nangular.module('com.likalo.ui')\n .factory('uiDialog', ['ngDialog',\n function (ngDialog) {\n return {\n alert: function (title, message) {\n var infoClass;\n title = title || 'Alert';\n messag... | javascript | edit | 0 | 3 | bsd-2-clause | 5bafd62d875b1a884168a5ad2009c167db3b6b27 | Likalo/UI | src/modal.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nimport React from 'react';\nimport ReactDOM from 'react-dom';\n\nimport Root from './components/Root';\n\n\nwindow.document.addEventListener('DOMContentLoaded', function() {\n var $container = window.document.querySelector('#js-app-con... | javascript | edit | 0 | 1 | mit | 1cf3989bf46aa6905a8738220cc47dd72f7502e1 | kjirou/build-system-sandbox,kjirou/build-system-sandbox,kjirou/js-boilerplate,kjirou/js-boilerplate,kjirou/build-system-sandbox,kjirou/js-boilerplate | src/index.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nfunction findAncestor(element, className) {\n while ((element = element.parentElement) && element && !hasClass(element, className));\n return element;\n}\n\nfunction hasClass(element, cls) {\n return (' ' + element.className + ... | javascript | edit | 0 | 5 | mit | 3f3c7c3ad21424fc2f1803ede3602810edce2836 | JustinPealing/html-query-plan,JustinPealing/html-query-plan | src/utils.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nconst prefix = '_async_computed$'\n\nexport default {\n install (Vue, options) {\n options = options || {}\n\n Vue.config\n .optionMergeStrategies\n .asyncComputed = Vue.config.optionMergeStrategies.computed\n\n Vue.... | javascript | edit | 0 | 3 | mit | 3e4de13a95886d52d3a60786e033ec3013889183 | foxbenjaminfox/vue-async-computed | src/index.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nimport Vue from './lib/vue';\nimport VueWrapper from './VueWrapper';\nimport './lib/matchesPolyfill';\n\nfunction createElem() {\n const elem = document.createElement('div');\n\n document.body.appendChild(elem);\n\n return elem;\n}\n... | javascript | edit | 0 | 3 | mit | 8a47dded9f7b28747d4e8e16c171bf6f67a4d495 | eddyerburgh/avoriaz,eddyerburgh/avoriaz,eddyerburgh/avoriaz | src/mount.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nvar _ = require('lodash');\n\nvar regexCache = {\n\tpost: {}\n};\n\nhexo.extend.helper.register('is_post', function() {\n\tvar permalink = this.config.permalink;\n\tvar r = regexCache.post[permalink];\n\tif (!r) {\n\t\tvar rUrl = permal... | javascript | edit | 0 | 2 | mit | e136492b8139c16f573bbdbf265d0f95a507fd3e | ahaasler/hexo-theme-colos,ahaasler/hexo-theme-colos | scripts/helpers.js | rejected_duplicate | Near-duplicate of sample 84497 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nimport Backbone from 'backbone';\nimport { appendStyles } from 'utils/mixins';\n\nconst $ = Backbone.$;\n\nexport default Backbone.View.extend({\n initialize() {\n const { model } = this;\n model.view = this;\n this.conf = mod... | javascript | edit | 0 | 4 | bsd-3-clause | d56b933d9cb972fc826cc8dbf33f676e56a636da | artf/grapesjs,artf/grapesjs,artf/grapesjs | src/editor/view/EditorView.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nvar replaceAll = function( oldToken ) {\n var configs = this;\n return {\n from: function( string ) {\n return {\n to: function( newToken ) {\n var template;\n var index = -1;\n if ( configs.i... | javascript | edit | 0 | 4 | mit | 686e4658294eea4db0855f7b3b6bab146d52b9ba | FagnerMartinsBrack/str-replace | src/str-replace.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n/**\n * Icon Story: Basic Usage\n */\n\nimport React from 'react';\nimport { select, color } from '@storybook/addon-knobs';\nimport Icon from '../Icon';\nimport icons from '../icons';\nimport css from './style.css';\n\nexport default ()... | javascript | edit | 0 | 2 | apache-2.0 | 8c61b782b518ab89998d05c3b12523c9d39ffef4 | folio-org/stripes-components,folio-org/stripes-components | lib/Icon/stories/BasicUsage.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nconst Promise = require('bluebird');\nconst db = require('./lib/db');\n\nPromise.resolve()\n .then( () => db.startup() )\n .then( () => db.sqlite().migrate() )\n .catch( err => console.log(err) );\n\n```\n\nApply this change: Fix pat... | javascript | edit | 0 | 1 | mit | 80e8f1f0b58db45332eed2507cece15f23b03c5b | andyjack/neo-tracker,andyjack/neo-tracker,andyjack/neo-tracker | scripts/migrate.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nexport default class Controller {\n constructor(router, baseUrl = '') {\n this.router = router\n this.baseUrl = '/' + baseUrl.trimBoth('/')\n }\n\n get(relativeUrl, handler, name = null) {\n this.route('GET... | javascript | edit | 0 | 1 | mit | ee47eed1378c5096181fea04e18a2fe71d3dbd95 | ritterim/definely | src/controllers/Controller.js | rejected_duplicate | Near-duplicate of sample 83038 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n// Object with a diversity of properties to\n// be asserted\nvar types = {\n string: String('hey'),\n number: Number(10),\n fn: function coolName () {},\n error: new Error(),\n date: new Date(),\n boolean: true,\n obj: {},\n arr... | javascript | edit | 0 | 1 | mit | 95169b5029a9bcf8db44924df6d5729b19266f24 | ricardofbarros/examine | test/util/types.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nconst Lang = imports.lang;\n\nconst Local = imports.misc.extensionUtils.getCurrentExtension();\nconst BaseProvider = Local.imports.BaseProvider;\n\n\nconst Api = new Lang.Class({\n Name: 'Bitso.Api',\n Extends: BaseProvider.Api,\n\n ... | javascript | edit | 0 | 1 | mit | a8664a3e9b579ab10081d325cc8ba4700e7825b9 | OttoAllmendinger/gnome-shell-bitcoin-markets,OttoAllmendinger/gnome-shell-bitcoin-markets,OttoAllmendinger/gnome-shell-bitcoin-markets | src/ProviderBitso.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n/*\n * @license\n * Copyright 2016 Google Inc. All Rights Reserved.\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... | javascript | edit | 0 | 0 | apache-2.0 | 6e01d85a34548331169cc148e945220b3c964754 | TanayParikh/foam2,jacksonic/vjlofvhjfgm,foam-framework/foam2,TanayParikh/foam2,TanayParikh/foam2,foam-framework/foam2,foam-framework/foam2,jacksonic/vjlofvhjfgm,foam-framework/foam2,jacksonic/vjlofvhjfgm,TanayParikh/foam2,foam-framework/foam2 | src/core/Int.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n$(document).ready(function() {\n $(\"#input\").focus();\n $(\"#input\").on(\"keydown\", function(event) {\n if (event.keyCode === 13) {\n event.preventDefault();\n controllers.submitQuery();\n }\n });\n});\n\nvar cont... | javascript | edit | 0 | 2 | mit | 28487caec45aa776042e7499c6311f385b82e337 | kenrhe/passtheturing,kenrhe/passtheturing,kenrhe/passtheturing | static/js/index.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n/* eslint no-console:off */\nconst fs = require('fs');\nconst { Decoder } = require('./lib/ebml.js');\n\nconst decoder = new Decoder();\n\ndecoder.on('data', chunk => console.log(chunk));\n\nfs.readFile('media/test.webm', (err, data) =>... | javascript | edit | 0 | 2 | mit | 73e999ba89d1937e9925c2cbc929907342f752bf | themasch/node-ebml | example.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n\nvar websocket = require('websocket-stream');\nvar URL = require('url');\n\nfunction buildBuilder(client, opts) {\n var host = opts.hostname || 'localhost'\n , port = opts.port || 80\n , url = opts.protocol + '://' + host + ':' ... | javascript | edit | 0 | 6 | mit | ed010327d4ba8370612418ba780ae7ffef66c66e | jaambee/MQTT.js,bqevin/MQTT.js,mcanthony/MQTT.js,wesley1001/MQTT.js,RangerMauve/MQTT.js,itavy/MQTT.js,AdySan/MQTT.js,jdiamond/MQTT.js | lib/connect/ws.js | rejected_duplicate | Near-duplicate of sample 73405 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nimport Orchestrator from 'orchestrator'\nimport TaskBuilder from './task-builder'\n\nexport const orchestrator = new Orchestrator()\n\n/**\n * Creates a task of the given name and dependencies.\n *\n * @param {string} taskName The task ... | javascript | edit | 0 | 1 | mit | e72d6222e629b76b60d71777c631051e9eb64ef2 | kt3k/docklift | src/application/task-modifier.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n/**\n * Userscript format:\n * http://wiki.greasespot.net/Metadata_Block\n */\n\nmodule.exports = function extractMetablock (userscriptText) {\n try {\n var metablockReg = /\\B\\/\\/ ==UserScript==\\n([\\S\\s]*?)\\n\\/\\/ ==\\/UserS... | javascript | edit | 0 | 5 | mit | d71259c09aab61fb839c0a3b86e2f9dff8893f64 | amio/userscript-parser | index.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nimport { loginUser } from '../../gateways/users';\nimport { replace } from 'react-router-redux';\nimport { authSuccess, authFailure } from '../../common/auth/actions';\nimport { storeUser } from '../../utils/localStorage';\nimport { set... | javascript | edit | 0 | 3 | mit | 60819ca08a1eaba01b6279412c9bc6e87a4a90ef | nathanhood/mmdb,nathanhood/mmdb | app/containers/LoginPage/thunks.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n'use strict';\n\nvar sessions = require('../sessions');\n\nvar kafkaConsumer = function (kafkaConfig) {\n var kafka = require('../services/kafka')(kafkaConfig.uri);\n var players = require('../players');\n return {\n add... | javascript | edit | 0 | 9 | apache-2.0 | 68367c5e8667b909d77ddbad1280cdc3940de489 | manuel-freire/rage-analytics-backend,e-ucm/rage-analytics-backend,manuel-freire/rage-analytics-backend,RotaruDan/lrs,e-ucm/rage-analytics-backend,RotaruDan/lrs,RotaruDan/lrs,manuel-freire/rage-analytics-backend,e-ucm/rage-analytics-backend | lib/consumers/kafka.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nimport React from 'react';\nimport ReactDOM from 'react-dom';\n// import App from './components/app.jsx';\n\nclass App extends React.Component {\n render () {\n return (\n <h1>{\"JIM\"}</h1>\n );\n }\n}\n\nReactDOM.render(\... | javascript | edit | 0 | 1 | mit | 41c4dd41012c0b9f21ed5cc2ee8c24df778ae986 | jkrayer/summoner,jkrayer/summoner | src/index.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n'use strict';\nvar fs = require('fs');\nvar tempfile = require('tempfile2');\n\nmodule.exports = function createWriteStream(params) {\n var path = tempfile(params);\n var ws = fs.createWriteStream(path);\n var close = function(... | javascript | edit | 0 | 3 | mit | 3555380b1e5d234b36b8797caeaa012c924e83b5 | Kikobeats/create-temp-file2 | index.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n/* @flow */\nimport type { Template } from 'create-npm/lib/template'\n\nexport default function({\n encryptedNpmToken,\n encryptedGitHubToken\n}: {\n encryptedNpmToken: string,\n encryptedGitHubToken: string\n}): Template {\n retur... | javascript | edit | null | null | mit | 3af3f931cb6a424926cdda0408aa07fa52b97e72 | vinsonchuong/create-npm | src/templates/travisyml.js | rejected_syntax | Syntax error detected by tree-sitter | false |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nmodule.exports = function buildPreset(context, options) {\n return {\n presets: [\n [require('babel-preset-latest'), { es2015: options }],\n ],\n plugins: [\n require('babel-plugin-transform-class-properties'),\n ... | javascript | edit | 0 | 1 | mit | 5acec22e068cb4e1c7c4e652e9af0e65a660521c | extplug/babel-preset-extplug | index.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n'use strict';\n\nvar React = require('react'),\n withSideEffect = require('react-side-effect');\n\nfunction reducePropsToState(propsList) {\n var innermostProps = propsList[propsList.length - 1];\n if (innermostProps) {\n return... | javascript | edit | 0 | 3 | mit | 7ae330a05b01a0c79571ab3aeed0833c1e77b6b0 | gaearon/react-document-title | index.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n\nfunction renderStatus(statusText) {\n\tdocument.getElementById('status').textContent = statusText;\n}\n\ndocument.addEventListener('DOMContentLoaded', function() {\n\n\t\n\t\n});\n```\n\nApply this change: Add link to additional anima... | javascript | edit | 0 | 1 | apache-2.0 | b57f844d79652f50ffac18cfe7a93ffa6119c31f | hebra/achromajs,hebra/achromajs,hebra/achromajs | addon/chrome/popup.js | accepted | null | true |
[
{
"role": "user",
"content": "Write javascript code for the following: Document send() extension to Stanza."
},
{
"role": "assistant",
"content": "/**\n * Send stanza.\n *\n * Response stanzas prepared by Junction are extended with this function.\n *\n * @api public\n */\nexports.send = function... | javascript | new_file | 0 | 1 | mit | f1341c2c3450872e9886c046833385f61876d9f6 | jaredhanson/junction | lib/junction/stanza.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nimport { User } from './ActionTypes';\nimport { post } from '../http';\nimport { replaceWith } from 'redux-react-router';\n\nfunction putInLocalStorage(key) {\n return (payload) => {\n window.localStorage.setItem(key, JSON.stringify... | javascript | edit | 0 | 3 | mit | bda14bf444d30376dd464f07c27771322eed5188 | webkom/lego-webapp,webkom/lego-webapp,webkom/lego-webapp | src/actions/UserActions.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nimport axios from '~/lib/utils/axios_utils';\n\nconst testTimeoutInMs = 300;\njest.setTimeout(testTimeoutInMs);\n\nlet testStartTime;\n\n// https://github.com/facebook/jest/issues/6947\nbeforeEach(() => {\n testStartTime = Date.now();\... | javascript | edit | 0 | 2 | mit | 8d74aab4289fb7a050e0163bf1affa9e62bb079e | stoplightio/gitlabhq,stoplightio/gitlabhq,mmkassem/gitlabhq,iiet/iiet-git,iiet/iiet-git,mmkassem/gitlabhq,iiet/iiet-git,mmkassem/gitlabhq,iiet/iiet-git,stoplightio/gitlabhq,mmkassem/gitlabhq,stoplightio/gitlabhq | spec/frontend/test_setup.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n'use strict';\n\nvar each = require('lodash.foreach');\nvar get = require('jaunt').get;\n\nvar identity = function(o) {\n return o;\n};\n\nvar taxonomist = function(arr, prop, fn) {\n\n fn = fn || identity;\n\n var result = {};\n ea... | javascript | edit | 0 | 2 | mit | 558ec4f62a8283760a742dd7179830312d76d9cd | yuanqing/taxonomist | index.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n'use strict';\n\nlet geolocation = require('nativescript-geolocation');\nlet requester = require('../web/requester').defaultInstance;\nlet cacheService = require('../common/cache/cache-service');\nlet constants = require('../common/cons... | javascript | edit | 0 | 3 | mit | 8ac8f372e7fc453c5cc3393daadda55514d1fd7c | BG-Tourist-Guide/BG-Tourist-Guide-Nativescript | app/helpers/geolocation-helper.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n/*\n Normilize Footnotes contents.\n Removes everything except textual paragraphs from Footnotes.\n*/\nexport default class NormalizeFn {\n\n import(dom) {\n let fns = dom.findAll('fn')\n fns.forEach(fn => {\n let paragrap... | javascript | edit | 0 | 2 | mit | 7e70177b4fcae6b68135971ea317a584e5b9eaea | substance/texture,substance/texture | src/converter/j2r/NormalizeFn.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nimport React, { Component } from 'react';\nimport { connect } from 'react-redux';\nimport map from 'lodash/map';\n\nclass Profile extends Component {\n render() {\n const { profile, assets } = this.props;\n if ( ! assets.data.Hai... | javascript | edit | 0 | 2 | mit | 27e67427236e46b0e03fb7e7b59a3e314d759cfb | g8extended/Character-Generator,g8extended/Character-Generator | src/components/slider/profile.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\ndefine(function(require){\r\n var TimeLine = require(\"timeline\");\r\n\r\n var renderer = new THREE.WebGLRenderer( {antialias: true, alpha:true} );\r\n renderer.shadowMapEnabled = true;\r\n\r\n var scene;\r\n var timeSou... | javascript | edit | 0 | 2 | mit | 708c6367ba1ad9579f4a9aeb152beefb47c3cfcb | Suva/insurance,Suva/insurance,Suva/insurance,Suva/insurance | src/renderer.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\ndefine([\n 'json3',\n],\n\nfunction (JSON) {\n 'use strict';\n\n return {};\n});\n\n```\n\nApply this change: Add hook for a view for when all its child views have been rendered"
},
{
"role": "assistant",
"content": "defi... | javascript | edit | 0 | 1 | mit | fdcba7990c534c90f311b6adf3dd513552f18637 | darvelo/wishlist,darvelo/wishlist | app/scripts/app/core/config.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nvar express = require('express');\nvar app = express();\n\napp.set('port', (process.env.PORT || 5000));\n\napp.use(express.static(__dirname + '/screens'));\napp.use(express.static(__dirname + '/public'));\n\n// views is directory for al... | javascript | edit | 0 | 1 | mit | 6ab1f5bcd31e369c366b94f795841f282fe0472b | guddii/floidtv,guddii/floidtv | index.js | accepted | null | true |
[
{
"role": "user",
"content": "Write javascript code for the following: Fix an issue where Browser.platform is now readonly, thus can't add cordova\n\nSigned-off-by: Yannick Gagnon <<EMAIL>>"
},
{
"role": "assistant",
"content": "\"use strict\"\n// Browser.platform.cordova = (window.Phonegap || w... | javascript | new_file | 0 | 0 | mit | d110431e5b096887230f53c79c05df8bb8ad901e | jpdery/moobile-core,moobilejs/moobile-core,moobilejs/moobile-core,jpdery/moobile-core | src/utils/browser/index.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n// CoffeeScript compilation. This must be enabled by modification\n// of Gruntfile.js.\n//\n// The `bare` option is used since this file will be transpiled\n// anyway. In CoffeeScript files, you need to escape out for\n// some ES6 featu... | javascript | edit | 0 | 0 | mit | 87dfb5a40d335850e37b9e2aaa64e35ca0110217 | tobobo/thyme-frontend,tobobo/vice-frontend,ClockworkNet/ember-boilerplate,michaelorionmcmanus/eak-bootstrap,ClockworkNet/ember-boilerplate,kiwiupover/seattle-auckland-weather,teddyzeenny/assistant,aboveproperty/ember-app-kit-karma,daevid/broccoli-todo,duvillierA/try_ember,tomclose/test_loading_problem,sajt/ember-weathe... | tasks/options/coffee.js | rejected_duplicate | Near-duplicate of sample 93032 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nmodule.exports = {\n \"extends\": [\n \"eslint-config-airbnb\",\n \"eslint-config-standard\"\n ],\n \"parser\": \"babel-eslint\",\n \"plugins\": [\n \"flow-vars\"\n ],\n \"rules\": {\n \"strict\": 0,\n \"brace-style... | javascript | edit | 0 | 0 | mit | ab89883f3063216315cd6262f4d9e7051a31e342 | tribou/eslint-config-tribou | index.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nimport React, { Component, PropTypes } from 'react'\nimport Relay from 'react-relay';\n\nexport default class CategoryFilter extends Component {\n\n static propTypes = {\n category: PropTypes.object.isRequired\n }\n\n render() {\n... | javascript | edit | 0 | 2 | bsd-3-clause | 3b3f9e981ecb9dbc4b7535074f91c6ca3ec59b83 | HyperManTT/ECommerceSaleor,car3oon/saleor,jreigel/saleor,UITools/saleor,UITools/saleor,maferelo/saleor,UITools/saleor,mociepka/saleor,UITools/saleor,itbabu/saleor,itbabu/saleor,mociepka/saleor,UITools/saleor,car3oon/saleor,HyperManTT/ECommerceSaleor,KenMutemi/saleor,KenMutemi/saleor,maferelo/saleor,mociepka/saleor,tfro... | saleor/static/js/components/CategoryFilter.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nvar Generator = require('generate-js'),\n Joi = require('joi'),\n async = require('async');\n\nvar EndPoint = Generator.generate(function EndPoint(options) {\n var _ = this;\n\n _.defineProperties(options);\n});\n\nEndPoint.... | javascript | edit | 0 | 2 | mit | 04fea3144f3e7bd2837c62eacd1f5eb2189a49c4 | Mike96Angelo/EndPoint | index.js | rejected_duplicate | Near-duplicate of sample 98244 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nmodule.exports = {\n name: 'ember-cli-toggle',\n\n included: function(app) {\n app.import('vendor/ember-cli-toggle/base.css');\n\n // Use configuration to decide which theme css files\n // to import, thus not populating the u... | javascript | edit | 0 | 6 | mit | ba5b7ec9dbe03ab00004a0fdaf1cc49b36bea0ff | lifegadget/ember-cli-toggle,paulkogel/ember-cli-toggle,knownasilya/ember-toggle,lifegadget/ember-cli-toggle,paulkogel/ember-cli-toggle,knownasilya/ember-cli-toggle,knownasilya/ember-toggle,knownasilya/ember-cli-toggle | index.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nvar config = require('./config');\nvar redisClient = require('redis').createClient(config.redis_port, config.redis_host);\n\nvar loadedScriptStrings = {};\n\nexports.client = redisClient;\n\nexports.ensureScript = function(client, scrip... | javascript | edit | 0 | 2 | mit | 492b91127252516349a314c81f36af99fed0596f | gamechanger/lox,gamechanger/lox | lib/redis-client.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n'use strict';\n\nmodule.exports = function() {\n return new RegExp('^([0-9A-Fa-f]{2}[:-]){5}([0-9A-Fa-f]{2})$');\n}\n\n```\n\nApply this change: Add options for exact or globa regex"
},
{
"role": "assistant",
"content": "'u... | javascript | edit | 0 | 3 | mit | 24ad6a495169ceeda219fcddfaee1ef1956e59ba | regexps/mac-regex | index.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n/*jshint node:true */\n\n\"use strict\";\n\nvar es = require('event-stream'),\n gutil = require('gulp-util'),\n\tpath = require('path'),\n\texec = require('child_process').exec;\n\nmodule.exports = function(command, opt){\n\tif (!comma... | javascript | edit | 0 | 4 | mit | b9c9c2d022b87aa5643bbcdd8790e08c7d2dac80 | robrich/gulp-exec | index.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n'use strict';\nvar PinyinHelper = require('./lib/PinyinHelper');\nvar ChineseHelper = require('./lib/ChineseHelper');\nvar PinyinFormat = require('./lib/PinyinHelper');\n\nvar pinyin4js = {\n WITH_TONE_MARK :\"WITH_TONE_MARK\", ... | javascript | edit | 0 | 1 | mit | 7c5102c4fa80aace030d2b687cdd9c0630c9df79 | superbiger/pinyin4js,superbiger/pinyin4js | index.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nvar toc = require('markdown-toc');\n\nmodule.exports = {\n book: {},\n hooks: {\n \"page:before\": function (page) {\n page.content = toc.insert(page.content, {\n slugify: function (str) {\n ... | javascript | edit | 0 | 3 | mit | 8cce4513608e8eff130cb11d7fd3178bbecf815d | willin/gitbook-plugin-atoc | index.js | accepted | null | true |
[
{
"role": "user",
"content": "Write javascript code for the following: Add initial tests for inView.is"
},
{
"role": "assistant",
"content": "import test from 'ava';\nimport inView from '../src/in-view';\nimport { inViewport } from '../src/viewport';\n\ntest('inView.is is a proxy for inViewport'... | javascript | new_file | 0 | 1 | mit | 7cde01cca7d5c5a451c0344dc03c724f18b1e20d | camwiegert/in-view,kudago/in-view | test/in-view.is.spec.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n/**\n * @description Gulp plugin that lets you work with folders and treat them as package names\n * @see README.md\n */\nvar fs = require('fs'),\n\tpath = require('path');\n\tes = require('event-stream');\n\nfunction getFolders(dir){\n... | javascript | edit | 0 | 2 | mit | 34bbbb8a9140d34808672173abd9a7b31c1581b2 | hakubo/gulp-folders | index.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nconst\n Hapi = require('hapi')\n , Path = require('path')\n , helper = require('./helper.js')\n , config = require('./config.js');\n\n/* Configure the Hapi server */\nvar server = new Hapi.Server();\nserver... | javascript | edit | 0 | 2 | mit | d434f5e995fe99c48de85656c9273896d4305733 | karysto/fetchr-bot | index.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nvar connect = require('connect');\n\nvar app = connect();\napp.use(connect.static(__dirname));\napp.listen(7000);\n```\n\nApply this change: Fix port in connect middleware."
},
{
"role": "assistant",
"content": "var connect ... | javascript | edit | 0 | 0 | mit | 98b6ba54a7c2db657a25b45da28ace737bdb8520 | mhs/t2-people,mhs/t2-people,mhs/t2-people | index.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nvar\n\tSpotlight = require('./src/spotlight');\n\nSpotlight.version = '2.6.0-pre.20.1';\n\nmodule.exports = Spotlight;\n\n```\n\nApply this change: Update version string to 2.6.0-rc.1"
},
{
"role": "assistant",
"content": "v... | javascript | edit | 0 | 0 | apache-2.0 | 1f7c8fa66ecdb849df166a8301d67336fd056131 | enyojs/spotlight | index.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n/**\n * util-log.js - The tiny log function\n */\n\n// The safe wrapper for `console.xxx` functions\n// log(\"message\") ==> console.log(\"message\")\n// log(\"message\", \"warn\") ==> console.warn(\"message\")\nvar log = seajs.log = fu... | javascript | edit | 0 | 5 | mit | 3778ba86766d419e9fdb0aca04870f767e070a87 | treejames/seajs,longze/seajs,Lyfme/seajs,angelLYK/seajs,treejames/seajs,kaijiemo/seajs,tonny-zhang/seajs,longze/seajs,treejames/seajs,LzhElite/seajs,lee-my/seajs,mosoft521/seajs,lovelykobe/seajs,miusuncle/seajs,chinakids/seajs,wenber/seajs,baiduoduo/seajs,zaoli/seajs,Lyfme/seajs,miusuncle/seajs,yern/seajs,JeffLi1993/se... | src/util-log.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nconst\n fs = require('fs'),\n inquirer = require('inquirer');\n\nconst\n configFilePath = process.env.HOME + '/.gitauthors.json',\n authors = loadConfig(),\n choices = createChoices(authors);\n\nif (authors) {\n inquir... | javascript | edit | 0 | 4 | mit | 004fb03264e69a38a095c17d5277945fc50d3c92 | dannycjones/git-chauthor | index.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n'use strict';\n\nvar Module = angular.module('datePicker');\n\nModule.directive('dateRange', function () {\n return {\n templateUrl: 'templates/daterange.html',\n scope: {\n start: '=',\n end: '='\n },\n link: fun... | javascript | edit | 0 | 5 | mit | ef3827827ccf93d342f17852952512ee8edd0bec | alexproca/angular-datepicker,alexproca/angular-datepicker | app/scripts/dateRange.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nvar Botkit = require('botkit')\nvar request = require('request')\nvar mapsToken = process.env.GOOGLE_MAPS_TOKEN\n\n// Expect a SLACK_TOKEN environment variable\nvar slackToken = process.env.SLACK_TOKEN\nif (!slackToken) {\n console.err... | javascript | edit | 0 | 2 | mit | e181a8a020dd7382df6cd0f100b5b57039639532 | interstateone/faster-downhill-bot | index.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n// @flow\nimport type {CurrentGameActions} from './actions/current-game'\nimport type {EntryActions} from './actions/ui/entry'\nimport type {GameState} from './reducer/current-game'\nimport type {EntryState} from './reducer/ui/entry'\ni... | javascript | edit | null | null | mit | 51eaa4b0cd7d481af7ed4b3e9eeb42595392031a | Holi0317/bridge-calc,Holi0317/bridge-calc,Holi0317/bridge-calc | src/types.js | rejected_syntax | Syntax error detected by tree-sitter | false |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nconst tap = require('tap')\nconst nsaname = require('../lib/nsaname.js')\n\nvar name = nsaname.getNSAName()\n\ntap.true(nsaname.wordLists.first.some(function (n) { return name.indexOf(n) > -1 }))\ntap.true(nsaname.wordLists.second.some(... | javascript | edit | 0 | 1 | apache-2.0 | 899790c104fa10be20e8f99fb0441780010dc642 | rbanffy/nsaname | test/name-generation.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n/*\r\n * L.CircleMarker is a circle overlay with a permanent pixel radius.\r\n */\r\n\r\nL.CircleMarker = L.Circle.extend({\r\n\toptions: {\r\n\t\tradius: 10,\r\n\t\tweight: 2\r\n\t},\r\n\r\n\tinitialize: function (latlng, options) {\r\... | javascript | edit | 0 | 1 | bsd-2-clause | 6b51780e795cf070086b87aee11d914567831f32 | dhootha/Leaflet,kumy/Leaflet,hyperknot/Leaflet,AndBicScadMedia/Leaflet,jblarsen/Leaflet,sellonen/Leaflet,davidlukerice/Leaflet,dhootha/Leaflet,nvoron23/Leaflet,rlugojr/Leaflet,nkovacs/Leaflet,alex2wong/Leaflet,hyperknot/Leaflet,azimux/Leaflet,twoubt/Leaflet,elfalem/Leaflet,cartant/Leaflet,tsantacruz/RotationalMarker,br... | src/layer/vector/CircleMarker.js | accepted | null | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.