messages listlengths 2 2 | language stringclasses 8
values | prompt_type stringclasses 2
values | lint_errors int64 0 129 ⌀ | cyclomatic_complexity int64 0 32 ⌀ | license stringclasses 7
values | commit stringlengths 40 40 | repos stringlengths 5 116k | new_file stringlengths 4 220 | status stringclasses 6
values | error stringlengths 26 74 ⌀ | is_valid_syntax bool 2
classes |
|---|---|---|---|---|---|---|---|---|---|---|---|
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nimport Ember from 'ember';\nimport QRCode from 'qrcode';\n\nexport default Ember.Component.extend({\n\n text: null,\n\n light: '#ffffff',\n\n colorDark: '#000000',\n\n width: 128,\n\n height: 128,\n\n // L/M/Q/H\n correctLevel: '... | javascript | edit | 0 | 1 | mit | fc2cfba9a7ad9597e815f03ea7d6210d177065f8 | gdong42/ember-qrcode-shim,gdong42/ember-qrcode-shim | addon/components/qr-code.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nvar fs = require('fs');\n\nvar gitane = require('gitane');\nvar winston = require('winston');\n\nfunction cloneInto(repoUrl, destPath, keyPath, callback) {\n var gitClone = function(keyData) {\n // clone with . to avoid the extra co... | javascript | edit | 0 | 2 | mit | 078815245bb128d04ca5d1c65eeb6331dbfc6c06 | mplewis/statichook | gitHandler.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nvar moment = require('moment');\nvar geolib = require('geolib');\n\n// Use moment.js to calculate how much time has elapsed since some prior time\nexports.getTimeElapsedSince = function(time) {\n return moment(time).fromNow();\n};\n\n/... | javascript | edit | 0 | 1 | mit | 81eb3b255adcf157d4fa418f54e811b9e138ccf1 | team-oath/uncovery,team-oath/uncovery,team-oath/uncovery,scottdixon/uncovery,scottdixon/uncovery,scottdixon/uncovery,team-oath/uncovery,scottdixon/uncovery | server/core/utilities.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nimport Enzyme from 'enzyme';\nimport Adapter from 'enzyme-adapter-react-16';\n\nEnzyme.configure({ adapter: new Adapter() });\n\n```\n\nApply this change: Update jest setup to mock window and document with jsdom"
},
{
"role": "a... | javascript | edit | 0 | 0 | mit | d5ec00f59d9969be4a901a4c3bbbbbbdc7cc760c | mxenabled/mx-react-components | jest-setup.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n/**\n * Try to make loopable any kind of javascript primitive\n * @param {array|number|string|object|Map|Set} collection - hopefully something that we can loop\n * @returns {Array} it will return always an array\n */\nexport default f... | javascript | edit | 0 | 5 | mit | 68154434fc0e4221fea45172fca0a51f3cfd8bca | dreipol/looppa | index.next.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nmodule.exports = config => {\n const customLaunchers = {\n 'SL Chrome 26': {\n base: 'SauceLabs',\n browserName: 'chrome',\n version: '26'\n },\n 'SL Edge 13': {\n base: 'SauceLabs',\n browserName: 'mi... | javascript | edit | 0 | 2 | mit | a1665324bf6c8378f30c1c84505899ab114d4a1a | borodean/jsonp | karma.conf.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nvar webpack = require('webpack');\n\nmodule.exports = function (config) {\n config.set({\n\n browserNoActivityTimeout: 30000,\n\n browsers: [ process.env.CONTINUOUS_INTEGRATION ? 'Firefox' : 'Chrome' ],\n\n singleRun: process.... | javascript | edit | 0 | 2 | mit | 413ea8629d8fd6dba4f019a9e09ac9bfbbf91ba3 | djkirby/react-router,shunitoh/react-router,nickaugust/react-router,apoco/react-router,chunwei/react-router,SpainTrain/react-router,aaron-goshine/react-router,9618211/react-router,ustccjw/react-router,iest/react-router,malte-wessel/react-router,tikotzky/react-router,tmbtech/react-router,moudy/react-router,mattkrick/reac... | karma.conf.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n// Karma configuration file, see link for more information\n// https://karma-runner.github.io/1.0/config/configuration-file.html\n\nmodule.exports = function (config) {\n config.set({\n basePath: '',\n frameworks: ['jasmine', '@a... | javascript | edit | 0 | 1 | mit | ecaddc98d393ea7002b5b7999be957841b6c45c9 | tomwanzek/d3-ng2-demo,tomwanzek/d3-ng2-demo,tomwanzek/d3-ng2-demo | karma.conf.js | rejected_duplicate | Near-duplicate of sample 82145 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nvar Logger = function (config) {\n this.config = config;\n this.backend = this.config.backend || 'stdout'\n this.level = this.config.level || \"LOG_INFO\"\n if (this.backend == 'stdout') {\n this.util = require('util');\n } e... | javascript | edit | 0 | 6 | mit | 14a83e12a4681f1a217dd68e405c22a81396cd4c | bmhatfield/statsd,DataDog/statsd,zzzbit/statsd,zzzbit/statsd,sax/statsd,tsheasha/statsd,cit-lab/statsd,ScottKaiGu/statsd,ngpestelos/statsd,VivienBarousse/statsd,jmptrader/statsd,joshughes/statsd,Charlesdong/statsd,aronatkins/statsd,tuxinaut/statsd,AdamMagaluk/statsd-cloudwatch,Yelp/statsd,abhi1021/statsd,wyzssw/statsd,... | lib/logger.js | rejected_duplicate | Near-duplicate of sample 92709 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nvar runSequence = require('run-sequence');\n\nvar typescript = require('./typescript');\nvar requirejs = require('./requirejs');\n\nexports.config = function(gulp, packageName, locations) {\n\trequirejs.config(gulp, packageName, locatio... | javascript | edit | 0 | 1 | mit | 1c826af73cb0bd1b875e74704e780d53a66c1f67 | RenovoSolutions/Gulp-Typescript-Utilities,SonofNun15/Gulp-Typescript-Utilities | compile.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nvar FS = require('fs');\nvar Path = require('path');\n\nvar Winston = require('winston');\n\nglobal.Config = require('nconf');\nglobal.Log = new Winston.Logger();\nLog.add(Winston.transports.Console, {\n colorize: true,\n timestamp: t... | javascript | edit | 0 | 0 | mit | 81f14d4974f9c6a0e98c752c0ef36b34867fad0f | jmanero/faas,jmanero/faas,jmanero/faas | lib/config.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nmodule.exports = function(sugar, schemas, assert, api) {\n return function(cb) {\n api.create(null, function(err, d) {\n var name = d.name + d.name;\n\n d.name = name;\n\n sugar.update(schemas.... | javascript | edit | 0 | 1 | mit | 2abfaedde1d49fe6e0ed832690d770541d63c6f3 | sugarjs/sugar-spec | lib/update.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nimport { moduleForComponent, test } from 'ember-qunit';<% if (testType === 'integration') { %>\nimport hbs from 'htmlbars-inline-precompile';<% } %>\n\nmoduleForComponent('<%= componentPathName %>', '<%= friendlyTestDescription %>', {\n... | javascript | edit | null | null | mit | af1a6f5289a4ec08fa40e3c8357789fe904f4b37 | amk221/ember.js,twokul/ember.js,mixonic/ember.js,mixonic/ember.js,jasonmit/ember.js,GavinJoyce/ember.js,mfeckie/ember.js,thoov/ember.js,sivakumar-kailasam/ember.js,GavinJoyce/ember.js,sly7-7/ember.js,mike-north/ember.js,elwayman02/ember.js,givanse/ember.js,jasonmit/ember.js,sivakumar-kailasam/ember.js,patricksrobertson... | blueprints/component-test/qunit-files/tests/__testType__/__path__/__test__.js | rejected_syntax | Syntax error detected by tree-sitter | false |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n/*\n * min-webdriver\n *\n * Copyright (c) 2014-2015 Maximilian Antoni <<EMAIL>>\n *\n * @license MIT\n */\n'use strict';\n\nvar path = require('path');\nvar through = require('through2');\nvar resolve = require('resolve');\nvar driv... | javascript | edit | 0 | 3 | mit | e23947b3f913c476bccc53fb1e2a7fd31d29a3e8 | mantoni/min-webdriver | lib/plugin.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nif (typeof Handlebars !== 'undefined') {\n Handlebars.registerHelper(\"timeago\", function(date) {\n var dateObj;\n if (date) {\n dateObj = new Date(date);\n return $.timeago(dateObj).replace(/\\ /g, \"\\u00a0\");\n ... | javascript | edit | 0 | 3 | mit | cde481d16e7a93cddd0e3395655ac15130063f33 | Differential/timeago | helper.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nimport React from 'react';\nimport './TicTacToe.scss';\nimport { connect } from 'react-redux';\nimport ticTacToeActions from 'actions/tictactoe';\n\nimport GameBoard from './components/GameBoard';\n\nconst mapStateToProps = (... | javascript | edit | 0 | 5 | mit | f0ef978d9a4aa58ad231ce80f5a99ee802365cfd | terakilobyte/terakilobyte.github.io,terakilobyte/terakilobyte.github.io | src/projects/TicTacToe/TicTacToe.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nimport decorateComponentWithProps from 'decorate-component-with-props';\nimport addImage from './modifiers/addImage';\nimport ImageComponent from './Image';\nimport imageStyles from './imageStyles.css';\n\nconst defaultTheme = {\n imag... | javascript | edit | 0 | 5 | mit | d9cbd8c86340b172f5c9e6484cb11fe852a03ff1 | draft-js-plugins/draft-js-plugins,nikgraf/draft-js-plugin-editor,nikgraf/draft-js-plugin-editor,nikgraf/draft-js-plugin-editor,draft-js-plugins/draft-js-plugins,draft-js-plugins/draft-js-plugins,draft-js-plugins/draft-js-plugins | draft-js-image-plugin/src/index.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n'use strict'\n\n// let plusES5 = function(a, b){\n \n// console.log(\"A:\", a, \", B:\", b);\n// let result = a + b;\n// return result;\n\n// };\n\n// console.log(plusES5(9,10));\n\n// ES6 style (arrow function)\n// let p... | javascript | edit | 0 | 0 | apache-2.0 | 0bbee72037416f833ee15561b7b3dafcc58e9752 | teerasej/training-javascript-es6-beginner-thai | function/arrow_function/app-finish.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n/* eslint-env node */\nmodule.exports = {\n test_page: 'tests/index.html?hidepassed',\n disable_watching: true,\n launch_in_ci: [\n 'Chrome'\n ],\n launch_in_dev: [\n 'Chrome'\n ],\n browser_args: {\n Chrome: {\n mo... | javascript | edit | 0 | 0 | mit | d3366f24a76e8634defe2f493f5543ded48aee1d | thaume/ember-cli-uuid,thaume/ember-cli-uuid | testem.js | rejected_duplicate | Near-duplicate of sample 91563 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nvar fs = require('fs');\nvar path = require('path');\nvar minimatch = require('./fnmatch');\nvar iniparser = require('./ini');\n\nfunction getConfigFileNames(filepath) {\n var old_dirname = filepath;\n var dirname = old_dirname;\n va... | javascript | edit | 0 | 8 | mit | 60ffaabe5e01df1db18f214c47986e328103fd14 | jedmao/editorconfig-core-js,seka/editorconfig-core-js,editorconfig/editorconfig-core-js,editorconfig/editorconfig-core-js,slang800/editorconfig-core-js | lib/editorconfig.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nimport {\n Event,\n Reactor,\n TabTools,\n TabTracker,\n core,\n Module\n} from './universal.js';\n\nchrome.browserAction.onClicked.addListener(() => {\n TabTools.new(chrome.extension.getURL('../index.html'));\n});\n\nchrome.stor... | javascript | edit | 0 | 13 | mit | b276cfdb78ea0c5d7b35c825f13e2b928c56cd23 | nextgensparx/quantum-router,nextgensparx/quantum-router | src/chrome/background.js | rejected_complexity | Cyclomatic complexity too high: 13 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n// @flow\n\nimport {version} from '../package.json'\nimport {Platform} from 'react-native'\n\nconst platformString = Platform.OS == 'ios' ? 'iOS' : 'Android'\nconst platformVersion = Platform.getVersion()\n\nconst AAO_USER_AGENT = `AllA... | javascript | edit | 0 | 0 | mit | 81c997290317808a09474ca633e3cac40b0a2244 | carls-app/carls,StoDevX/AAO-React-Native,StoDevX/AAO-React-Native,carls-app/carls,StoDevX/AAO-React-Native,StoDevX/AAO-React-Native,StoDevX/AAO-React-Native,carls-app/carls,StoDevX/AAO-React-Native,carls-app/carls,StoDevX/AAO-React-Native,StoDevX/AAO-React-Native,carls-app/carls,carls-app/carls,carls-app/carls,StoDevX/... | source/user-agent.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nmodule.exports = function (creep) {\n if(creep.memory.currentTarget) {\n creep.memory.currentTarget = Game.getObjectById(creep.memory.currentTarget.id);\n }\n\n // Aquire target\n if(!creep.memory.currentTarget || !cr... | javascript | edit | 0 | 10 | mit | 7f536077bcbe4f4b0f43f9e8a3c3c16fc6b90df4 | pmaidens/screeps,pmaidens/screeps | src/creep/Harvester/behaviour/Dump.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nimport nodemailer from 'nodemailer';\nimport config from '../../config.js';\n\nfunction getSmtpTransport(service, user, pass) {\n return nodemailer.createTransport('SMTP', {\n service,\n auth: {\n user,\n pass\n }\n ... | javascript | edit | 0 | 4 | mit | 4602bd513c90bcdccff91820757a447a6dd72e43 | prathamtandon/portfolio,prthrokz/portfolio,prathamtandon/portfolio,prthrokz/portfolio | src/handlers/sendMail.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\ndefine([\n\t\"underscore\",\n\t\"providers/ProviderEntry\"\n], function(\n\t_,\n\tProviderEntry\n) {\n return ProviderEntry.extend({\n\n \tisProvider: function() {\n \t\treturn true;\n \t},\n\n\t\tadapter: function() {\n\t\t\treturn... | javascript | edit | 0 | 1 | mit | d2024be0daaa0a5be1b6af2f88fd598088090185 | dskaram/quickactions,dskaram/quickactions | quickaction/js/providers/Provider.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nfunction Application (cb) {\n this._logger = function () {};\n this._app = function () {};\n\n cb.call(this);\n}\n\nApplication.prototype.init = function () {\n this._app = this._app();\n};\n\nApplication.prototype.setLogger = fu... | javascript | edit | 0 | 2 | mit | eca0cd688cb0b60452223e5060069adfec99159c | maciejsmolinski/IC.js | lib/application.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n/**\n * Quotes a string for SQL statements\n * \n * @param {string|number} string \n * @returns {string} the quoted string, or the passed parameter if it is a finite number\n */\nfunction QuoteString(string) {\n if (typeof string ===... | javascript | edit | 0 | 4 | mit | 8affb2a2c0287b35da97a5829f9a4bad8eaeec2b | mlaanderson/database-js | lib/quoteString.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-line-height/package.json')\nvar moduleCss = fs.... | javascript | edit | 0 | 0 | mit | 7704513f84f955136afbfb67eb4e67a10b161fc2 | topherauyeung/portfolio,topherauyeung/portfolio,cwonrails/tachyons,matyikriszta/moonlit-landing-page,pietgeursen/pietgeursen.github.io,fenderdigital/css-utilities,fenderdigital/css-utilities,getfrank/tachyons,topherauyeung/portfolio,tachyons-css/tachyons | lib/line-height.js | rejected_duplicate | Near-duplicate of sample 85513 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nmodule.exports = {\n name: 'ProductionServer',\n webpack: {\n entry: './src/Server.es6.js',\n output: {\n generator: 'simple',\n dest: './bin',\n },\n resolve: {\n generator: 'npm-and-modules',\n extens... | javascript | edit | 0 | 0 | mit | 030ec84d5ac1a14cbd462675c58cf61b280c5351 | reddit/node-build | lib/configs/DefaultServerConfig.js | rejected_duplicate | Near-duplicate of sample 90386 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n// Mock pkgcloud functionality.\n\nvar\n util = require(\"util\"),\n stream = require(\"stream\"),\n Writable = stream.Writable,\n Readable = stream.Readable;\n\nutil.inherits(Sink, Writable);\n\nfunction Sink(options) {\n Writable... | javascript | edit | 0 | 1 | mit | ea607c05f6aef6225af3fcb8411631dc547863f2 | deconst/content-service,deconst/content-service | test/mock/client.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n/*\n * Author: Pierre-Henry Soria <<EMAIL>>\n * Copyright: (c) 2015-2017, Pierre-Henry Soria. All Rights Reserved.\n * License: GNU General Public License; See PH7.LICENSE.txt and PH7.COPYRIGHT.txt in the root directory... | javascript | edit | 0 | 0 | mit | 52775d2c059bc2718d0e91c7d209e117c5963bd1 | pH7Software/pH7-Social-Dating-CMS,pH7Software/pH7-Social-Dating-CMS,pH7Software/pH7-Social-Dating-CMS,pH7Software/pH7-Social-Dating-CMS | static/js/cookie_consent/eu-states.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nconst mongoose = require('mongoose');\nconst log = require('./logger.helper');\nconst appHelper = require('./application.helper');\n\nconst options = {\n useNewUrlParser: true,\n useFindAndModify: false,\n useCreateIndex: true,\n};\n... | javascript | edit | 0 | 3 | mit | 74646246b60790070cb96195ae22594f0d3588bb | bewizyu/familink-api | src/helpers/db.helper.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n/**\n * Sends a JSON-LD request to the API.\n *\n * @param {string} url\n * @param {object} options\n * @return {Promise.<object>} An object with a response key (the original HTTP response) and an optional body key (the parsed JSON-LD b... | javascript | edit | 0 | 7 | mit | bdbf282232fb12929760058e985d25cf99027943 | dunglas/api-doc-parser | src/hydra/fetchJsonLd.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nvar _ = require('underscore'),\n SHORT = _.template('Languages: jw.org: <%= jworg.total %>, <%= jworg.hasWebContent %> L1+, <%= jworg.isSign %> SLs, <%= jworg.isRTL %> RTL, <%= jworg.isSignWithWeb %> L1+ SLs; jwb: <%= jwb.web.total %... | javascript | edit | 0 | 0 | apache-2.0 | 9ac5c3170ab6c0d6e7cff6d469891f1f083bef68 | jthomerson/jworg-language-info,jthomerson/jworg-language-info | src/lib/formatter.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nvar fs = require(\"fs\");\n\nvar jsonld = require(\"jsonld\");\n\nvar nquads = fs.readFileSync(process.argv[2], \"utf8\");\n\njsonld.fromRDF(nquads, {format: \"application/nquads\"}, function(err, records) {\n var record = records[1]... | javascript | edit | 0 | 7 | mit | eb452ca63f63ba150fb64a39caf002dc1d381e0f | jeresig/pharos-images | converters/cidoc.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n/**\n * SCSS grunt task for CartoDB.js\n *\n */\n\nmodule.exports = {\n task: function(grunt, config) {\n return {\n dist: {\n options: {\n sourceMap: false,\n outputStyle: 'compressed'\n },\n ... | javascript | edit | 0 | 1 | bsd-3-clause | daa187247ce990424f7df3462fd6385f8818feba | splashblot/cartodb.js,splashblot/cartodb.js,splashblot/cartodb.js,splashblot/cartodb.js | grunt/tasks/scss.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nfunction OfficeMixBlock(runtime, element) {\n var iframe = $('iframe', element);\n var player = new playerjs.Player(iframe.get(0));\n\n var mixUrl = iframe.attr('src');\n var eventUrl = runtime.handlerUrl(element, 'publish_e... | javascript | edit | 0 | 1 | mit | fc09b3a98783adacf952671c30bed24b1179e652 | IONISx/xblock-officemix,OfficeDev/xblock-officemix,OfficeDev/xblock-officemix,OfficeDev/xblock-officemix,IONISx/xblock-officemix,IONISx/xblock-officemix | officemix/static/js/officemix_view.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nprocess.env.CHROME_BIN = require(\"puppeteer\").executablePath();\n\nmodule.exports = function(config) {\n\tconfig.set({\n\n\t\tplugins: [\n\t\t\trequire(\"../../\"),\n\t\t\trequire(\"karma-chrome-launcher\"),\n\t\t\trequire(\"karma-cov... | javascript | edit | 0 | 1 | apache-2.0 | 3bf388a957807d92136652798651e4d379dc59c0 | SAP/karma-openui5 | test/integration/karma-base.conf.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nfunction updateIdea() {\n $('#idea').attr('id', 'idea-old').animate({ left: '200%', right: '-200%', opacity:'0' }, function() {\n this.remove();\n });\n $('#idea-old').clone().attr('id', 'idea').appendTo('#ideas').css({left: '-200... | javascript | edit | 0 | 1 | mit | f29bd44ce0b1eca29a8377fa8e267f1d61488596 | jacksondc/idea-generator,jacksondc/idea-generator | js/main.js | rejected_duplicate | Near-duplicate of sample 80841 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n/**\n * Markdown for Gpub. Note that Glift comes pre-packaged with markdown.\n *\n * Most output formats will want to defined a custom renderer.\n */\ngpub.markdown = {\n /** For reference, here are the relevant methods */\n rendererM... | javascript | edit | 0 | 1 | mit | 71e4d362e1be1095ba8d40ebb6b4fdf09e8f89e1 | Kashomon/gpub,Kashomon/gpub,Kashomon/gpub | src/markdown/markdown.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\ndocument.querySelector('.hamburger-button')\n .addEventListener('click', function () {\n this.classList.toggle('active');\n });\n\n```\n\nApply this change: Add show hide nav functionality for hamburger icon"
},
{
"role": "... | javascript | edit | 0 | 1 | mit | f95bdc30d7cfa5ca1ac2f2f6df16ddd014a5f8db | jsatk/layers2016,jsatk/layers-website,jsatk/layers2016,jsatk/layers-website | js/main.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n/*\n * Configuration values needed in js codes\n *\n * NOTE:\n * Please use the following command to avoid accidentally committing personal changes\n * git update-index --assume-unchanged src/javascript/config.js\n *\n */\n\nfunction ge... | javascript | edit | 0 | 3 | apache-2.0 | e15431379eb8bf32cf4babb081e988da91a0f43b | fayland/binary-static,fayland/binary-static,4p00rv/binary-static,binary-static-deployed/binary-static,binary-static-deployed/binary-static,teo-binary/binary-static,negar-binary/binary-static,teo-binary/binary-static,ashkanx/binary-static,ashkanx/binary-static,binary-com/binary-static,kellybinary/binary-static,kellybina... | src/javascript/config.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nimport reactify from '../../src/index';\n\nlet x = 0;\nfunction createComponent() {\n return reactify(document.registerElement(`x-webcomponent-proto-funcs-${x++}`, {\n prototype: Object.create(HTMLElement.prototype, {\n prop: {... | javascript | edit | 0 | 1 | mit | ec437e553df2511986eae216edf79f00a6a44394 | webcomponents/react-integration,skatejs/react-integration | test/unit/webcomponent-proto-funcs.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n// Remove all children nested within a node\n//\n// TL;DR; Replace child fastest\n//\n// BENCHMARK: https://i.stack.imgur.com/5rvfc.png\n// https://jsperf.com/innerhtml-vs-removechild/53\n// https://developer.mozilla.org/en-US/docs/Web/... | javascript | edit | 0 | 0 | mit | 6cc0b24ff1675a0a13b98d0d7313426af37fc67c | devpunks/snuggsi,snuggs/snuggsi,snuggs/snuggsi,snuggs/snuggsi,snuggs/snuggsi,devpunks/snuggsi,devpunks/snuggsi,devpunks/snuggsi,devpunks/snuggsi | benchmark.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nvar path = require('path');\nvar Q = require('q');\nvar _ = require('lodash');\nvar fs = require('fs');\n\nvar utils = require('./utils');\nvar generate = require(\"../lib/generate\");\nvar parse = require(\"../lib/parse\");\nvar genera... | javascript | edit | 0 | 3 | apache-2.0 | 7efecea3d6bac9dbe85c9ec7960cf26ad36e9ce5 | mruse/gitbook,bradparks/gitbook,jocr1627/gitbook,hongbinz/gitbook,iflyup/gitbook,yaonphy/SwiftBlog,nycitt/gitbook,lucciano/gitbook,mautic/documentation,bjlxj2008/gitbook,mautic/documentation,boyXiong/gitbook,sunlianghua/gitbook,thelastmile/gitbook,escopecz/documentation,Abhikos/gitbook,tzq668766/gitbook,gaearon/gitbook... | bin/build.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\ndefine([\"pat-masonry\"], function(pattern) {\n\n describe(\"pat-masonry\", function() {\n beforeEach(function() {\n $(\"<div/>\", {id: \"lab\"}).appendTo(document.body);\n });\n afterEach(function() {... | javascript | edit | 0 | 1 | bsd-3-clause | ae7a1ca4de02a34f55e81e94869dfd45ed265d22 | garbas/Patterns,garbas/Patterns,janga1997/Patterns,garbas/Patterns,janga1997/Patterns,janga1997/Patterns | src/pat/masonry/tests.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n//= require application\n//= require refresh\n//= require twitter\n//= require versionCheck\n//= require projectCheck\n//= require projectRefresh\n//= require spin\n\n$(function() {\n VersionCheck.init();\n ProjectCheck.init();\n Pro... | javascript | edit | 0 | 1 | mit | 9cefe6d2de5bbcf1a595ffd0d2fdcddb10d4e26b | mabounassif/projectmonitor-docker,remind101/projectmonitor,pivotal/projectmonitor,BuildingSync/projectmonitor,genebygene/projectmonitor,remind101/projectmonitor,BuildingSync/projectmonitor,remind101/projectmonitor,pivotal/projectmonitor,dgodd/projectmonitor,genebygene/projectmonitor,genebygene/projectmonitor,dgodd/proj... | app/assets/javascripts/dashboard.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nManageIQ.angular.app.controller('vmCloudAttachFormController', ['$scope', 'vmCloudAttachFormId', 'miqService', function($scope, vmCloudAttachFormId, miqService) {\n var vm = this;\n\n vm.vmCloudModel = { name: '' };\n vm.formId = vmC... | javascript | edit | 0 | 1 | apache-2.0 | d709576658ff46c3a21ef3fe8cedb35613f31f14 | ManageIQ/manageiq-ui-classic,ManageIQ/manageiq-ui-classic,ManageIQ/manageiq-ui-classic,ManageIQ/manageiq-ui-classic | app/assets/javascripts/controllers/vm_cloud/vm_cloud_attach_form_controller.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n//= require jquery.knob\n//= require jquery.gridster\n//= require_tree .\n\n$(function () {\n 'use strict';\n window.Kiteboard = {\n init: function () {\n var contentWidth = 1240;\n $('.gridster').width(contentWidth);\n ... | javascript | edit | 0 | 1 | mit | f8bec08353672de6900f7f7ad0752aad7bb37479 | Mbuckley0/kiteboard,Mbuckley0/kiteboard,Mbuckley0/kiteboard,Mbuckley0/kiteboard | app/assets/javascripts/kiteboard.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nangular.module('materialscommons').component('mcTaskTemplate', {\n templateUrl: 'app/project/experiments/experiment/components/tasks/components/mc-task-template.html',\n controller: MCTaskTemplateComponentController,\n bindings... | javascript | edit | 0 | 1 | mit | 8302dd782cf8756b6f5584b40678103e42c8ad81 | materials-commons/materialscommons.org,materials-commons/materialscommons.org,materials-commons/materialscommons.org,materials-commons/materialscommons.org,materials-commons/materialscommons.org | website/src/app/project/experiments/experiment/components/tasks/components/mc-task-template.component.js | rejected_duplicate | Near-duplicate of sample 77727 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nimport TimelinesController from '../../../controllers/api/v2/TimelinesController'\n\n\nexport default function addRoutes(app) {\n const controller = new TimelinesController(app);\n\n app.get('/v2/bestof', controller.bestOf);\n app.ge... | javascript | edit | 0 | 1 | mit | 8a770f2b1fa41a39d3693358d4f861e5b5535954 | FreeFeed/freefeed-server,FreeFeed/freefeed-server,golozubov/freefeed-server,golozubov/freefeed-server | app/routes/api/v2/TimelinesRoute.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nmodule.exports = function(grunt) {\n grunt.initConfig({\n pkgFile: 'package.json',\n clean: ['build'],\n babel: {\n options: {\n sourceMap: false\n },\n dist: {\n ... | javascript | edit | 0 | 2 | mit | 9b22494b461448d9e75e153610c1629d8e455074 | webdriverio/wdio-sync | gruntfile.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nimport Dependency from './Dependency'\n\n/**\n * The base class for defining your application's dependencies and installation\n * proceedures.\n */\nexport default class Php70 extends Dependency {\n\n default()\n {\n this.d... | javascript | edit | 0 | 1 | mit | a631f3597e2911a98bb29a27948a5bda85c7eb67 | baublet/lagniappe,baublet/lagniappe | app/lagniappe/dependencies/Php70.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n/**\n * Copyright 2015 Ian Davies\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 *\n * You may obtain a copy of the License at\n * ht... | javascript | edit | 0 | 2 | mit | fd1f74ace33c1107bbed87cbcd25df61f896171d | ucam-cl-dtg/isaac-app,ucam-cl-dtg/isaac-app,ucam-cl-dtg/isaac-app,ucam-cl-dtg/isaac-app | app/js/app/directives/IsaacModal.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nimport Ember from 'ember';\n\nexport default Ember.Component.extend({\n tagName: 'div',\n classNames: ['rating-panel'],\n\n rating: 0,\n maxRating: 5,\n item: null,\n setAction: '',\n\n stars: Ember.computed('rating',... | javascript | edit | 0 | 2 | mit | d0c8494eb7d272d5baf9cd909b88c45591e25f09 | andressrg/ember-cli-star-rating,balinterdi/ember-cli-star-rating,andressrg/ember-cli-star-rating,balinterdi/ember-cli-star-rating | addon/components/star-rating.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nvar twitchStreams = require('../');\n\ntwitchStreams.get('Monstercat', function(error, streams) {\n if (error) return console.log('Error caught:', error);\n console.log('Got stream data.');\n for (var stream of streams) {\n ... | javascript | edit | 0 | 2 | mit | fd4607a9d1c92e6c280de18a5a8facf2a7b7246a | nicholastay/node-twitch-get-stream | examples/getChannelStreams.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nimport {operatorExpression} from './expression';\nimport parseParameters from './parameters';\n\n/**\n * Parse a dataflow operator.\n */\nexport default function parseOperator(spec, ctx) {\n var params;\n\n if (spec.type === 'Operator... | javascript | edit | 0 | 5 | bsd-3-clause | eb0fdc2f825b41483f3f86392518749e69356867 | vega/vega,vega/vega,vega/vega,lgrammel/vega,vega/vega | packages/vega-runtime/src/operator.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n'use strict';\n\nvar request = require('request');\n\nvar opts = parseOptions(process.argv[2]);\n\nrequest(opts, function (err, res, body) {\n if (err) throw new Error(err);\n\n var format = '[%s]: %s %s %s';\n\n for (var i = 0... | javascript | edit | 0 | 3 | mit | 31aa36047d6cd74f8184eb4951ef4ef7b629b325 | jm-janzen/scripts,jm-janzen/scripts,jm-janzen/scripts | gevents.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n/*jshint unused:false */\nfunction LoginController($scope, loginService) {\n\n $scope.login = function() {\n\n loginService.login($scope.username, $scope.password, function(result) {\n\n $scope.result = result;\n ... | javascript | edit | 0 | 1 | mit | 2909f6b8dbec309281321b2442beb4204e0aba1b | pads/twangular,pads/twangular | src/js/controller/LoginController.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nconst pick = (obj, keys) =>\n keys.reduce((result, key) => {\n result[key] = obj[key]\n return result\n }, {})\n\nexport default pick\n\n```\n\nApply this change: Use a loop intead of reduce"
},
{
"role": "assistant",
... | javascript | edit | 0 | 3 | mit | 9892f2b45bed5f87fa8eccc03d4f759ba705b775 | acdlite/recompose,acdlite/recompose | src/packages/recompose/utils/pick.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nangular.module('npact', ['ngMessages', 'sticky'])\n .value('K', Kinetic)\n .run(function($rootScope, STATIC_BASE_URL) {\n $rootScope.STATIC_BASE_URL = STATIC_BASE_URL;\n })\n;\n\n```\n\nApply this change: Put the $locationProvider... | javascript | edit | 0 | 1 | bsd-3-clause | 18c3409b31aec2dfa62cf69cd92b037b2149b0a3 | victor-lin/npact,victor-lin/npact,NProfileAnalysisComputationalTool/npact,NProfileAnalysisComputationalTool/npact,victor-lin/npact,NProfileAnalysisComputationalTool/npact,NProfileAnalysisComputationalTool/npact,victor-lin/npact,victor-lin/npact,NProfileAnalysisComputationalTool/npact | npactweb/npactweb/static/js/app.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nexports.config = {\n // See http://brunch.io/#documentation for docs.\n files: {\n javascripts: {\n joinTo: 'js/app.js'\n },\n stylesheets: {\n joinTo: 'css/app.css'\n },\n templates: {\n joinTo: 'js/app.... | javascript | edit | 0 | 0 | mit | a3be123ec9b3bf9f1cd68e07e903652da590c0d0 | kidaa/phoenix,cas27/phoenix,andrewvy/phoenix,jamilabreu/phoenix,iStefo/phoenix,nickgartmann/phoenix,ephe-meral/phoenix,bsmr-erlang/phoenix,evax/phoenix,korobkov/phoenix,stevedomin/phoenix,manukall/phoenix,mschae/phoenix,vic/phoenix,korobkov/phoenix,fbjork/phoenix,rafbgarcia/phoenix,iStefo/phoenix,xtity/simple_phoenix,k... | priv/static/brunch/brunch-config.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nconst os = require('os');\nconst fs = require('fs');\nconst path = require('path');\nconst execFile = require('child_process').execFile;\n\nconst tmpfile = path.join(os.tmpdir(), process.versions.v8+'.flags.json');\nconst exclusions = [... | javascript | edit | 0 | 2 | mit | eb2f3db57dc797877a00bf915b453f09bc37711a | js-cli/js-v8flags,tkellen/js-v8flags | index.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nvar Accessory = require('./lib/Accessory.js').Accessory;\nvar Bridge = require('./lib/Bridge.js').Bridge;\nvar Service = require('./lib/Service.js').Service;\nvar Characteristic = require('./lib/Characteristic.js').Characteristic;\nvar ... | javascript | edit | 0 | 2 | apache-2.0 | 96414ff690e5e4d1e0bb23318f82aadbb2ed8bcb | pascalmartin/HAP-NodeJS,matthiaslau/HAP-NodeJS,KhaosT/HAP-NodeJS,mrhornsby/HAP-NodeJS,polo14va/HAP-NodeJS,KhaosT/HAP-NodeJS,peterlee0127/HAP-YeeLight,flexzuu/HAP-NodeJS | index.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nvar settings = require('ep_etherpad-lite/node/utils/Settings');\nvar githubAuth = require('github-auth');\nvar config = {\n organization: settings.users.github.org,\n autologin: true // This automatically redirects you to github t... | javascript | edit | 0 | 3 | bsd-2-clause | 05a6c840ac96205f16651464111d83bd2137bb46 | francois2metz/ep_github | ep_github.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\njQuery(function($, undefined) {\n var id = Math.random().toString();\n var sendCommandQueue = [];\n\n function enqueueCommand(command, onResponse) {\n var sendCommand = function() {\n var success = function(data, textStatus, ... | javascript | edit | 0 | 3 | mit | e7df0e8e1880b578e5151bfff388d2879d59b663 | groonga/heroku-try-groonga,groonga/heroku-try-groonga,groonga/heroku-try-groonga | public/js/try-groonga.js | rejected_duplicate | Near-duplicate of sample 74541 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nvar mongoose = require('mongoose'),\n urlFormatter = require('../../app/models/url_formatter.server.model'),\n Schema = mongoose.Schema;\n \nvar UserSchema = new Schema({\n firstName: String,\n lastName: String,\n emai... | javascript | edit | 0 | 1 | mit | 1bcccf2ad5f9aa0587eaad96df67a71c9f09da06 | shk33/mean-stack-app,shk33/mean-stack-app | app/models/user.server.model.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nvar minecraftData = require('minecraft-data');\nvar isArmor = require('./lib/isArmor');\nvar equipItem = require('./lib/equipItem');\n\nmodule.exports = function(bot, config) {\n if(!bot) {\n throw new Error('Bot object is missing, ... | javascript | edit | 0 | 5 | mit | 46779eb474c44104c7626f2dbe1db14d032321d4 | G07cha/MineflayerArmorManager | index.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nvar gulp = require('gulp'),\n modula = require('modula-loader'),\n _ = require('lodash'),\n plugins = require('gulp-load-plugins')()\n\nplugins.uglify = require('gulp-uglify')\nplugins.minifycss = require('gulp-minify... | javascript | edit | 0 | 6 | mit | 75199b9888bba9a46625d628cc3389d9f3c22c8f | Nafta7/gutaska,Nafta7/gulp-tasks,Nafta7/gutaska | index.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nvar map = require('map-stream')\n , sass = require('node-sass')\n , path = require('path')\n , gutil = require('gulp-util')\n , ext = gutil.replaceExtension\n ;\n\nmodule.exports = function (options) {\n var opts = options ... | javascript | edit | 0 | 7 | mit | 7c021a03d6559859a207a2d91491ae24ff0323b9 | danreeves/gulp-sass,maxaille/gulp-sass,eoneill/gulp-sass,callumlocke/gulp-sass,dlmanning/gulp-sass,Mirtle/gulp-sass,cinic/gulp-sass,EdwonLim/gulp-sass-china,xzyfer/gulp-sass,jlgeering/gulp-sass,minted/gulp-sass,Snugug/gulp-sass,emil-mi/gulp-sass,nstokoe/gulp-sass,mariusGundersen/gulp-sass,zacwasielewski/gulp-sass-liqui... | index.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n'use strict';\n\nmodule.exports = {\n name: require('./package').name,\n\n treeForAddonTestSupport(tree) {\n // intentionally not calling _super here\n // so that can have our `import`'s be\n // import { ... } from 'ember-sin... | javascript | edit | 0 | 1 | mit | 0ce9352c09df898f6f010c5a2d820005d52599e2 | elwayman02/ember-sinon-qunit,elwayman02/ember-sinon-qunit | index.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n#!/usr/bin/env node\nconst express = require('express');\nconst fileExists = require('file-exists');\nconst bodyParser = require('body-parser');\nconst fs = require('fs');\nconst { port = 8123 } = require('minimist')(process.argv.slice(... | javascript | edit | 0 | 4 | mit | 0ab801cfbc289b73ea2f7cdd02a9950a81d98a7d | finom/node-direct,finom/node-direct | index.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n#! /usr/bin/env node\n'use strict';\n\nconst unifi = require('./lib/unifi');\nconst domoticz = require('./lib/domoticz');\nconst config = require('./lib/config');\n\nlet configArgIndex = process.argv.findIndex(arg => {\n return arg ===... | javascript | edit | 0 | 3 | mit | ec9eb0f4e6f01b745a5b87f6191048602175b5ba | osirisguitar/unifi-detect,osirisguitar/unifi-detect | index.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nvar autoprefixer = require('autoprefixer');\n\nmodule.exports = function() {\n var args = Array.prototype.slice.call(arguments);\n\n return function(style){\n style.on('end', function(css, cb){\n if (args) return cb(null, auto... | javascript | edit | 0 | 2 | mit | a98ac8b20bfba4ba7d3ef416bef87217cec72acc | jenius/autoprefixer-stylus | index.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n\n//only exports browser api. use chloride module\n//to get automatic fallbacks!\n\n//load tweetnacl first, so that it works sync, and everything is there.\nvar exports = require('sodium-browserify-tweetnacl')\n\nfor(var k in exports) (... | javascript | edit | 0 | 2 | mit | 8dd3786c9c2f4bbffd2afddb14c81c4cc5f55555 | dominictarr/sodium-browserify | index.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nimport React, { Component } from 'react';\nimport { Button, ButtonGroup, Modal, ModalHeader, ModalBody, ModalFooter } from 'reactstrap';\nimport FontAwesome from 'react-fontawesome';\n\nexport default class ModalForm extends Component {... | javascript | edit | null | null | mit | 52c45611893e322a1241359ca5c493b6f3c34693 | thehink/linkify,thehink/linkify,thehink/linkify | src/components/ModalForm/ModalForm.js | rejected_syntax | Syntax error detected by tree-sitter | false |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nvar sass = require('node-sass'),\n path = require('path'),\n fs = require('fs');\n\nvar handledBaseFolderNames = {\n 'bower_components': 'bower_components',\n 'node_modules': 'node_modules'\n};\n\nfunction customImporter (ur... | javascript | edit | 0 | 3 | apache-2.0 | 573fae717a561986992dd703f6d1489fa5d85531 | Brightspace/frau-sass-importer | index.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n#!/usr/bin/env node\nconst express = require('express');\nconst fileExists = require('file-exists');\nconst bodyParser = require('body-parser');\nconst fs = require('fs');\nconst { port = 8123 } = require('minimist')(process.argv.slice(... | javascript | edit | 0 | 4 | mit | 0d01cf33b683508d077de79b754d4f2d83c7074f | finom/node-direct,finom/node-direct | index.js | rejected_duplicate | Near-duplicate of sample 78745 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nvar exports = {\n ScrollView: require('./src/react/ScrollView/ScrollView'),\n ScrollViewDelegate: require('./src/react/ScrollView/ScrollViewDelegate'),\n Enums: {\n ScrollDirectionType: require(\"./src/react/Enums/Scroll... | javascript | edit | 0 | 0 | mit | 403991faa5bc99c4e6acae69529fa4863b469c7b | davidmfreese/React-ScrollView,davidmfreese/React-ScrollView | index.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n'use strict';\nvar isStream = require('is-stream');\nvar matchCondition = require('match-condition');\nvar peekStream = require('peek-stream');\nvar through = require('through2');\n\nmodule.exports = function (condition, stream, fn, opt... | javascript | edit | 0 | 6 | mit | a84af2fd0c5b870c6a65eb65220e07f1dc1a56cc | kevva/if-stream | index.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\ntry {\n /**\n * Try loading the compiled code.\n */\n module.exports = require('./lib').default\n} catch (e) {\n /**\n * If the compiled code is not available,\n * load from source.\n */\n try {\n require('babel-registe... | javascript | edit | 0 | 0 | mit | 94309c8532f31df72a0e407dfe3b87b6a53e927c | saguijs/sagui,saguijs/sagui | index.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n'use strict';\n\nvar Promise = require('es6-promise').Promise;\n\nmodule.exports = function(array, haltCallback) {\n if(!(haltCallback instanceof Function)) {\n haltCallback = function() {\n return true;\n };\n }\n return ... | javascript | edit | 0 | 7 | mit | 08b8925e7da13acac6b377fce721af939b41d0bd | CacheControl/promise-series | index.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nvar postcss = require('postcss'),\n extend = require('extend');\n\nmodule.exports = postcss.plugin('postcss-default-unit', function (opts) {\n opts = opts || {};\n opts.unit = opts.unit || 'px';\n opts.ignore = extend({\n ... | javascript | edit | 0 | 3 | mit | c7a77cdd13944048279e1f9136941e9a81c7d6e9 | antyakushev/postcss-default-unit | index.js | rejected_duplicate | Near-duplicate of sample 72841 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n/**\n * index.js\n * Client entry point.\n *\n * @author Francis Brito <<EMAIL>>\n * @license MIT\n */\n'use strict';\n\nvar Client = function Client(apiKey, opts) {\n if (!apiKey) {\n throw new Error('No API key provided.');\... | javascript | edit | 0 | 2 | mit | b91355bca9a89df46c52a64d7620b4fa5e54a956 | francisbrito/ph-node | index.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nmodule.exports = function(config) {\n return {\n producer: require('./lib/producer')(config || {}),\n consumer: require('./lib/consumer')(config || {})\n };\n};\n\n```\n\nApply this change: Use default config if not setted"
},... | javascript | edit | 0 | 3 | mit | 8df4aa0b37e06c1a0216c996a72f6d3561b47e1f | dial-once/node-bunnymq | index.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nconst router = require('express').Router();\nconst MoviesController = require('../controllers/MoviesController');\nconst checkTmdbConfig = require('../middlewares/movieApiMiddlware');\n\ncheckTmdbConfig(router);\n\nrouter.get('/movies',... | javascript | edit | 0 | 0 | mit | 5c9ed6ce335e52da41b8dc58ca4c07a58dbe9f09 | nathanhood/mmdb,nathanhood/mmdb | server/routes/api.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n/**\n * Created by alnedorezov on 5/26/17.\n */\nfunction initZoomIn() {\n Tool.zoomIn = function () {\n return fromPrototype(Tool, {\n onClick: function (isButtonPressed) {\n\n /*global zoomCount*/\n... | javascript | edit | 0 | 2 | mit | 5295b5118f3b7f06eb6849875f7c0444d0f75b8a | innosoft-pro/label-them,innosoft-pro/label-them,AlNedorezov/label-them,AlNedorezov/label-them,innosoft-pro/label-them,AlNedorezov/label-them,innosoft-pro/label-them | front/js/app/tools/zoom_in.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n'use strict';\n\nexports.formatStr = function () {\n var args = Array.prototype.slice.call(arguments)\n , str = args.shift()\n , i = 0;\n return str.replace(/\\{([0-9]*)\\}/g, function (m, argI) {\n\t\targI = argI || i;\n\t\ti +... | javascript | edit | 0 | 5 | mit | 7d0c97b5a56142dcffcd50486c872ebbd1b09595 | jaycetde/is-validation | helpers.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nmodule.exports = {\n waitForConditionPollInterval: 1000,\n waitForConditionTimeout: 6000,\n pauseDuration: 5000,\n retryAssertionTimeout: 2500,\n}\n\n```\n\nApply this change: Increase timeouts to improve test runs\n\nAttempts to ad... | javascript | edit | 0 | 0 | mit | 804f3371d91da67de43c2cb6cb7d19cbe282352f | uktrade/data-hub-fe-beta2,uktrade/data-hub-frontend,uktrade/data-hub-frontend,uktrade/data-hub-frontend,uktrade/data-hub-fe-beta2 | test/acceptance/global.nightwatch.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\ndocument.addEventListener('DOMContentLoaded', function() {\n // Inititate Select2 on any select element with the class .select2\n $('select.select2').select2({\n // change that\n allowClear: false,\n placeholder: {\n id:... | javascript | edit | 0 | 2 | bsd-3-clause | bd40e7c6889555390569866473cdca8ea6ab2a57 | imella/spree,imella/spree,imella/spree | backend/app/assets/javascripts/spree/backend/spree-select2.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nvar buster = require(\"buster\");\nvar assert = buster.assert;\nbuster.testCli = require(\"../../../lib/buster-test-cli\");\n\nbuster.testCase(\"Module index\", {\n \"should have dynamic version getter\": function () {\n asser... | javascript | edit | 0 | 1 | bsd-3-clause | 7e03e4bbe1cdf197ba417b8f79acd2348527d094 | busterjs/buster-test-cli | test/node/unit/buster-test-cli-test.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nimport Long from 'long';\nimport _ from 'lodash';\n\nexport default {\n recent(items) {\n return _.reverse(\n _.sortBy(items, (v) => {\n const ms = v && v.creation_time_ms;\n return ms && new Long(ms.low, ms.high,... | javascript | edit | 0 | 3 | mit | 95b10fc694ed3b92c59431c4999e40d7b47334d8 | billyvg/pokemon-journal,billyvg/pokemon-journal | app/api/sort.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nmodule.exports = function(grunt) {\n\n\tgrunt.config('clean', {\n\t\tstyles: {\n\t\t\tsrc: [\n\t\t\t\t'<%= project.styles_dev %>/*.concat.css',\n\t\t\t\t'<%= project.styles_dev %>/*.map',\n\t\t\t\t'<%= project.styles_min %>/*.css',\n\t\... | javascript | edit | 0 | 1 | mit | b01dfb5a9b3066ab068528250cb017a014d0a3e1 | jolantis/altair,jolantis/altair | grunt/config/contrib-clean.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nimport Vue from 'vue';\nimport Router from 'vue-router';\n\n// Pages\nimport Home from 'new-dashboard/pages/Home';\nimport Solutions from 'new-dashboard/pages/Solutions';\nimport Maps from 'new-dashboard/pages/Maps';\nimport Data from '... | javascript | edit | 0 | 1 | bsd-3-clause | 255932d562fce2405c51c33d3fdc0ebd5efd2bd5 | CartoDB/cartodb,CartoDB/cartodb,CartoDB/cartodb,CartoDB/cartodb,CartoDB/cartodb | lib/assets/javascripts/new-dashboard/router/index.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nprivacyOptions = { // true means exposed\n _id: true,\n commentCount: true,\n createdAt: true,\n email_hash: true,\n isInvited: true,\n karma: true,\n postCount: true,\n slug: true,\n username: true,\n 'profile.name': true,\n ... | javascript | edit | 0 | 0 | mit | a520620856f2e3a699ced3d5b0d4092a3deff374 | sungwoncho/Telescope,cydoval/Telescope,mr1azl/Telescope,jonmc12/heypsycho,julienlapointe/telescope-nova-social-news,dima7b/stewardsof,huaiyudavid/rentech,jrmedia/oilgas,wunderkraut/WunderShare,Alekzanther/LawScope,sungwoncho/Telescope,silky/GitXiv,SachaG/Gamba,tommytwoeyes/Telescope,covernal/Telescope,jonmc12/heypsycho... | lib/publications.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n'use strict';\n\nvar epaper = require('../index.js');\n\nepaper.init({\n spiDev: '/dev/spidev1.0',\n clockSpeed: 1e5\n}, function(err) {\n if (err) {\n throw new Error(err);\n }\n\n epaper.uploadFromUrl('http://www.york.ac.uk/te... | javascript | edit | 0 | 2 | bsd-2-clause | e8ceb4fcc326548755f189fb9f76a528380da2da | doganyazar/node-epaper,doganyazar/node-epaper | examples/loadUrl.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nconst express = require('express')\nconst DiscordServer = require('./DiscordServer')\n\nmodule.exports = \n// This function starts the update server. This is used\n// to cause the bot to download new information about a\n// target... | javascript | edit | 0 | 4 | apache-2.0 | feaa0f9740e3c40605a2ab50f7cf6193ba769ca9 | evaera/RoVer | src/UpdateServer.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n'use strict'\n\nconst Sequelize = require('sequelize')\nconst db = require('APP/db')\n\nconst Review = db.define('review', {\n rating: {\n type: Sequelize.INTEGER,\n allowNull: false,\n },\n description: Sequelize.TEXT,\n})\n\n... | javascript | edit | 0 | 0 | mit | d352b7122db455604a4625c313f54efed77f0777 | cvglass/Lair-Depot,cvglass/Lair-Depot,cvglass/Lair-Depot | db/models/review.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nimport fs from \"fs\";\nimport path from \"path\";\nimport copyDir from \"copy-dir\";\nimport isFunction from \"lodash.isfunction\";\nimport rimraf from \"rimraf\";\nimport pkg from \"../package.json\";\n\nexport default function(module... | javascript | edit | 0 | 5 | mit | cbe95b445523cba2214ef48e89b0c1c3ce5eb9ed | lukehorvat/overwrite | lib/index.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n/*global window,location*/\n(function (window) {\n 'use strict';\n\n var Simditor = window.Simditor;\n var directives = angular.module('simditor',[]);\n\n directives.directive('simditor', function () {\n return {\n require: ... | javascript | edit | 0 | 3 | mit | 2fc8932dba0cae96fcf6c632cbfa784e842d8c8d | wanming/angular-editor,wanming/angular-editor | javascripts/angular-editor.js | accepted | null | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.