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 socketio from 'socket.io-client'\n\nimport log from 'services/log'\nimport foodsharing from 'services/foodsharing'\n\nexport let io = null\nexport const subscribers = []\n\nexport default {\n\n /*\n * Subscribe to the websocke... | javascript | edit | 0 | 2 | mit | cfbf2b47636695609ecdecbaf8ddad386025d11d | foodsharing-dev/foodsharing-light,foodsharing-dev/foodsharing-light,foodsharing-dev/foodsharing-light | src/services/socket.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n// Example of how to connect to a Tor hidden service and use it as a peer.\n// See demo.js to learn how to invoke this program.\n\nvar bcj = org.bitcoinj;\nvar params = bcj.params.MainNetParams.get();\nvar context = new bcj.core.Context... | javascript | edit | null | null | apache-2.0 | 64e33618b2ffe993292568a747944471cca5d54e | bitsquare/bitcoinj | examples/src/main/javascript/tor.js | rejected_syntax | Syntax error detected by tree-sitter | false |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nvar expect = require('chai').expect;\nvar validator = require('../');\n\ndescribe('Image Validator', function() {\n var rules = {\n imageInput: ['image']\n };\n\n it('should fail on non image type', function() {\n var result = ... | javascript | edit | 0 | 1 | mit | 00fe5c502fa715eeb1ac6707b1cffddcccf47585 | cermati/satpam,sendyhalim/satpam | tests/image.spec.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n'use strict';\n\nGJS.Sprite.gfxPath = '../examples/assets/gfx/';\n\ndescribe('Sprite', function() {\n it('can be used before it is loaded', function() {\n var s = new GJS.Sprite('carrot.png');\n var canvas = document.cr... | javascript | edit | 0 | 1 | mit | f2c21c1915a214ffa2ac0730631ce36988592dfc | Oletus/gameutils.js,Oletus/gameutils.js | unit_tests/sprite_spec.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n\"use strict\";\n/* global process */\n/*******************************************************************************\n * Copyright (c) 2015 IBM Corp.\n *\n * All rights reserved. \n *\n * Contributors:\n * David Huffman - Initial i... | javascript | edit | 0 | 2 | apache-2.0 | 24ad973b558b09623e0642956255296f3df1284f | IBM-Blockchain/marbles,furuya-s/marbles,Serarmen/marbles,Serarmen/marbles,BlockChainPublicDemos/karachain-app-team2,JSakchai/KYC-Agent,DIACC/POC-corporate-registries,raphael-hoed/IFNMG-CERTIFICADOS,vmd90/marbles,furuya-s/marbles,dhyey20/cp-web,sj1chun/marbles,IBM-Blockchain/marbles,jparth11/marbles,swetabachhety/ekyc,s... | routes/site_router.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nvar path = require('path');\nvar childProcess = require('child_process');\n\nfunction gulp(task) {\n return childProcess.execSync([\n 'node_modules/.bin/gulp',\n '--gulpfile', path.resolve(__dirname, 'fixtures', 'gulpfile.js'),\n... | javascript | edit | 0 | 1 | mit | 7f6a95fef44579330a63c359892b8b5d50e624f2 | jasmine/gulp-jasmine-browser,mdix/gulp-jasmine-browser,AOEpeople/gulp-jasmine-browser | spec/index_spec.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n/* global require, describe, it */\n\nvar assert = require('assert');\nvar urlPrefix = 'http://katas.tddbin.com/katas/es6/language/';\nvar katasUrl = urlPrefix + '__grouped__.json';\n\nvar GroupedKata = require('../src/grouped-kata.js')... | javascript | edit | 0 | 1 | mit | e2ef7b3589371e4a41d6dfca1f44fac4c9148521 | wolframkriesing/es6-react-workshop,wolframkriesing/es6-react-workshop | test/load-json-spec.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nimport path from 'path';\nimport webpack from 'webpack';\nimport autoprefixer from 'autoprefixer';\n\nmodule.exports = {\n entry: {\n 'react-image-lightbox': './src/index',\n },\n output: {\n path: path.join(__dir... | javascript | edit | 0 | 0 | mit | b985443298b001d7441662e6fa4aee22ef009f44 | fritz-c/react-image-lightbox,c00kiemon5ter/react-image-lightbox,c00kiemon5ter/react-image-lightbox | webpack.config.umd.babel.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nvar mongoose = require('mongoose');\n\n// Create a new schema for tweets\nvar schema = new mongoose.Schema({\n twid : String,\n active : Boolean,\n author : String,\n avatar : String,\n body : String,\n dat... | javascript | edit | 0 | 2 | mit | 6e7878fa36251f9f8bd3ef2a5d0d37d7da626f8e | thinkswan/react-twitter-stream,thinkswan/react-twitter-stream | models/Tweet.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nimport {NAMESPACE, PREFIX} from './constants';\n\nconst ast = require('parametric-svg-ast');\nconst arrayFrom = require('array-from');\nconst startsWith = require('starts-with');\n\nconst ELEMENT_NODE = 1;\n\nconst getChildren = ({child... | javascript | edit | 0 | 3 | mit | 4790d1e767e9aacd51dcb1a2b656ae099ca61459 | parametric-svg/parse,parametric-svg/parse | module/index.js | rejected_duplicate | Near-duplicate of sample 81137 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nimport Class from '../class';\nimport Matreshka from '../matreshka';\nimport instanceMembers from './_prototype';\nimport matreshkaError from '../_helpers/matreshkaerror';\nimport initMK from '../_core/init';\nimport staticMembers from ... | javascript | edit | 0 | 4 | mit | dcce6195539f457c6a0276e26caa7fca74e25ed5 | matreshkajs/matreshka,finom/matreshka,matreshkajs/matreshka,finom/matreshka | src/array/index.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nimport React from 'react';\nimport NextEvent from './NextEvent';\nimport UpcomingEvents from './UpcomingEvents';\nimport PreviousEvents from './PreviousEvents';\nimport ParseComponent from 'parse-react/class';\n\nexport de... | javascript | edit | 0 | 2 | apache-2.0 | f30e96066d22d7481fe587109ee0eec8035c8caa | naltaki/naltaki-front,naltaki/naltaki-front | src/Homepage/index.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nsetupFlorence();\n\n\n//forms field styling markup injection\n//$('select:not(.small)').wrap('<span class=\"selectbg\"></span>');\n//$('select.small').wrap('<span class=\"selectbg selectbg--small\"></span>');\n//$('.selectbg--small:eq(1... | javascript | edit | 0 | 0 | mit | 92d25406976259615fd43a5f93867508b4ee7429 | ONSdigital/florence,ONSdigital/florence,ONSdigital/florence,ONSdigital/florence | src/main/web/florence/js/functions/__init.js | rejected_duplicate | Near-duplicate of sample 73006 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nvar passport = require('passport');\nvar auth0 = require('../lib/services/auth0');\n\nmodule.exports = {\n type: 'authentication',\n module: auth0,\n initialize: (app) => {\n passport.use(auth0.strategy);\n\n passport.serialize... | javascript | edit | 0 | 2 | mit | 658793601f1ce937724c8c45f52088b5054fdb79 | CopenhagenCityArchives/kbh-billeder,CopenhagenCityArchives/kbh-billeder,CopenhagenCityArchives/kbh-billeder | plugins/auth.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n/**\n * Created by Tomasz Gabrysiak @ Infermedica on 08/02/2017.\n */\n\nimport html from '../../templates/helpers';\n\nconst template = (context) => {\n return new Promise((resolve) => {\n context.api.getSuggestedSymptoms(context.d... | javascript | edit | 0 | 2 | mit | a453568816c6bde8f9ca583fa9da5d6664d189e7 | infermedica/js-symptom-checker-example,infermedica/js-symptom-checker-example | src/components/suggest/template.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nimport { group, member, message } from '../actions/actionTypes';\n\nconst groupReducer = (state = {}, action = {}) => {\n switch (action.type) {\n case group.CREATE_SUCCESS:\n return {\n ...state,\n [action.group.... | javascript | edit | 0 | 6 | mit | 27912a421479d2c4216169873e79a09267792f00 | 3m3kalionel/PostIt,3m3kalionel/PostIt | client/reducers/groupReducer.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nsteal(\"src/synthetic.js\", function (Syn) {\n\tmodule(\"synthetic/typeable\");\n\n\tvar isTypeable = Syn.typeable.test;\n\n\ttest(\"Inputs and textareas\", function () {\n\t\tvar input = document.createElement(\"input\");\n\t\tvar text... | javascript | edit | 0 | 1 | mit | fb4ce1399205e9f6299fdb6ccb2687a78f70a348 | bitovi/syn,bitovi/syn | test/qunit/typeable_test.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nvar convert = require('convert');\nvar parse = require('color-parser');\n\nexports.segments = {\n stroke: function(display, segment) {\n if (!segment.focused) return;\n\n switch (segment.type) {\n case 'CAR':\n return... | javascript | edit | 0 | 5 | bsd-3-clause | 6cf4dd9e9bb8333ab1d37551b0b6fd17fd4a5d57 | arunnair80/modeify,arunnair80/modeify,arunnair80/modeify-1,amigocloud/modeify,miraculixx/modeify,tismart/modeify,amigocloud/modified-tripplanner,amigocloud/modeify,arunnair80/modeify,arunnair80/modeify-1,tismart/modeify,amigocloud/modified-tripplanner,miraculixx/modeify,amigocloud/modeify,amigocloud/modified-tripplanne... | client/transitive-view/style.js | rejected_duplicate | Near-duplicate of sample 84120 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n'use strict'\n\nrequire('../lib/peer-watch.js')\n\nconst { setTimeout } = require('sdk/timers')\nconst { prefs } = require('sdk/simple-prefs')\nconst tabs = require('sdk/tabs')\nconst gw = require('../lib/gateways.js')\n\nexports['test ... | javascript | edit | 0 | 1 | cc0-1.0 | 7a46ecdf7a8494afb7c33dfb9de07dbd2b61d5e6 | lidel/ipfs-firefox-addon,lidel/ipfs-firefox-addon,lidel/ipfs-firefox-addon | test/test-automatic-mode.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n// Comes from https://github.com/facebook/relay/issues/161\n// Should be used in tests as a replacement for `react-storybooks-relay-container`\n//\nvar React = require.requireActual(\"react\")\n\nconst graphql = (strings, ...keys) => {\... | javascript | edit | 0 | 1 | mit | 6e0b7f2873fb8ede6bfd8dbf29b30200330b2662 | artsy/reaction,artsy/reaction,artsy/reaction-force,artsy/reaction-force,artsy/reaction | __mocks__/react-relay.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n(function () {\n 'use strict';\n\n angular.module('j.point.me').controller('FirstController', ['$scope', '$firebase', '$firebaseAuth', '$window',\n function ($scope, $firebase, $firebaseAuth, $window) {\n\n var r... | javascript | edit | 0 | 2 | mit | 3241e2d18bd58d84d253def70cd8db437411b702 | bertjan/jpointme,bertjan/jpointme | src/webapp/js/controllers/FirstController.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n$().ready(loadContentSection);\n\n$(\"body\").on('click', '.keyword', function() {\n $(this).addClass(\"active\");\n $(\".base\").hide(200);\n $(\"#real-body\").addClass(\"focus\");\n});\n\n$(\"body\").on('click', \".close\", functio... | javascript | edit | 0 | 2 | apache-2.0 | 52299ae65b41cdfae0d8a4b0fb69f19c94be3f8f | googleinterns/step36-2020,googleinterns/step36-2020,googleinterns/step36-2020 | src/main/webapp/scripts/results.js | rejected_duplicate | Near-duplicate of sample 77297 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n'use strict';\n\ndefine(function(require) {\n var i18next = require('ext/i18next');\n var i18nextJquery = require('ext/jquery-i18next');\n var i18nextXHRbackend = require('ext/i18next-xhr-backend');\n\n i18next\n .use... | javascript | edit | 0 | 1 | bsd-3-clause | 02f37068864173e02e9ac4a38c8a94ae85a1ded5 | edina/fieldtrip-open,edina/fieldtrip-open,edina/fieldtrip-open,edina/fieldtrip-open | src/www/js/i18n.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n'use strict';\n\n/*****\n * Vain\n *\n * A view-first templating engine for Node.js.\n*****/\nvar jsdom = require('jsdom'),\n $ = require('jquery')(jsdom.jsdom().createWindow()),\n snippetRegistry = {};\n\n/**\n * Register a snipp... | javascript | edit | 0 | 4 | apache-2.0 | 925a1a772962f3b80c810f024c971eb49cc15d34 | farmdawgnation/vain | lib/vain.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nimport React from 'react'\nimport { getDisplayName, wrapDisplayName, setDisplayName } from 'recompose'\n\nconst fixLineHeight = (lineHeight, displayName) => {\n if (typeof lineHeight === 'string') {\n throw new Error(\n `The el... | javascript | edit | 0 | 5 | mit | 1043e155d585912f19199d525ae121484e95e0e4 | klarna/higher-order-components,klarna/higher-order-components | src/normalizeStyle.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n(function(app) {\n 'use strict';\n\n var Root = app.Root || require('./components/root.js');\n\n var root = new Root();\n root.init();\n\n app.root = root;\n})(this.app || (this.app = {}));\n\n```\n\nApply this change: Rename prope... | javascript | edit | 0 | 2 | mit | 5c340b295d7d368aa15d2c9f496a611989c587bb | ionstage/loclock,ionstage/loclock | js/app.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n//Loads images and then initializes Datatables\n$(window).load(function() {\n\tvar tableTitle = $('.tableImage');\n\tvar imageTitle = $('.tableTitle a');\n\tvar i = 0;\n\n\t\n\tfor (i; i < tableTitle.length; i++) {\n\t\tvar imageLink = ... | javascript | edit | 0 | 2 | mit | 18eb89fb8f7d341009348cf91968965f5c9da691 | HowtoGhost/allghostthemes,HowtoGhost/allghostthemes | assets/js/imageLoad.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nexport const reportBug = (data) => ({\n method: 'post',\n url: 'reports/bug',\n data\n});\n\nexport const reportCrash = (data) => ({\n method: 'post',\n url: 'reports/bug',\n data\n});\n\n// reportCrashSentryProxy unc... | javascript | edit | 0 | 1 | mit | 057abacf5e0b2c1f47e2d6e00d3a9d8fbc880ac6 | ProtonMail/WebClient,ProtonMail/WebClient,ProtonMail/WebClient | packages/shared/lib/api/reports.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nangular.module('offClick',[])\n.directive('offClick', ['$document', function ($document) {\n \n function targetInFilter(target,filter){\n if(!target || !filter) return false;\n var elms = angular.element(filter);... | javascript | edit | 0 | 5 | mit | 69d502c43d1b623fb704761de9453e12da7eaafa | trenthogan/angular-off-click,TheSharpieOne/angular-off-click,lmtm/angular-off-click | offClick.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nimport { combineReducers } from 'redux';\nimport fuelSavingsAppState from './fuelSavings';\nimport cmsAppState from './cms.js';\n\nconst rootReducer = combineReducers({\n fuelSavingsAppState: fuelSavingsAppState,\n cmsAppState: cmsApp... | javascript | edit | 0 | 0 | mit | 7eaf0e31a40d759d7a4b7bf5884a384e3d3dbc9b | vandosant/fawn,vandosant/fawn | src/reducers/index.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nvar path = require('path')\nvar cp = require('child_process')\n\nvar script = path.join(__dirname, 'postinstall')\nif (process.platform.indexOf('win') === 0) {\n script += '.cmd'\n} else {\n script += '.sh'\n}\nvar child = cp.exec(scr... | javascript | edit | 0 | 0 | mit | 45d04853df6e61dc601e57d4f9e2684cad58e710 | bronson/apm,atom/apm,bronson/apm,atom/apm,atom/apm,atom/apm,bronson/apm,bronson/apm | script/postinstall.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nvar express = require('express');\nvar router = express.Router();\nvar arduino = require('../lib/arduino');\n\n/* GET home page. */\nrouter.get('/', function(req, res, next) {\n res.render('index', {\n title: 'Findmon - 2015 S... | javascript | edit | 0 | 1 | mit | 31db55474ac2fb49b3fb07065cd36bbdb606ee16 | rambling/findmon-sba,rambling/findmon-sba,rambling/findmon-sba | routes/index.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n// nS - No Space\n// lC - Lowercase\n\nexport function bundleIdentifiers(\n currentAppName,\n newName,\n projectName,\n currentBundleID,\n newBundleID,\n newBundlePath\n) {\n const nS_CurrentAppName = currentAppName.replace(/\\s/... | javascript | edit | 0 | 1 | mit | 878e78af356d3067ccdac8bb2c4bd7c2b99bb885 | JuneDomingo/react-native-rename | src/config/bundleIdentifiers.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\ndescribe(\"About Expects\", function() {\n\n //We shall contemplate truth by testing reality, via spec expectations. \n it(\"should expect true\", function() {\n expect(false).toBeTruthy(); //This should be true\n });\n\n //To u... | javascript | edit | 0 | 1 | mit | 5bda50aca253dced7089fd9eb98aff9dce37cb87 | garronmichael/javascript-koans,garronmichael/javascript-koans,garronmichael/javascript-koans | koans/AboutExpects.js | rejected_duplicate | Near-duplicate of sample 71488 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n#!/usr/bin/env node\n\nvar fs = require('fs'),\n url = require('url'),\n http = require('http'),\n prompt = require('prompt'),\n pecanApp = require('commander'),\n pecanInfo = require('./package.json... | javascript | edit | 0 | 0 | apache-2.0 | 7306b27f76c871fc6932b8cccfb2be600d062286 | btcrooks/pecan | pecan.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nvar supportsWoff2 = (function( win ){\n\tif( !( \"FontFace\" in win ) ) {\n\t\treturn false;\n\t}\n\n\tvar f = new FontFace('t', 'url( \"data:application/font-woff2;base64,d09GMgABAAAAAADcAAoAAAAAAggAAACWAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAA... | javascript | edit | 0 | 3 | mit | 837f67b6dffe737f252d94a7a9d3d5c8bd5d899c | filamentgroup/woff2-feature-test,filamentgroup/woff2-feature-test | woff2.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nclass Vec {\n constructor(x, y) {\n this.x = x;\n this.y = y;\n }\n\n plus(v) {\n return new Vec(this.x + v.x, this.y + v.y);\n }\n\n minus(v) {\n return new Vec(this.x - v.x, this.y - v.y);\n ... | javascript | edit | 0 | 1 | mit | 1c9039a0bc7fa585ed309cbc0ae73a29da93ca10 | bewuethr/ctci | eloquent_js/chapter06/ch06_ex01.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n/**\n * This file specifies the database collection and field names.\n */\nexport const COLLECTION_TRIPS = 'trips';\nexport const TRIPS_TITLE = 'title';\nexport const TRIPS_DESCRIPTION = 'description';\nexport const TRIPS_DESTINATION = ... | javascript | edit | 0 | 0 | apache-2.0 | 1d413edc3969ad921af3bee1b0f22446458192f0 | googleinterns/SLURP,googleinterns/SLURP,googleinterns/SLURP | frontend/src/constants/database.js | rejected_duplicate | Near-duplicate of sample 79747 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nimport {Socket} from \"phoenix\"\nwindow.Experiment = class Experiment {\n constructor(topic, token, update) {\n this.socket = new Socket(\"/socket\")\n this.socket.connect()\n this.chan = this.socket.channel(top... | javascript | edit | 0 | 2 | mit | bb3f26196e870007810f262a74cbe37b94f27bef | xeejp/xee,xeejp/xee,xeejp/xee,xeejp/xee,xeejp/xee | web/static/js/app.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nimport React from 'react';\nimport ConfigForm from '../containers/ConfigForm';\n\nexport default class AttackConfig extends React.Component {\n constructor() {\n super();\n this.state = {\n sourceip: '',\n ... | javascript | edit | 0 | 3 | mit | 251a3879743884b32fa7c75cd6d8e7bf1883d500 | dimriou/rupture,esarafianou/rupture,dionyziz/rupture,dimkarakostas/rupture,dimkarakostas/rupture,dimriou/rupture,dionyziz/rupture,dimkarakostas/rupture,dionyziz/rupture,dimriou/rupture,esarafianou/rupture,dimriou/rupture,dionyziz/rupture,dimriou/rupture,dimkarakostas/rupture,esarafianou/rupture,esarafianou/rupture,dimk... | frontend/src/pages/AttackConfig.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n/**\n * Communicate back to the web app.\n */\n\nvar extensionRoot = (new File($.fileName)).parent + '/';\n\n$.evalFile(extensionRoot + '/constants.js'); \n$.evalFile(extensionRoot + '/Json.js'); \n$.evalFile(extensionRoot + '/Saver.js... | javascript | edit | 0 | 3 | mit | 969be31e021ad1941ff0f876c007efd3582fddfe | reimund/Save-Panel,reimund/Save-Panel,reimund/Save-Panel | html5/dist/static/js/ps/interact.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n#!/usr/bin/env node\n\nconst { ArgumentParser, Const } = require('argparse');\nconst { version } = require('../package.json');\n\nconst parser = new ArgumentParser({\n version,\n addHelp: true,\n description: 'A simple npm package to... | javascript | edit | 0 | 0 | mit | 2c74d58a4d36b1cf35ad7c7a4f6ea38de83564f8 | emazzotta/lighthouse-badges | lib/argparser.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n#!/usr/bin/env node\nvar yargs = require('yargs');\n\nvar argv = yargs\n .usage('Sends pino logs to AWS CloudWatch Logs.\\nUsage: node index.js | pino-cloudwatch [options]')\n .describe('aws_access_key_id', 'AWS Access Key ID')\n .de... | javascript | edit | 0 | 0 | mit | 17db477c32955006c685bc70e663e230a8b44765 | dbhowell/pino-cloudwatch | bin/pino-cloudwatch.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n// Place all the behaviors and hooks related to the matching controller here.\n// All this logic will automatically be available in application.js.\n$(document).ready(function() {\n\n // localize times\n $('.localize').each(functi... | javascript | edit | 0 | 1 | mit | 9dc6b680d66b8352835b5808e2c12ac0abd20c77 | robyparr/adjourn,robyparr/adjourn,robyparr/adjourn | app/assets/javascripts/meetings.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nimport * as React from \"react\";\nimport { Navigation } from \"./Navigation\";\n\n/**\n * Main Navigation Component\n */\nexport const Header = () => {\n const TITLE = \"LLVM Build View\";\n\n return (\n <header>\n <Wrapper>\... | javascript | edit | 0 | 1 | apache-2.0 | 502e4687022985f00533d1c435e2f1b1ff4ab561 | googleinterns/step240-2020,googleinterns/step240-2020,googleinterns/step240-2020,googleinterns/step240-2020 | src/main/webapp/components/Header.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n'use strict';\n\nmodule.exports = {\n entry: './src/index.ts',\n output: { filename: 'dist/index.js' },\n module: {\n rules: [\n {\n test: /\\.tsx?$/,\n loader: 'ts-loader'\n ... | javascript | edit | 0 | 0 | mit | 767f796829702d79cb76ef5d9673d89d2d7cf107 | TypeStrong/ts-loader,TypeStrong/ts-loader,MortenHoustonLudvigsen/ts-loader,jbrantly/ts-loader,MortenHoustonLudvigsen/ts-loader,gsteacy/ts-loader,MortenHoustonLudvigsen/ts-loader,gsteacy/ts-loader,jbrantly/ts-loader,gsteacy/ts-loader,jbrantly/ts-loader | examples/vanilla/webpack.config.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nimport Ember from 'ember';\nimport uuid from 'ember-cli-uuid/utils/uuid-helpers';\n\nexport default {\n\n name: 'ember-cli-uuid',\n\n initialize: function () {\n\n console.log('uuid: ', uuid);\n DS.RESTAdapter.reopen({\n\n ... | javascript | edit | 0 | 1 | mit | 5d49914f839331357ee9710b2bff36ea4d020d7d | thaume/ember-cli-uuid,thaume/ember-cli-uuid | app/initializers/ember-cli-uuid.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n// Using regex instead of simply using 'host' because it causes error with security on Government browsers (IE9 so far)\nfunction getHostname(url) {\n var m = url.match(/^http(s?):\\/\\/[^/]+/);\n return m ? m[0] : null;\n}\n\nfun... | javascript | edit | 0 | 5 | mit | 4a8534ec77faeb3ac8135fac661b8034fdf0c7bb | ONSdigital/babbage,ONSdigital/babbage,ONSdigital/babbage,ONSdigital/babbage | src/main/web/js/app/external-link.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n// import Platform from 'objects/platform';\nimport { ASSETS } from 'constants';\nimport Bullet from 'objects/bullet';\n\nexport default class Player extends Phaser.Sprite {\n constructor(game, x, y) {\n const { world } = game;\n\n ... | javascript | edit | 0 | 2 | mit | 47681a372c616cb0c3c4c76bc79dd21c6f847bb7 | oliverbenns/cga-jam,oliverbenns/cga-jam,oliverbenns/cga-jam | src/objects/player.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nvar VirtualMachine = require('./virtualMachine');\n\n//define a criteria for a virtual machines search\n//inherit of all property of a virtual machine\nmodule.exports = VirtualMachine.extend({\n\t//Override the application validation, i... | javascript | edit | 0 | 0 | mit | 1896e0afebba48e6f46be4921c834febace42306 | pierr/front-end-spa,pierr/front-end-spa,KleeGroup/front-end-spa,KleeGroup/front-end-spa | app/models/virtualMachineSearch.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n(function(){\n\tif(!'Event' in window) return false;\n\n\tif(typeof window.Event === 'function') return true;\n\n\tvar result = true;\n\ttry{\n\t\tnew Event('click');\n\t}catch(e){\n\t\tresult = false;\n\t}\n\n\treturn result;\n}())\n\n... | javascript | edit | 0 | 4 | mit | f4b2ec17526db8327841f413cc77ebf7593ed28b | JakeChampion/polyfill-service,JakeChampion/polyfill-service,kdzwinel/polyfill-service,mcshaz/polyfill-service,jonathan-fielding/polyfill-service,jonathan-fielding/polyfill-service,kdzwinel/polyfill-service,kdzwinel/polyfill-service,jonathan-fielding/polyfill-service,mcshaz/polyfill-service,mcshaz/polyfill-service | polyfills/Event/detect.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n'use strict';\n\ndescribe('<%= classedName %>', function () {\n var <%= scriptAppName %>, component;\n\n beforeEach(function () {\n var container = document.createElement('div');\n container.id = 'content';\n document.body.ap... | javascript | edit | null | null | mit | d3218561b7863cc7a7905624a7638709eee10292 | andrewliebchen/generator-react-webpack,cmil/generator-react-webpack,ties/generator-react-reflux-webpack,cmil/generator-react-webpack,newtriks/generator-react-webpack,andrewliebchen/generator-react-webpack,mattludwigs/generator-react-redux-kit,adnasa/generator-react-webpack,akampjes/generator-react-webpack,react-webpack... | templates/spec/App.js | rejected_syntax | Syntax error detected by tree-sitter | false |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n'use strict';\n\nvar Database = require('dbjs')\n , defineDate = require('dbjs-ext/date-time/date');\n\nmodule.exports = function (t, a) {\n\tvar db = new Database()\n\t , toDateInTimeZone;\n\n\tdefineDate(db);\n\ttoDateInTimeZone =... | javascript | edit | 0 | 1 | mit | fb6169980efc8a0f3af5a63c017701e18070565e | egovernment/eregistrations,egovernment/eregistrations,egovernment/eregistrations | test/utils/to-date-in-time-zone.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n/* jshint devel: true */\n'use strict';\n\nxss.debug.NS = 'DEBUG';\n\n// Debug URL: debug.html?debug=level:0\nxss.debug.levelIndex = location.search.match(/debug=level:([0-9]+)$/)[1];\nif (xss.debug.levelIndex) {\n document.addEventL... | javascript | edit | 0 | 2 | mit | 7e4244676bacc96b4726796784108c4a461b22ad | blaise-io/xssnake,blaise-io/xssnake | client/js/debug/level.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n// Auto-expand the accordion and jump to the target if url contains a valid hash\n(function(doc){\n \"use strict\";\n\n $(function(){\n var $section, hash = window.location.hash;\n if(hash){\n $section = $... | javascript | edit | 0 | 2 | bsd-2-clause | d0e6353434fe7d47462c43a17a48723835e5a5ae | refreshoxford/django-cbv-inspector,refreshoxford/django-cbv-inspector,refreshoxford/django-cbv-inspector,refreshoxford/django-cbv-inspector | cbv/static/permalinks.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nvar util = require('util');\nvar _ = require('underscore');\nvar EventEmitter = require('events').EventEmitter;\n\n/**\n * @param {String} app\n * @param {String} env\n * @param {String} task\n * @param {Object.<String, String>} [taskVa... | javascript | edit | 0 | 2 | mit | 7b2fd31edc314c695f5049130a1da4bdb3ce12a5 | cargomedia/pulsar-rest-api-client-node,vogdb/pulsar-rest-api-client-node | src/job.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n// Copyright (c) 2017 The Regents of the University of Michigan.\n// All Rights Reserved. Licensed according to the terms of the Revised\n// BSD License. See LICENSE.txt for details.\n\nmodule.exports = function(landscape) {\n let acti... | javascript | edit | 0 | 3 | bsd-3-clause | aaaa280dd57278a3a2d4c316397105ff79418c68 | daaang/awful-mess | lib/mock/duration.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nimport {formatSize} from '../../../core/src/common/utils';\nimport log from '../../../core/src/common/log';\n\nconst BLOB_SIZE_LIMIT = 10 * 1024 * 1024; // 10 MB\n\nexport function fetchURL(url) {\n log.info(`Fetching data from \"${url... | javascript | edit | 0 | 3 | mit | c46eed27db65b4fa8495291a80ef4be56d344696 | jpikl/cfxnes,jpikl/cfxnes | lib/src/data/load.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n(function () {\n 'use strict';\n window.scrollTo(0, document.body.scrollHeight);\n var likeElements = document.querySelectorAll(\".coreSpriteHeartOpen\");\n var likeCount = 0;\n var nextTime = 1000;\n\n function doLike... | javascript | edit | 0 | 2 | apache-2.0 | f38a954ba98b2a71dda1ed34bcbfb2cc46232423 | AxelMonroyX/botLikes | likeInstagramFeed.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nconst updateComment = (body, commentArr = []) => {\n body = body.map((obj, index, array) => {\n if (obj.type === 'Line' || obj.type === 'Block') {\n if (array[index + 1].type === 'Line' || array[index + 1].type === 'Block') {\n... | javascript | edit | 0 | 6 | mit | 6cdd42dba8b156d1892aa166177d2c49a542be14 | cleanlang/clean,cleanlang/clean,cleanlang/clean | lib/updateComment.js | accepted | null | true |
[
{
"role": "user",
"content": "Write javascript code for the following: Remove extra option to absoluteUrl\n\nforce-ssl already sets this option by default"
},
{
"role": "assistant",
"content": "navigate = function (hash) {\n window.location.replace(Meteor.absoluteUrl() + hash);\n};\n"
}
] | javascript | new_file | 0 | 1 | mit | 287270fa3c7e221a42f5b3c9df86dbffde6ab044 | Hansoft/meteor,Hansoft/meteor,Hansoft/meteor,Hansoft/meteor,Hansoft/meteor,Hansoft/meteor,Hansoft/meteor | client/lib/navigate.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nvar express = require('express');\n\nexports.PROXY_ERROR_CODE_TO_HTTP_CODE_MAP = {\n 'NR-1000': 400,\n 'NR-1001': 400,\n 'NR-1002': 401,\n\n 'NR-2000': 400\n};\n\nexports.getTestHttpServer = function(port, ip, callback) {\n ip = ip... | javascript | edit | 0 | 2 | apache-2.0 | e9ef00a08454eb3d6109f3c3c51f1cd51cb726b5 | racker/node-rproxy,racker/node-rproxy | lib/util/test.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nexport default function shellDirective() {\n return {\n templateUrl: 'app/layout/shell.html',\n restrict: 'EA',\n transclude: true,\n scope: true,\n controller: 'ShellController',\n controllerAs: 'vm'\n };\n}\n\n\n``... | javascript | edit | 0 | 1 | mit | 4d764b92798d254a70023f427c745beaa52e2d0b | tekerson/ng-bookmarks,tekerson/ng-bookmarks | src/app/layout/shell.directive.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n{\n angular.module('meganote.notesForm')\n .controller('NotesFormController', NotesFormController);\n\n NotesFormController.$inject = ['$state', 'Flash', 'NotesService'];\n function NotesFormController($state, Flash, NotesService)... | javascript | edit | 0 | 2 | mit | e6e8849a1f8b3ee60f7e595bd71cdc53194a307c | xternbootcamp16/meganote,xternbootcamp16/meganote | app/notes/notes-form/notes-form.controller.js | rejected_duplicate | Near-duplicate of sample 79761 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n(function (module) {\n module.controller('projectViewProcess', projectViewProcess);\n projectViewProcess.$inject = [\"$state\", \"process\"];\n\n function projectViewProcess($state, process) {\n var ctrl = this;\n ... | javascript | edit | 0 | 1 | mit | b0a2163a3f598724907359c7b5190c96afe51393 | materials-commons/materialscommons.org,materials-commons/materialscommons.org,materials-commons/materialscommons.org,materials-commons/materialscommons.org,materials-commons/materialscommons.org | website/app/application/core/projects/project/processes/process-view-controller.js | rejected_duplicate | Near-duplicate of sample 71138 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nimport Publication from 'common/modules/Publication/pages/Publication/Publication'\nimport Organization from 'common/modules/Publication/pages/Organization/Organization'\nimport PublishingDatasets from 'common/modules/Publication/pages/... | javascript | edit | 0 | 1 | mit | 75c31652c76d58aef83a2cfd1cdbcd446abb2380 | sgmap/inspire,sgmap/inspire | src/routes/Publication/index.js | accepted | null | true |
[
{
"role": "user",
"content": "Write javascript code for the following: Disable TAPi18next cookie feature that caused anomalies"
},
{
"role": "assistant",
"content": "TAPi18next.init({resStore: {}, fallbackLng: globals.fallback_language, useCookie: false});\n"
}
] | javascript | new_file | 0 | 0 | mit | dc67381059f21dc620a9286cd8ea18d4129d2833 | TAPevents/tap-i18n,glyphing/tap-i18n,TAPevents/tap-i18n,phowat/tap-i18n,glyphing/tap-i18n,phowat/tap-i18n,glyphing/tap-i18n,TAPevents/tap-i18n,phowat/tap-i18n | lib/tap_i18next/tap_i18next_init.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nimport WebSocketClient from 'websocket.js';\nimport config from '../config';\nimport createQueryString from './createQueryString';\nimport { User } from 'app/actions/ActionTypes';\n\nexport default function createWebSocketMiddleware() {... | javascript | edit | 0 | 5 | mit | 3a31a49eda82c7eb1f41e64b60f4f5e98b2b2113 | webkom/lego-webapp,webkom/lego-webapp,webkom/lego-webapp | app/utils/websockets.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n\nvar moment = require('moment');\n\n// note that month indices are zero-based\n\nmodule.exports.DATA_START_YEAR = 2012;\nmodule.exports.DATA_START_MONTH = 0;\n\nmodule.exports.DATA_END_YEAR = 2015;\nmodule.exports.DATA_END_MONTH = 10;\... | javascript | edit | 0 | 0 | mit | 41aeec2d840fd530ff07440d0161baaf08098861 | lucified/lucify-asylum-countries,lucified/lucify-asylum-countries,lucified/lucify-asylum-countries,lucified/lucify-asylum-countries | src/js/model/refugee-constants.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n/*!\n * Generator-Gnar Gruntfile\n * http://gnarmedia.com\n * @author Adam Murphy\n */\n\n// Generated on <%= (new Date).toISOString().split('T')[0] %> using <%= pkg.name %> <%= pkg.version %>\n\n'use strict';\n\n/**\n * Grunt module\n ... | javascript | edit | null | null | mit | 39c902c39ad446e8549ec253647d77fae1f27cc3 | gnarmedia/gnenerator-gnar | app/templates/Gruntfile.js | rejected_syntax | Syntax error detected by tree-sitter | false |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n// Copyright © 2015-2017 Esko Luontola\n// This software is released under the Apache License 2.0.\n// The license text is at http://www.apache.org/licenses/LICENSE-2.0\n\n/* @flow */\n\nimport combineReducers from \"redux/es/combineRed... | javascript | edit | null | null | apache-2.0 | 16c1e7f7fd59789d20ebe4d00675e8ebcd356dab | orfjackal/territory-bro,orfjackal/territory-bro,orfjackal/territory-bro | web/js/reducers.js | rejected_syntax | Syntax error detected by tree-sitter | false |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nvar fs = require('fs');\n\n\nfunction createDir(directory) {\n if (!fs.existsSync(directory)){\n fs.mkdirSync(directory, 0766, function(err){\n if(err) console.log(err);\n });\n }\n}\n\nfunction createFile(filename, c... | javascript | edit | 0 | 3 | mit | c6d4ba9d67c3649fbfa071f29a383814f6b12524 | at1as/Website-Diff | setup.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nlet Promise = require('bluebird');\nlet fnArgs = require('fn-args');\n\nlet dict = {};\n\nmodule.exports = () => {\n let di = {\n value: (name, val) => {\n dict[name] = {\n type: 'value',\n x: val\n };\n ... | javascript | edit | 0 | 6 | mit | 5cfcfb77f47f6c7b981af4a70ded14023300fe5d | dhjohn0/express-yourself,dhjohn0/express-yourself | lib/di.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nvar assert = require('chai').assert;\nvar convert = require('../../browser');\n\nvar data = require('../data');\nvar formats = data.formats;\nvar tests = data.tests;\n\ndescribe('client-side', function() {\n tests.forEach(function(test... | javascript | edit | 0 | 2 | mit | 8f42ebe887e9e823f03e2d0bc6f6105b87e2c113 | thomsbg/convert-rich-text,thomsbg/convert-rich-text | test/client/client.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n#! /usr/bin/env node\n\n// __ _____ _____ _____ _____ _____\n// | | | | | | __ | __| __ |\n// | |__| | | | | | __ -| __| -|\n// |_____|_____|_|_|_|_____|_____|__|__|\n\nconst program = require('comman... | javascript | edit | 0 | 0 | mit | 1476d59ac9030ef9c417de678c78771f5785d16c | ForestAdmin/lumber | lumber.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nconst { User } = require('./../models');\n\nconst getUser = (req, res) => {\n User.fetch({ facebook_id: req.query.facebook_id })\n .then(fetchedUser => {\n res.status(200).json(fetchedUser);\n })\n .catch(err => {\n ... | javascript | edit | 0 | 2 | mit | 6b5e7506ed3c8b3c1a455adf88bbb29d655321a3 | gobble43/gobble-db | src/controllers/UserController.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nimport Firebase from 'firebase';\nimport config from 'config';\n\nexport function firebaseInit() {\n // Authenticate with Firebase\n const ref = new Firebase(config.get('firebase.path'));\n ref.authWithCustomToken(config.get('firebas... | javascript | edit | 0 | 2 | mit | a2ce854b67d556b5d61500b0371ff049b78740d8 | apazzolini/andreazzolini.com,apazzolini/andreazzolini.com | src/utils/firebase.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n/**\n * <%= name %>\n *\n * Makes bla bla.\n *\n * @version 0.0.0\n * @requires jQuery\n * @author <%= authorName %>\n * @copyright <%= (new Date).getFullYear() %> <%= authorName %>, <%= authorUrl %>\n * @license MIT\n */\n\n/*jshint br... | javascript | edit | null | null | mit | 97597e00b5f2a105a201dd283a07986bd073f9ce | tamiadev/generator-tamia,tamiadev/generator-tamia,tamiadev/generator-tamia | templates/jqplugin.js | rejected_syntax | Syntax error detected by tree-sitter | false |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nexport default class WaterfallError extends Error {\n get results() {\n return this._results;\n }\n\n set results(results) {\n if (this._results == null) {\n this._results = results;\n }\n\n ... | javascript | edit | 0 | 1 | mit | 5bc1a9c802d74c7a5bfa31c5543f87b5d6df7c94 | jgornick/asyncp | src/waterfallError.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n/*\n* Application root\n* */\n\nimport React from 'react';\n\nconst AppRoot = props => {\n\treturn (\n\t\t<div className=\"application\">\n\n\t\t</div>\n\t);\n};\n\nexport default AppRoot;\n```\n\nApply this change: Add image to example... | javascript | edit | 0 | 1 | mit | 2fdd2802ef12e1e0fe339f36fc95d14b7128fe9f | dashukin/react-redux-template,dashukin/react-redux-template | src/scenes/AppRoot/presenter.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n\nnum=0; \nfunction createDiv(fil) { \n obj=fil.form; \n tab = document.createElement('div');\n tab.id = 'calendario';\n tab.style.padding = \"1px\";\n tab.style.border = \"1px solid red\";\n tab.style.background = \"blue\";\n ob... | javascript | edit | 0 | 1 | bsd-3-clause | 58e66a7a78480e754336b7de24fa83b6a249eaa8 | LuciaPerez/PUWI,LuciaPerez/PUWI,LuciaPerez/PUWI | view/js/scripts.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n/**\n * Simple pluralizer\n */\nHandlebars.registerHelper('pluralize', function(n, thing) {\n if (n === 1) {\n return '1 ' + thing;\n } else {\n return n + ' ' + thing + 's';\n }\n});\n\n/**\n * Turn titles into CSS classes\n *... | javascript | edit | 0 | 4 | mit | b1cfd2280111c2056e8504522bdcbe29a6269be8 | scimusmn/sd-waw,scimusmn/sd-waw | client/helpers/handlebars.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nmodule.exports = (router) => {\n // router is props.history from a component served by react router\n let cookies = {};\n for (let cookie of document.cookie.split(';')) {\n let c = cookie.trim().split('=');\n cookies[c[0]] = c[... | javascript | edit | 0 | 4 | mit | b27adba988be1216a3cf4eb88b044306b62b4228 | SentinelsOfMagic/SentinelsOfMagic | client/src/lib/clientAuth.js | rejected_duplicate | Near-duplicate of sample 87490 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nvar assert, desktopCapturer;\n\nassert = require('assert');\n\ndesktopCapturer = require('electron').desktopCapturer;\n\ndescribe('desktopCapturer', function() {\n return it('should return a non-empty array of sources', function(done) ... | javascript | edit | 0 | 1 | mit | fb3ab9e1f1f32bdbd40c8bce56a3818a0c311cfe | deed02392/electron,bbondy/electron,astoilkov/electron,jhen0409/electron,brenca/electron,shiftkey/electron,posix4e/electron,dongjoon-hyun/electron,gabriel/electron,renaesop/electron,rreimann/electron,Floato/electron,wan-qy/electron,shiftkey/electron,bpasero/electron,joaomoreno/atom-shell,stevekinney/electron,aichingm/el... | spec/api-desktop-capturer-spec.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nconst ColorPicker = require(\"./components/ColorPicker\");\n\n\nmodule.exports = ColorPicker;\n\n```\n\nApply this change: Add link to color picker original project"
},
{
"role": "assistant",
"content": "const ColorPicker = ... | javascript | edit | 0 | 0 | apache-2.0 | 133394c011364a252a706b59b4f3f369922169e3 | FrantisekGazo/PCA-Viewer,FrantisekGazo/PCA-Viewer | src/ui/components/ColorPicker/index.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nmodule.exports = function(grunt) {\n\n // Project configuration.\n grunt.initConfig({\n pkg: grunt.file.readJSON('package.json'),\n jshint: {\n build: ['Gruntfile.js', 'src/**/*.js']\n },\n watch: {\n scripts: {\... | javascript | edit | 0 | 1 | mit | 4f9c18ad8c3c2a974c7bd812a9e211b589fd4bbd | byanofsky/playa-vista-neighborhood,byanofsky/playa-vista-neighborhood,byanofsky/playa-vista-neighborhood | Gruntfile.js | rejected_duplicate | Near-duplicate of sample 75638 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nBustinBash.Directory.View = function() {}\n\nBustinBash.Directory.View.prototype = {\n\n\thideAndShowDOM: function(data) {\n\t\t$(data.Hide).hide();\n\t\t$(data.Show).show();\n\t\tthis.clearDom();\n\t},\n\n\tclearDom: function() {\n\t\t... | javascript | edit | 0 | 2 | mit | 1b3957d61e8f99a78aa640bd7b8861d3e591c09d | BustinBash/bustinbash.github.io,BustinBash/BustinBash | javascripts/directory/directory.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nmodule.exports = function (grunt) {\n var standaloneFiles = [\n 'bower_components/sockjs-client/dist/sockjs.min.js',\n 'bower_components/stomp-websocket/lib/stomp.min.js',\n 'src/ng-stomp.js'\n ]\n\n grunt.initConfig({\n ... | javascript | edit | 0 | 1 | mit | e409839be5d1173fb8203da3eec8b21c8f93e0d8 | beevelop/ng-stomp | Gruntfile.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n/*\n * grunt-contrib-watch\n * http://gruntjs.com/\n *\n * Copyright (c) 2013 \"Cowboy\" Ben Alman, contributors\n * Licensed under the MIT license.\n */\n\n'use strict';\n\nmodule.exports = function(grunt) {\n grunt.initConfig({\n ... | javascript | edit | 0 | 2 | mit | 467e1990ab2d63ae5816a8e2fa0408fbf4f23153 | chemoish/grunt-contrib-watch,AlexJeng/grunt-contrib-watch,testcodefresh/grunt-contrib-watch,gruntjs/grunt-contrib-watch,Rebzie/grunt-contrib-watch,JimRobs/grunt-chokidar,whisklabs/grunt-contrib-watch,yuhualingfeng/grunt-contrib-watch,Ariel-Isaacm/grunt-contrib-watch,mobify/grunt-contrib-watch,eddiemonge/grunt-contrib-w... | Gruntfile.js | rejected_duplicate | Near-duplicate of sample 85468 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n// modules\nvar assert = require('assert')\nvar _ = require('underscore')\nvar fs = require('fs');\nvar S = require('string');\nvar passmarked = require('passmarked');\nvar pluginFunc = require('../li... | javascript | edit | 0 | 4 | apache-2.0 | 8c73221a2ecf53c4e72d43fd3b2e0421dbb342f3 | passmarked/css | test/lint.prettify.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\ndefine(['backbone', 'handlebars', 'views/row', 'text!../../../src/templates/datagrid.hbs'], function(Backbone, Handlebars, Row, datagridTemplate) {\n\n var Datagrid = Backbone.View.extend({\n initialize: function() {\n this.col... | javascript | edit | 0 | 2 | mit | 6b74a6d656fe61f7730d4b8994d2f53c5d9211ac | loicfrering/backbone.datagrid | src/views/datagrid.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nconst rules = require('./index').rules;\nconst RuleTester = require('eslint').RuleTester;\nconst ruleTester = new RuleTester();\n\nruleTester.run('no-only-tests', rules['no-only-tests'], {\n valid: [\n {code: 'describe(\"Some descri... | javascript | edit | 0 | 0 | mit | 467657ff4c0fcd52f2c8d83ef99c0a927c635ef6 | levibuzolic/eslint-plugin-no-only-tests | tests.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nimport {GroupMark} from '../marks/marktypes';\n\nexport default function(role, style, name, dataRef, interactive, encode, marks) {\n return {\n type: GroupMark,\n name: name,\n role: role,\n style: style,\n from: dataRef... | javascript | edit | 0 | 2 | bsd-3-clause | 5081372fd76f3396fac83f34bda8190b048e0566 | vega/vega,vega/vega,vega/vega,vega/vega,lgrammel/vega | packages/vega-parser/src/parsers/guides/guide-group.js | rejected_duplicate | Near-duplicate of sample 78771 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nvar http = require('http');\nvar phantom=require('node-phantom-simple');\n\nhttp.createServer(function (req, res) {\n phantom.create(function(err,ph) {\n return ph.createPage(function(err, page) {\n return page.open(req.url.sli... | javascript | edit | 0 | 1 | mit | aab260ab6dc15fe3b39dd5a29ea6fa9bd57decba | weld-io/screenshooter | shoot.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nvar util = require('util')\n , twitter = require('twitter')\n , Stream = require('stream')\n , repl = require('repl')\n , keys = require('./keys')\n , local = repl.start()\n , first = true\n\nlocal.context.repl = local\nlocal.defi... | javascript | edit | 0 | 2 | mit | 6fa08345946bcf8052931053697869626441b1c4 | gkatsev/twish | twish.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n'use strict';\n\n\nconst http = require('http');\n\nconst { host, port } = require('../../../config');\nconst { addStopFunctions } = require('./stop');\n\n\n// Start HTTP server\nconst startServer = function ({\n serverState: { handleR... | javascript | edit | 0 | 1 | apache-2.0 | 4b40b408e65c290bc8ad744900679b18c09d8a2f | autoserver-org/autoserver,autoserver-org/autoserver | src/server/protocols/http/start.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nconst fs = require('fs')\nconst Twit = require('twit')\nconst config = require('./config')\n\nconst quotes = JSON.parse(fs.readFileSync('./data/backup-2016-11-03.json', 'utf8'))\nconst T = new Twit(config.oauth_creds)\n\nfunction random... | javascript | edit | 0 | 2 | mit | 965cda3443193e8dfaaf9132af38d98bc523b28f | ntalbs/tweetbot-js,ntalbs/tweetbot-js | tweet.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nvar five = require(\"../lib/johnny-five.js\"),\n board, photoresistor;\n\nboard = new five.Board();\n\nboard.on(\"ready\", function() {\n\n // Create a new `photoresistor` hardware instance.\n photoresistor = new five.Sensor({\n ... | javascript | edit | 0 | 1 | mit | 1bc439d42e0352f7cb2f6c153cafc45f874bb7ae | kod3r/johnny-five,cumbreras/rv,joelunmsm2003/arduino,garrows/johnny-five,kod3r/johnny-five,AnnaGerber/johnny-five | eg/photoresistor.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nconst nearley = require('nearley');\nconst grammar = require('./grammar/grammar');\nconst parser = new nearley.Parser(nearley.Grammar.fromCompiled(grammar));\n\nmodule.exports = function parse(input) {\n return parser.feed(input);\n}\n... | javascript | edit | 0 | 1 | mit | 4865ba39496d72c951e783cebdfd00cc4ce571b4 | kittikjs/kittik | packages/kittik-parser/src/index.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nconst chokidar = require('chokidar')\nconst compile = require('./compiler').run\n\nmodule.exports = function () {\n const watcher = chokidar.watch(process.cwd(), {\n ignored: /dist|layouts|.DS_Store/\n })\n\n console.log('Watching... | javascript | edit | 0 | 2 | mit | 7bc64c9528715065c2b6318c32666b7f596e963b | leo/cory,leo/cory | lib/watch.js | accepted | null | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.