messages listlengths 2 2 | language stringclasses 8
values | prompt_type stringclasses 2
values | lint_errors int64 0 129 ⌀ | cyclomatic_complexity int64 0 32 ⌀ | license stringclasses 7
values | commit stringlengths 40 40 | repos stringlengths 5 116k | new_file stringlengths 4 220 | status stringclasses 6
values | error stringlengths 26 74 ⌀ | is_valid_syntax bool 2
classes |
|---|---|---|---|---|---|---|---|---|---|---|---|
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n'use strict';\n\nvar config = require('../');\nvar stylelint = require('stylelint');\n\nfunction isObject(obj) {\n return typeof obj === 'object' && obj !== null;\n}\n\nit('test basic properties of config', function() {\n expect(isObj... | javascript | edit | 0 | 1 | mit | 1f397803e9fc087d3a32a926085e0ee4f54a238b | jamieconnolly/stylelint-config | __tests__/index.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nvar _ = require('lodash');\n\nvar resources = require('../dummy/resources');\n\nvar DummyResource = resources.DummyResource;\n\n\nvar DummyConfigResource = DummyResource.extend(function(self, name, store) {\n /**class:DummyConfigReso... | javascript | edit | 0 | 2 | bsd-3-clause | 9136a9a255866cba0cd56ed4e9ba7796bd8f457e | GeekFreaker/vumi-jssandbox-toolkit,GeekFreaker/vumi-jssandbox-toolkit | lib/config/dummy.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n\"use strict\";\n\nvar Sphero = require(\"./lib/sphero\");\n\n/**\n * Creates a new Sphero instance with the provided options.\n *\n * @param {String} address port/UUID/address of the connected Sphero\n * @param {Object} [opts] options ... | javascript | edit | 0 | 1 | mit | 743df117400b78ffea8739f0bd2454cff8ff970f | olcar/sphero.js,orbotix/sphero.js,vincent-leonardo/sphero.js | index.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nvar gcEmitter,\n\tutil = require('util'),\n\tgcstats = require('./build/Release/gcstats'),\n\tEventEmitter = require('events').EventEmitter;\n\nfunction GCStats() {\n\tif(!gcEmitter) {\n\t\tgcEmitter = new EventEmitter();\n\t\tgcstats.a... | javascript | edit | 0 | 3 | unlicense | 5f0d9478db69df2096110d43b3a71de4dcb7264b | dainis/node-gcstats,dainis/node-gcstats,dainis/node-gcstats | index.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n#!/usr/bin/env node\n\n\"use strict\";\n\nconst moment = require(\"moment\");\nconst sugar = require(\"sugar\");\nconst chalk = require(\"chalk\");\nconst exec = require(\"child_process\").exec;\n\nlet fatal = err => {\n console.erro... | javascript | edit | 0 | 2 | mit | 102871779f192382eff3cd1c85056edf13899d2f | sam3d/git-date | index.js | rejected_duplicate | Near-duplicate of sample 71518 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nTemplate.nav.onRendered(function() {\n this.$('.button-collapse').sideNav({\n closeOnClick: true\n });\n});\n\nTemplate.nav.events({\n 'click .logout': function(e){\n e.preventDefault();\n Meteor.logout(function(){\n sA... | javascript | edit | 0 | 1 | mit | d42101f737d8a95fb85515741df188509821beb9 | mtr-cherish/cherish,mtr-cherish/cherish | client/templates/app/nav/nav.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nimport React from 'react';\n\nconst styles = {\n display: 'table-cell',\n boxSizing: 'border-box',\n verticalAlign: 'top',\n height: 21,\n width: '100%',\n outline: 'none',\n border: '1px solid #ececec',\n fontSize: '12px',\n c... | javascript | edit | 0 | 2 | mit | 18e991b70114a9a3920bf169a7261ff45aa84ccc | storybooks/storybook,storybooks/react-storybook,storybooks/storybook,storybooks/react-storybook,rhalff/storybook,rhalff/storybook,storybooks/react-storybook,storybooks/react-storybook,enjoylife/storybook,storybooks/storybook,nfl/react-storybook,rhalff/storybook,bigassdragon/storybook,shilman/storybook,enjoylife/storybo... | src/components/types/Boolean.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n'use strict'\n\n\nmodule.exports = function (filename, encoding) {\n var filename = filename || '.env'\n var encoding = encoding || 'utf8'\n}\n\n```\n\nApply this change: Remove the unnecessary variable declarations."
},
{
"ro... | javascript | edit | 0 | 3 | mit | db8a9f3d6660ff44e9783548a76d173002aeb4db | rhberro/thenv | index.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n/**\n * The default controller for your page structure.\n */\nvar turnpike = require('turnpike');\nvar util = require('util');\nvar _ = turnpike.imports.underscore;\n\n/**\n * Controller that composes page elements and prepar... | javascript | edit | 0 | 1 | mit | 0c9a17d64e9a166350c0829cb3098cdec3bb17e1 | jay-depot/turnpike,jay-depot/turnpike | bin/skeletons/project/application/controllers/Page.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nmodule.exports = function (dest, src) {\n Object.getOwnPropertyNames(src).forEach(function (name) {\n var descriptor = Object.getOwnPropertyDescriptor(src, name)\n Object.defineProperty(dest, name, descriptor)\n })\n\n return d... | javascript | edit | 0 | 1 | mit | 35e6d5cf29edeab3f4d3ac47a445c15c369203fa | nooks/merge-descriptors,component/merge-descriptors | index.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n/**\n * Presets of sentenceSeparator, clauseRegExp, wordRegExp, wordBoundaryRegExp, abbrRegExp\n * for each languages.\n */\n\nexport default {\n en: {\n sentenceSeparator: /\\n/g,\n clauseRegExp: /[^,:\"?!.]+/g,\n wordRegExp:... | javascript | edit | 0 | 0 | mit | b3f773b67b0c83244371e1ddb0a54bc66423f31c | nodaguti/word-quiz-generator | src/constants/regexp-presets.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nvar rimraf = require('rimraf')\n\nfunction removeSync (dir) {\n return rimraf.sync(dir)\n}\n\nfunction remove (dir, callback) {\n return callback ? rimraf(dir, callback) : rimraf(dir, function () {})\n}\n\nmodule.exports = {\n remove... | javascript | edit | 0 | 2 | mit | 1f49d10f18d98142dfcf2494576f455b315c5675 | jprichardson/node-fs-extra | lib/remove/index.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nimport { Iterable, fromJS } from 'immutable';\n\nconst defaultArgs = {\n initialState: {}\n};\n\n/**\n * Create reducer\n * @description Shorthand function to create a new reducer. By default, always returns the state\n * in case it wa... | javascript | edit | 0 | 3 | mit | 8f690b01072a62f3190e878bf4b8e2e0177f2806 | kettanaito/redux-dynamics,kettanaito/redux-dynamics | src/createReducer.js | rejected_duplicate | Near-duplicate of sample 79158 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nmodule.exports = function(session, options) { \n function testBrowser(name, version) {\n var config = {\n 'browserName': name,\n 'tunnel-identifier': process.env.TRAVIS_JOB_NUMBER || 'test',\n ... | javascript | edit | 0 | 3 | mit | 9bed90c02351d7b59d471c9cd5952605d4e6355c | rubenv/open-sauce-browsers | index.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nimport Monospaced from './Monospaced';\nimport { textFactory } from './Text';\n\nconst Heading1 = textFactory('heading', 'heading-1', 'h1');\nconst Heading2 = textFactory('heading', 'heading-2', 'h2');\nconst Heading3 = textFactory('hea... | javascript | edit | 0 | 0 | mit | ff49cc4866fde198352585b09474e1429c3b0616 | teamleadercrm/teamleader-ui | src/components/typography/index.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nvar webpack = require('webpack');\n\nmodule.exports = function(grunt) {\n require('load-grunt-tasks')(grunt);\n\n grunt.initConfig({\n secret: grunt.file.readJSON('secret.json'),\n\n clean: {\n build: ['build/']\n },\n\n... | javascript | edit | 0 | 1 | mit | 33b1fc1f078a1f31e0116141afc7f9507e0c23fb | thomasboyt/bipp,thomasboyt/bipp | Gruntfile.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n\r\n// ----------------------------------------------------------------\r\n// Content Class\r\n\r\nclass Content {\r\n \r\n}\r\n\n```\n\nApply this change: Add some .class in Content"
},
{
"role": "assistant",
"content": "\... | javascript | edit | 0 | 1 | mit | c9dc6f4ad64d62ada649357aff4dbcddd989f8e1 | AyaNakazawa/business_card_bank,AyaNakazawa/business_card_bank,AyaNakazawa/business_card_bank | js/mylib/content.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nmodule.exports = function(grunt) {\n\trequire(\"time-grunt\")(grunt);\n\tgrunt.initConfig({\n\t\tpkg: grunt.file.readJSON(\"package.json\"),\n\t\teslint: {\n\t\t\toptions: {\n\t\t\t\tconfigFile: \".eslintrc.json\"\n\t\t\t},\n\t\t\ttarge... | javascript | edit | 0 | 1 | mit | c76f2c8483b3f9fee80f020927d086f9a2087d71 | berlincount/MagicMirror,enith2478/spegel,soapdx/MagicMirror,berlincount/MagicMirror,cmwalshWVU/smartMirror,ShivamShrivastava/Smart-Mirror,jamessalvatore/MagicMirror,n8many/MagicMirror,vyazadji/MagicMirror,kthorri/MagicMirror,Leniox/MagicMirror,huntersiniard/MagicMirror,jodybrewster/hkthon,jodybrewster/hkthon,marc-86/Ma... | Gruntfile.js | rejected_duplicate | Near-duplicate of sample 91284 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nexport default function(state, ctx, model, helpers) {\n\n\tconst ConcretizeIfNative = helpers.ConcretizeIfNative;\n\n\t//TODO: Test IsNative for apply, bind & call\n\tmodel.add(Function.prototype.apply, ConcretizeIfNative(Function.proto... | javascript | edit | 0 | 2 | mit | 0239d05fe031f8c0a8899339c265e9e95019060a | ExpoSEJS/ExpoSE,ExpoSEJS/ExpoSE,ExpoSEJS/ExpoSE | Analyser/src/Models/FnModels.js | rejected_duplicate | Near-duplicate of sample 68335 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nconst Sequelize = require('sequelize');\n\nif (process.env.DATABASE_URL) {\n let db = new Sequelize(process.env.DATABASE_URL, {\n dialect: 'postgres',\n protocol: 'postgres',\n port: match[4],\n host: match[3],\n ... | javascript | edit | 0 | 0 | mit | 18d75599997f8609ce70a951ab5865b700e46af7 | Velocies/raptor-ads,Velocies/raptor-ads,Darkrender/raptor-ads,wolnewitz/raptor-ads,Darkrender/raptor-ads,wolnewitz/raptor-ads,bwuphan/raptor-ads,bwuphan/raptor-ads | database/database.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\ndocument.addEventListener(\"DOMContentLoaded\", function (event) {\n // redirect to 7777 port\n // ping golang counter\n httpGetAsync(\"http://www.aracki.me:7777\", function (res) {\n alert(res);\n })\n});\n\nfunction... | javascript | edit | 0 | 3 | mit | 4f6061a66f6be3f1722c6d49a466bccc72d71b93 | Aracki/aracki.me,Aracki/aracki.me | js/count.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n/**\n * Created by sandeshkumar on 4/5/16.\n */\nfunction flattenArray(arr) {\n if(Array.isArray(arr)) {\n //return flatIterative(arr);\n //return flatRecursive(arr, []);\n return flatFunctional(arr);\n } \n ... | javascript | edit | 0 | 4 | mit | 1f4c1e1b1449fcae255a3ca620e0eab50d7e46be | sandeshkumar07/code-kata | src/flattenArray.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nconst redux = require('redux');\nconst reducers = require('../reducers');\n\nfunction reduxStore(initialState) {\n const store = redux.createStore(reducers, initialState);\n\n if (module.hot) {\n // Enable Webpack hot module replac... | javascript | edit | 0 | 3 | mit | 01b9db5f516847b125c1915fdb221f04b0a901dc | stylesuxx/generator-react-webpack-redux,stylesuxx/generator-react-webpack-redux | generators/root/templates/store.js | accepted | null | true |
[
{
"role": "user",
"content": "Write javascript code for the following: Add event handler for inserting new Host document."
},
{
"role": "assistant",
"content": "Template.HostCreate.events({\n 'form submit' : function (e, tmpl) {\n e.preventDefault();\n\n // Define form field variables.\n ... | javascript | new_file | 0 | 3 | mit | e035da32b8eaa0ffbae713cb159da3f192166a7e | mikebarkas/syrinx,bfodeke/syrinx,steyep/syrinx,shrop/syrinx,hb5co/syrinx,shrop/syrinx,hb5co/syrinx,bfodeke/syrinx,mikebarkas/syrinx,steyep/syrinx | client/templates/hosts/host_create/host_create.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nvar path = require('path');\n\n// strip the last dir... essentially the same as __dirname/..\nvar root = path.dirname(__dirname); //.replace(/\\/[^\\/]+\\/?$/,''),\ndeploy_root = path.normalize(root + '/..');\n\nmodule.exports = {\n\t ... | javascript | edit | 0 | 0 | mit | fcc8408093f791b491eb7ca003dda93e6cb6061b | iFixit/wompt.com,Wompt/wompt.com,iFixit/wompt.com,iFixit/wompt.com,iFixit/wompt.com,Wompt/wompt.com,Wompt/wompt.com | nodejs/environment/defaults.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n// Redux\nimport { createStore, applyMiddleware, compose } from 'redux';\nimport thunk from 'redux-thunk';\n// import createLogger from 'redux-logger';\n// import Immutable from 'immutable';\nimport rootReducer from '../reducers';\n\n//... | javascript | edit | 0 | 2 | mit | 17fca5bc13a74bcbcdf16fd0399446ed4fec0f99 | armaniExchange/work-genius,armaniExchange/work-genius,armaniExchange/work-genius | src/store/configureStore.js | rejected_duplicate | Near-duplicate of sample 92834 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nvar path = require('path');\nvar webpack = require('webpack');\n\nmodule.exports = {\n entry: './main.js',\n output: {\n path: path.resolve(__dirname, 'dist'),\n filename: 'main.js'\n },\n module: {\n lo... | javascript | edit | 0 | 0 | mit | ae9faea2fa3150edc623ba3d3d77d4ccabeb4b1a | dimriou/rupture,dimriou/rupture,dimkarakostas/rupture,dionyziz/rupture,dionyziz/rupture,dimkarakostas/rupture,esarafianou/rupture,dimriou/rupture,esarafianou/rupture,esarafianou/rupture,dimriou/rupture,dionyziz/rupture,esarafianou/rupture,dionyziz/rupture,dimkarakostas/rupture,dimkarakostas/rupture,dionyziz/rupture,dim... | client/webpack.config.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nimport Service from 'ember-service';\nimport get, { getProperties } from 'ember-metal/get';\nimport set from 'ember-metal/set';\nimport computed from 'ember-computed';\nimport getOwner from 'ember-owner/get';\nimport isMobile from 'ismo... | javascript | edit | 0 | 4 | mit | e9265efb3bc208957ed37634d6b78d577d60fbab | sandydoo/ember-is-mobile,sandydoo/ember-is-mobile | addon/services/is-mobile.js | rejected_duplicate | Near-duplicate of sample 70061 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n'use strict';\n\nangular.module('visualizerApp')\n .controller('ExploreController', ['$scope', '$upload', '$location', '$http', '$timeout', '$filter', 'jsonFactory', function ($scope, $upload, $location, $http, $timeout, $filter, jsonF... | javascript | edit | 0 | 2 | mit | 990cbb2d4a88fd430d37bd6db5ecccd752550a4e | PRioritizer/PRioritizer-visualizer,PRioritizer/PRioritizer-visualizer | app/scripts/controllers/explore.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n$(document).ready(function() {\r\n var editor = ace.edit(\"json\");\r\n editor.setTheme(\"ace/theme/github\");\r\n editor.session.setMode(\"ace/mode/json\");\r\n editor.setFontSize(14);\r\n editor.$blockScrolling = \"Infi... | javascript | edit | 0 | 2 | mit | 6bcb2292d5ba241fe8a0ad2fbd51ef19bce82303 | mrvautin/adminMongo,Jeykairis/adminMongo,mrvautin/adminMongo,Jeykairis/adminMongo | public/js/editor.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n\"use strict\";\nconst gh = require(\"simple-github\");\nconst jwt = require(\"jsonwebtoken\");\n\nconst CERT = process.env.GITHUB_INTEGRATION_KEY; // get private key\nconst ID = process.env.GITHUB_INTEGRATION_ID;\nconst GH_TOKEN = pro... | javascript | edit | 0 | 3 | apache-2.0 | 9fb0a8598d1e7e948c19ebdae249c484c0d19931 | tobie/pr-preview | lib/auth.js | rejected_duplicate | Near-duplicate of sample 77063 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nimport React from 'react'\nimport {combineReducers, createStore, applyMiddleware} from 'redux'\nimport thunk from 'redux-thunk'\nimport { Provider } from 'react-redux'\nimport { render } from 'react-dom'\nimport createHistory from 'hist... | javascript | edit | 0 | 1 | mit | ed7e9a8e116428c44ee465f898ccd17e6a913480 | jho406/Relax,jho406/Relax,jho406/Relax,jho406/Breezy,jho406/Breezy,jho406/Breezy | breezy_rails/lib/install/templates/web/application.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n\"use strict\";\n\nmodule.exports = function (grunt) {\n grunt.registerTask(\"make\", [].concat([\n \"exec:version\",\n \"default\",\n \"concurrent:source\",\n \"exec:buildDebug\",\n \"exec:buildRel... | javascript | edit | 0 | 1 | mit | 6a45fff241da869f2c1369a23af339249bb6e817 | ArnaudBuchholz/gpf-js,ArnaudBuchholz/gpf-js | grunt/tasks/make.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nrequire('babel-register');\nrequire('babel-polyfill');\n\nconst Bluebird = require('bluebird');\nconst WebpackIsomorphicTools = require('webpack-isomorphic-tools');\nconst config = require('../common/config');\nconst rootDir = require('... | javascript | edit | 0 | 1 | mit | 397442c185689b0ffbc88938923275c962f8db93 | robinpokorny/este,este/este,steida/este,robinpokorny/este,skyuplam/debt_mgmt,SidhNor/este-cordova-starter-kit,estaub/my-este,este/este,sikhote/davidsinclair,syroegkin/mikora.eu,robinpokorny/este,cjk/smart-home-app,skyuplam/debt_mgmt,sikhote/davidsinclair,AugustinLF/este,christophediprima/este,este/este,christophediprim... | src/server/index.js | rejected_duplicate | Near-duplicate of sample 76244 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n'use strict';\n\nconst EasyObjectValue = require('../values/EasyObjectValue');\nconst ObjectValue = require('../values/ObjectValue');\nconst ArrayValue = require('../values/ArrayValue');\n\nclass ArrayObject extends EasyObjectValue {\n\... | javascript | edit | 0 | 4 | mit | 795d87333e81d47b4bfa6d809db539ba7a70898a | codecombat/esper.js,codecombat/esper.js,codecombat/esper.js | src/stdlib/Array.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nimport { createContainer } from 'meteor/react-meteor-data';\n\nimport { Posts, Comments } from '../../api';\nimport PostList from '../components/posts/post-list';\n\nconst PostListContainer = createContainer(() => {\n const postsSub = ... | javascript | edit | 0 | 1 | apache-2.0 | c6d10539533f06d6c9c32dbcf347545cc6e77ef9 | evancorl/portfolio,evancorl/skate-scenes,evancorl/portfolio,evancorl/skate-scenes,evancorl/portfolio,evancorl/skate-scenes | imports/client/containers/post-list.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n'use strict';\n// Define each block's generated code\n\nBlockly.JavaScript['simple_input_output'] = function(block) {\n return ['simple_input_output', Blockly.JavaScript.ORDER_ATOMIC];\n};\n\nBlockly.JavaScript['multiple_input_output']... | javascript | edit | 0 | 1 | apache-2.0 | 611755f6664209b08ab801ea86a530aacde8cca0 | rohlfingt/blockly-android,google/blockly-android,rohlfingt/blockly-android,rohlfingt/blockly-android,google/blockly-android,google/blockly-android | blocklydemo/src/main/assets/sample_sections/generators.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n\"use strict\";\n\nimport React from \"react\";\n\nimport SearchActions from \"../actions/SearchActions.js\";\n\nfunction dedupArray(arr) {\n var t = {};\n var result = [];\n arr.forEach(function(item) {\n if (t.hasOwnProperty(ite... | javascript | edit | 0 | 3 | bsd-2-clause | b0650db790588b5d5e814fab3a9422787c039334 | tchaik/tchaik,GrahamGoudeau21/tchaik,GrahamGoudeau21/tchaik,GrahamGoudeau21/tchaik,GrahamGoudeau21/tchaik,tchaik/tchaik,tchaik/tchaik,tchaik/tchaik | cmd/tchaik/ui/static/js/src/components/GroupAttributes.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n// Fill in the regular expressions\n\nverify(/ca[rt]/,\n [\"my car\", \"bad cats\"],\n [\"camper\", \"high art\"]);\n\nverify(/pr?op/,\n [\"pop culture\", \"mad props\"],\n [\"plop\"]);\n\nverify(/ferr(et|y|ari)/... | javascript | edit | 0 | 0 | mit | 05c6fa6956b7cb1bc3e671e01a860976d033d124 | bewuethr/ctci | eloquent_js/chapter09/ch09_ex01.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nimport React from 'react';\nimport { View, Button } from 'react-native';\n\n/*\nDeveloper screen.\nProvides access to components during development.\n*/\nexport default class DeveloperScreen extends React.Component {\n static navigatio... | javascript | edit | 0 | 1 | mit | b3c3c8030f59631a59e6fb756a939e5f74cbb471 | justarrived/p2p-client,justarrived/p2p-client,justarrived/p2p-client,justarrived/p2p-client | js/components/developer/developer-screen/index.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nvar gateway = require(__dirname+'/../../../../');\n\nmodule.exports = function(req, res){\n\n gateway.config.set('DOMAIN', req.body.domain);\n gateway.config.save(function(){\n res.send({ 'DOMAIN': gateway.config.get('DOMAIN') });\... | javascript | edit | 0 | 1 | isc | 44f29fca2d261d52f32a0a8d29ab819e6f0be569 | xdv/gatewayd,xdv/gatewayd,zealord/gatewayd,crazyquark/gatewayd,zealord/gatewayd,whotooktwarden/gatewayd,whotooktwarden/gatewayd,Parkjeahwan/awegeeks,crazyquark/gatewayd,Parkjeahwan/awegeeks | lib/http/controllers/api/set_domain.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nconst _ = require('lodash');\nconst router = require('express').Router();\n\nrouter.get('/cookie', (req, res) => {\n const data = JSON.stringify(req.headers);\n\n let response = '';\n response += 'HTTP/1.1 200 OK\\r\\n';\n response ... | javascript | edit | 0 | 1 | mit | 37aa5265bc137b48ca5f15de725357216c4ef7c2 | apiaryio/node-hamms | src/routes/invalidHeaders.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nif (typeof globalThis === 'undefined') {\n // define `globalThis` for IE\n self.globalThis = this;\n}\n\nself.importScripts('opal.min.js');\n\n// disable network access\nself.importScripts = null;\nself.XMLHttpRequest = null;\nself.fe... | javascript | edit | 0 | 3 | mit | 589cb891045d3ccbde9bc2508e31750781a18a41 | ionstage/modular,ionstage/modular | modular_modules/x/programming/opal/opal-worker.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nangular.module('myApp')\n.directive('googleMaps', [function () {\n return {\n controller: 'MapCtrl',\n\n link: function (scope, elem, attrs, ctrl) {\n var mapOptions,\n latitude = attrs.latitude,\n longitude = ... | javascript | edit | 0 | 1 | mit | 7bf849d7daab21ff685cddf5500a0566c15ced38 | godspeedyoo/Breeze-Mapper,godspeedyoo/Breeze-Mapper,godspeedyoo/Breeze-Mapper | app/assets/javascripts/ng-app/directives/google-maps.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nvar ResponseParser = require('../lib/responseparser'),\n\twinston = require('winston'),\n\tfs = require('fs'),\n\tpath = require('path');\n\ndescribe('responseparser', function() {\n\tvar parser = new ResponseParser({\n\t\tformat: 'xml'... | javascript | edit | 0 | 1 | isc | 060a9e30f5aaf2ebfd12f26f6a3294cd4e41c6a1 | raoulmillais/node-7digital-api,raoulmillais/7digital-api,7digital/7digital-api | spec/responseparser_spec.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n/* global Chart */\nimport Ember from 'ember';\n\nexport default Ember.Component.extend({\n tagName: 'canvas',\n attributeBindings: ['width', 'height'],\n\n didInsertElement: function(){\n var context = this.get('element');\n v... | javascript | edit | 0 | 2 | mit | 53a966876572d4da5bc8c761a3da02c241393c52 | aomran/ember-cli-chart,aomran/ember-cli-chart,aomra015/ember-cli-chart,aomra015/ember-cli-chart | addon/components/ember-chart.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nvar chai = require('chai');\nvar chaihttp = require('chai-http');\nchai.use(chaihttp);\nvar expect = chai.expect;\nvar fs = require('fs');\nvar server = require(__dirname + '/../index.js');\n\ndescribe('our NLP sever', function() {\n\n ... | javascript | edit | 0 | 2 | mit | 5c3871f15764ea7e8db3a02ae03b5ef5de03a44d | timcmiller/nlp_project,timcmiller/nlp_project | test/server_test.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n(function($) {\n $(function () {\n window.cxVariation = cxApi.chooseVariation();\n if(window.cxVariation === 1){\n var $donate = $('.sidebar__donate-cta');\n var $link = $('.sidebar__donate-cta__button', $donate);\n ... | javascript | edit | 0 | 3 | mit | f6aee1feb5f1cd4625fa565d08daaac3e797d9fe | mysociety/whatdotheyknow-theme,mysociety/whatdotheyknow-theme,mysociety/whatdotheyknow-theme | app/assets/javascripts/tests.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n/**\n * Emulates stream.setTimeout() behaviour, but respects outgoing data\n * too.\n *\n * @param {Number} timeout Milliseconds\n */\nexports.attach = function(stream, timeout) {\n var timer;\n var emitTimeout = function() {\n ... | javascript | edit | 0 | 2 | isc | 6f057dd643a3d364959a67c3f77b758e1366752a | node-xmpp/node-xmpp,eelcocramer/node-xmpp,node-xmpp/node-xmpp,qbit/node-xmpp,ggozad/node-xmpp,WeBest/node-xmpp,stliu/node-xmpp,ggozad/node-xmpp,xmppjs/xmpp.js,xmppjs/xmpp.js,tempbottle/node-xmpp,agebrock/node-xmpp,agebrock/node-xmpp,qbit/node-xmpp | lib/idle_timeout.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nconst path = require('path')\nconst presetDefault = require('pundle-preset-default')\n\nmodule.exports = {\n entry: ['./src', './index.html'],\n components: presetDefault({\n transform: {\n json5: true,\n },\n }),\n rootD... | javascript | edit | 0 | 0 | mit | 0b60469e582b89cbd682299712223eceee698521 | motion/pundle,steelbrain/pundle,steelbrain/pundle,steelbrain/pundle | packages/test-package/pundle.config.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n'use strict';\n\nvar lint = require('./_lint');\n\n//////////////////////////////\n// SCSS syntax tests\n//////////////////////////////\ndescribe('no trailing zero - scss', function () {\n var file = lint.file('no-trailing-zero.scss');... | javascript | edit | 0 | 1 | mit | 508814cf7f0f7d2fff3138916c0ecebf806f71c9 | flacerdk/sass-lint,bgriffith/sass-lint,sasstools/sass-lint,sasstools/sass-lint,DanPurdy/sass-lint,sktt/sass-lint,ngryman/sass-lint,benthemonkey/sass-lint,srowhani/sass-lint,Dru89/sass-lint,srowhani/sass-lint | tests/rules/no-trailing-zero.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nvar gulp = require('gulp'),\n htmlmin = require('gulp-htmlmin'),\n config = require('../../config');\n\ngulp.task('mini-html', function() {\n return gulp.src(config.publicDirectory+'/*.html')\n .pipe(htmlmin({\n colla... | javascript | edit | 0 | 1 | mit | 9c53e566ab571bb220e51f84a52b212cbab40194 | artisin/gulpFast,artisin/gulpFast | gulpfile.js/tasks/rev/mini-html.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n// Copyright 2014 Splunk, Inc.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\"): you may\n// not use this file except in compliance with the License. You may obtain\n// a copy of the License at\n//\n// http:/... | javascript | edit | 0 | 2 | apache-2.0 | 4ef9d0c34a119ce1e41ed06561dd2cb0bc9c9d3f | splunk/splunk-sdk-javascript,lowtalker/splunk-sdk-javascript,adamryman/splunk-sdk-javascript,adamryman/splunk-sdk-javascript,splunk/splunk-sdk-javascript,lowtalker/splunk-sdk-javascript,splunk/splunk-sdk-javascript | tests/modularinputs/utils.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nmodule.exports = function(grunt) {\n grunt.loadNpmTasks('grunt-typescript');\n grunt.loadNpmTasks('grunt-mocha-phantomjs');\n grunt.initConfig({\n typescript: {\n main: {\n src: ['src/mml2miku.t... | javascript | edit | 0 | 1 | mit | e843268c10988569efb52dc6b6f451d315761634 | algas/mml2miku,algas/mml2miku,algas/mml2miku | Gruntfile.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n/*jslint node:true */\r\n/*globals module:false */\r\n\r\n\"use strict\";\r\n\r\nmodule.exports = function (grunt) {\r\n\r\n var files = {\r\n allSource: ['Gruntfile.js', 'package.json', 'lib/**/*.js', 'test/**/*.js'],\r\n ... | javascript | edit | 0 | 1 | mit | 638511b36258e9197925c986a3881814d84b38ed | prodatakey/xbee-promise,101100/xbee-rx,101100/xbee-promise,ayan4m1/xbee-promise,temecom/xbee-promise | Gruntfile.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nimport { View } from 'react-native';\nimport Button from '../Button';\nimport React, { Component, PropTypes } from 'react';\n\nconst propTypes = {\n actions: PropTypes.array.isRequired,\n onActionPress: PropTypes.func.isRequired,\... | javascript | edit | 0 | 2 | mit | 6d46851be6bff000412266ff172f3ecb3b2d9911 | xvonabur/react-native-material-ui,blovato/sca-mobile-components,xotahal/react-native-material-ui,ajaxangular/react-native-material-ui,mobileDevNativeCross/react-native-material-ui,kenma9123/react-native-material-ui | lib/Dialog/DialogDefaultActions.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n'use strict';\n\nvar data = require('sdk/self').data;\n\n{{#if extend_ff_index}}\n{{> extend_ff_index }}\n{{/if}}\n\n{{#if homepage_url}}\nrequire(\"sdk/preferences/service\").set('browser.startup.homepage', '{{homepage_url}}');\n{{/if}... | javascript | edit | null | null | mit | 53e6e1c557792c163de6abe06c4bc09e8bb95825 | Tuguusl/grunt-browser-extension,Tuguusl/grunt-browser-extension | lib/firefox/lib/index.js | rejected_syntax | Syntax error detected by tree-sitter | false |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nvar keystone = require('keystone');\n\nvar index = require('collections-online/lib/controllers/index');\nvar search = require('collections-online/lib/controllers/search');\n\nmodule.exports = function(req, res, next) {\n if ('q' in req... | javascript | edit | 0 | 2 | mit | 08c329131953a030dc55f3aecf4384c24fef49fc | CopenhagenCityArchives/kbh-billeder,CopenhagenCityArchives/kbh-billeder,CopenhagenCityArchives/kbh-billeder | routes/frontpage.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n#!/usr/bin/env node\n\nvar rimraf = require('rimraf')\nvar fs = require('fs')\nvar childProcess = require('child_process')\nvar walkSync = require('./')\n\nrimraf.sync('benchmark.tmp')\n\nfunction createDirWithFiles(dir) {\n fs.mkdirSy... | javascript | edit | 0 | 2 | mit | f6f502a491b77b74f45a3e8aa00814bb02c419bf | joliss/node-walk-sync,joliss/node-walk-sync | benchmark.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nvar Game = Game || {};\n\n\nGame.SnakeGame = function(width, height, options) {\n 'use strict';\n this.width = width;\n this.height = height;\n this.grid = [];\n};\n\nGame.SnakeGame.prototype.update = function(inputHandler) {\n 'us... | javascript | edit | 0 | 1 | mit | 9503447b2e7eee8d8bc36b09e0079c9400be92dc | msanatan/snake,msanatan/snake,msanatan/snake | javascripts/Snake.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n/**\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @flow strict-local\n * @format\n */\n\n... | javascript | edit | null | null | mit | 771d58409858015104ddcc1073e010fd0ebb9fd9 | pandiaraj44/react-native,janicduplessis/react-native,pandiaraj44/react-native,javache/react-native,facebook/react-native,javache/react-native,facebook/react-native,janicduplessis/react-native,facebook/react-native,pandiaraj44/react-native,pandiaraj44/react-native,pandiaraj44/react-native,javache/react-native,facebook/r... | Libraries/Animated/createAnimatedComponent_EXPERIMENTAL.js | rejected_syntax | Syntax error detected by tree-sitter | false |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nimport test from 'ava'\nimport React from 'react'\nimport { mapPropsOnChange, withState, flattenProp, compose } from '../'\nimport { mount } from 'enzyme'\nimport sinon from 'sinon'\n\ntest('mapPropsOnChange maps subset of owner props t... | javascript | edit | 0 | 1 | mit | 169aa46daa3638afcbf16e20da0e3d2d99507b57 | acdlite/recompose,acdlite/recompose | src/packages/recompose/__tests__/mapPropsOnChange-test.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nimport page from 'page'\nimport { connect } from 'react-redux'\nimport React, { PropTypes } from 'react'\n\nimport {\n fetchExample,\n deleteExample,\n} from 'client/views/example-details/actions'\n\nconst con... | javascript | edit | 0 | 1 | mit | abb0fe871b05c67eaf39d0901fa4a74dc37a1cd3 | tanelih/react-starter,tanelih/react-starter | src/client/scripts/views/example-details/index.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nimport test from 'ava';\nimport sinon from 'sinon';\nimport * as actions from '../../../actions';\nimport * as constants from '../../../constants';\nimport { startPlayback } from '../startPlayback';\n\ntest('should invoke toneAdapter.st... | javascript | edit | 0 | 1 | mit | 8662dc1df34dafd39fb5ed8dc5aa33a6ec381ad0 | nickjohnson-dev/dawww | src/playbackState/effects/__tests__/startPlayback.test.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nimport Typography from 'typography';\nimport theme from 'typography-theme-ocean-beach';\n\ntheme.googleFonts.push(\n {\n name: 'M+PLUS+1p',\n styles: ['400'],\n },\n {\n name: 'Noto+Sans+JP',\n styles: ['400'],\n }\n);\n... | javascript | edit | 0 | 1 | mit | 80f88658806a75e9f99cfc9e8174da820a9ae543 | YoruNoHikage/blog,YoruNoHikage/yorunohikage.github.io,YoruNoHikage/yorunohikage.github.io | utils/typography.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nconst log = require('../lib/logger')('Media:IPC')\nconst Media = require('./Media')\nconst {\n MEDIA_ADD,\n MEDIA_CLEANUP,\n MEDIA_REMOVE,\n MEDIA_UPDATE,\n _SUCCESS,\n _ERROR,\n} = require('../../shared/actionTypes')\n\nconst ACT... | javascript | edit | 0 | 4 | isc | 0d30d3f37d72e3310b4f2668c55e77713bafae57 | bhj/karaoke-forever,bhj/karaoke-forever | server/Media/ipc.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nDrupal.behaviors.jqPlot = function(context) {\n if (Drupal.settings.jqPlot) {\n var replace = ['renderer', 'markerRenderer', 'labelRenderer', 'parseX',\n 'parseY', 'scrapeSingle', 'scrapeMultiple', 'processSeries'];\n\n $.ea... | javascript | edit | 0 | 5 | bsd-3-clause | 137327b5167c69fba071351e2bb523842defd20b | ecenter/jqplot | js/jqplot-behaviors.js | rejected_duplicate | Near-duplicate of sample 69645 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n'use strict';\n\n//socket factory that provides the socket service\nangular.module('core').factory('Socket', ['socketFactory',\n function(socketFactory) {\n return socketFactory({\n prefix: '',\n ioSocket... | javascript | edit | 0 | 1 | mit | ee5b39ba2029190631b4e17ceca8c987383ca6ed | rsdebest/pingtool,rsdebest/pingtool,rsdebest/pingtool | public/modules/core/services/socket.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n'use strict';\nvar util = require('util');\nvar path = require('path');\nvar yeoman = require('yeoman-generator');\n\n\nvar AppengineGenerator = module.exports = function AppengineGenerator(args, options, config) {\n yeoman.generators.... | javascript | edit | 0 | 1 | mit | c5a82c4ec83dc9e11562f5528a53d8b3982821df | generators/appengine | app/index.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nvar config = require('./config.json');\nvar keystone = require('keystone');\n\nkeystone.init({\n\n\t'name': 'anapi',\n\t'brand': 'anapi',\n\n\t'favicon': 'public/favicon.ico',\n\t'view engine': 'jade',\n\n\t'wysiwyg images': true,\n\t'w... | javascript | edit | 0 | 0 | mit | 0ff5643b4fa635f04cddec75591c4971a8a9d951 | promethe42/dredd,promethe42/dredd,promethe42/dredd | api/index.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n/**\n * CategoryController\n *\n * @description :: Server-side logic for managing categories\n * @help :: See http://sailsjs.org/#!/documentation/concepts/Controllers\n */\n\nvar createRecord = require('sails-json-api-blueprints/... | javascript | edit | 0 | 2 | mit | 59c59988ebbee2a028acd57eeb3cdec872d116e1 | dynamiccast/sails-json-api-blueprints | tests/dummy/api/controllers/CategoryController.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n\nvar prefork = require('../../build/Release/prefork').prefork;\n\nprefork();\n\nvar http = require('http');\n\nhttp.createServer(function (req, res) {\n res.end('I am still running');\n}).listen(9090);\n\n```\n\nApply this change: [do... | javascript | edit | 0 | 1 | mit | 79e40ec94f905eb1fb23a5daae7c3451ae0df5a3 | AvianFlu/node-prefork,AvianFlu/node-prefork,AvianFlu/node-prefork | examples/http.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nExt4.namespace('EHR.reports');\n\nEHR.reports.waterGridCalendar = function (panel, tab) {\n var filterArray = panel.getFilterArray(tab);\n debugger;\n var title = panel.getTitleSuffix();\n\n var target = tab.add({tag: 'span'... | javascript | edit | 0 | 1 | apache-2.0 | 59529eb77dde67745a8b670be49b172f6e26658c | WNPRC-EHR-Services/wnprc-modules,WNPRC-EHR-Services/wnprc-modules,WNPRC-EHR-Services/wnprc-modules,WNPRC-EHR-Services/wnprc-modules,WNPRC-EHR-Services/wnprc-modules,WNPRC-EHR-Services/wnprc-modules,WNPRC-EHR-Services/wnprc-modules | WNPRC_EHR/resources/web/wnprc_ehr/wnprcHusbandryReports.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nvar util = require('util');\nvar mongoose = require('mongoose');\nvar Grid = require('gridfs-stream')\n\nvar Datastore = function(config) {\n this._config = config;\n this._masters = config.database.masters;\n this._slaves = config.d... | javascript | edit | 0 | 2 | mit | 56cacb801b0b83c79e260cce774ff051822394c2 | martindale/maki,martindale/maki | lib/Datastore/index.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n/**\n * cbpAnimatedHeader.js v1.0.0\n * http://www.codrops.com\n *\n * Licensed under the MIT license.\n * http://www.opensource.org/licenses/mit-license.php\n *\n * Copyright 2013, Codrops\n * http://www.codrops.com\n */\nvar cbpAnimat... | javascript | edit | 0 | 2 | apache-2.0 | add480023c62bc6b62eb14883ba855c256839ef6 | zbeekman/zbeekman.github.io,zbeekman/zbeekman.github.io,CraftyClark/craftyclark.github.com,zbeekman/zbeekman.github.io,CraftyClark/craftyclark.github.io,CraftyClark/craftyclark.github.io,CraftyClark/craftyclark.github.io,CraftyClark/craftyclark.github.com,CraftyClark/craftyclark.github.com | js/cbpAnimatedHeader.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n'use strict';\n\nmodule.exports = exports = function(app) {\n\n const gt = app.utility.gettext;\n\n return {\n rights: [\n {\n special: 'annualleave',\n name: gt.gettext(\"Paid annua... | javascript | edit | 0 | 1 | mit | 28405094fbee24feb8e6ae055a8a05c3fafde450 | gadael/gadael,gadael/gadael | schema/data/uk.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n'use strict';\n\n// VARIABLES //\n\nvar SQRT1OVER8 = 0.35355339059327373; // sqrt( 1.0/8.0 )\n\n\n// MAIN //\n\n/**\n* Returns the standard deviation of an arcsine distribution.\n*\n* @param {number} a - minimum support\n* @param {numbe... | javascript | edit | 0 | 2 | apache-2.0 | bfc3b26b4f8b23800d1cc73183c16e3b932928e0 | stdlib-js/stdlib,stdlib-js/stdlib,stdlib-js/stdlib,stdlib-js/stdlib,stdlib-js/stdlib,stdlib-js/stdlib,stdlib-js/stdlib,stdlib-js/stdlib | lib/node_modules/@stdlib/math/base/dist/arcsine/stdev/lib/stdev.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nMeteor.publish('Jobs', (jobId) =>\njobId ? Jobs.find({jobId: jobId}) : Jobs.find()\n)\n\nMeteor.publish('JobsResults', (jobId, limit) =>\nJobsResults.find({jobId:jobId}, {limit: limit, sort: {createdAt:-1}})\n)\n\nMeteor.publish('JobsRe... | javascript | edit | 0 | 2 | mit | 67d1d71e7b382512319cf949e06356f8f54f020b | joseconstela/acio-js-panel,joseconstela/acio-js-panel | server/publish.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n'use strict';\n\n<%= angularAppName %>\n .config(function ($routeProvider, $httpProvider, $translateProvider, USER_ROLES) {\n $routeProvider\n .when('/<%= entityInstance %>', {\n templateU... | javascript | edit | null | null | apache-2.0 | ab442c4cb9f1e57c5e1477ce02c592107a3f5f77 | rkohel/generator-jhipster,nkolosnjaji/generator-jhipster,nkolosnjaji/generator-jhipster,ctamisier/generator-jhipster,maniacneron/generator-jhipster,dimeros/generator-jhipster,vivekmore/generator-jhipster,jkutner/generator-jhipster,gzsombor/generator-jhipster,pascalgrimaud/generator-jhipster,danielpetisme/generator-jhip... | entity/templates/src/main/webapp/scripts/_entity-router.js | rejected_syntax | Syntax error detected by tree-sitter | false |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nvar path = require('path');\n\nmodule.exports = function (module) {\n return {\n \"module\": false,\n \"port\": 5000,\n \"liveReloadPort\": 35729,\n \"bundleFilename\": \"main\",\n \"distribution\":... | javascript | edit | 0 | 2 | mit | 9df2ede0da190e16e2abd097b9d090b999e46033 | mtfranchetto/smild,mtfranchetto/smild,mtfranchetto/smild | lib/DefaultOptions.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n// Licensed under the Apache License, Version 2.0 (the “License”); you may not\n// use this file except in compliance with the License. You may obtain a copy of\n// the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n... | javascript | edit | 0 | 0 | apache-2.0 | 20a2e0710ea7ad45cd872a1b0a52c000a2e2fc30 | ctrine/webpack-settings,ctrine/webpack-settings | src/configs/eslint/index.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nvar csv = require('ya-csv');\n\nfunction documentsToCsv(writer, handlerName, documents) {\n var csvWriter = new csv.CsvWriter(writer);\n\n (documents || []).forEach(function (doc) {\n var entries = doc[handlerName];\n\n ... | javascript | edit | 0 | 2 | bsd-3-clause | df48cbcc96a671010ed9a215cfa5efc4e95c8d82 | alexjeffburke/express-couchdb-arraysofobjects | lib/documentsToCsv.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n'use strict';\n\n// module Web.Firebase.Authentication.Eff\n\nexports._onAuth = function (callback, firebase) {\n return function() {\n return firebase.onAuth(callback);\n };\n};\n\nexports._authWithOAuthRedirect(provider, errorCal... | javascript | edit | null | null | mit | c678417c7f4da3d5b2e1c42fd99a9015f1605f77 | mostalive/purescript-firebase,mostalive/purescript-firebase,mostalive/purescript-firebase | src/Web/Firebase/Authentication/Eff.js | rejected_syntax | Syntax error detected by tree-sitter | false |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nimport histSvg from 'static/assets/history-16.svg';\nimport bkmrkSvg from 'static/assets/bookmark.svg';\n\n// Firefox doesnt like # signs in data uris so hex values are a no-go,\n// inline the rgb values instead so the colors show up.\n... | javascript | edit | 0 | 4 | mit | 09f18ff899cd9213501f72e6aaab7709809f80e0 | reblws/tab-search,reblws/tab-search | src/core/pages/popup/assets.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nimport {\n CREATE_GOTO, REMOVE_GOTO, EDIT_GOTO\n} from '../actions/goTo'\nimport {\n LOAD_QUESTIONNAIRE_SUCCESS\n} from '../actions/questionnaire'\n\nconst emptyGoTo = {\n description: '',\n expression: '',\n ifTrue: null, //ifTrue... | javascript | edit | 0 | 3 | mit | 738273af0d5ce86a96519d86827614a3596e0794 | InseeFr/Pogues,Zenika/Pogues,InseeFr/Pogues,InseeFr/Pogues,Zenika/Pogues,Zenika/Pogues | src/js/reducers/goTos-by-id.js | accepted | null | true |
[
{
"role": "user",
"content": "Write javascript code for the following: Add script to test for memory leaks in watchmen ping"
},
{
"role": "assistant",
"content": "var storage_mocked = require ('./../../test/lib/mock/storage_mocked');\nvar debug = require('debug')('data-load');\n\nvar Watchmen = ... | javascript | new_file | 0 | 3 | mit | 80165a09c839a22fdde9a9c795b020c918eb9e0f | labianchin/WatchMen,Cellington1/Status,labianchin/WatchMen,corinis/watchmen,plyo/watchmen,ravi/watchmen,ravi/watchmen,plyo/watchmen,iloire/WatchMen,NotyIm/WatchMen,ravi/watchmen,labianchin/WatchMen,iloire/WatchMen,NotyIm/WatchMen,corinis/watchmen,Cellington1/Status,plyo/watchmen,iloire/WatchMen,NotyIm/WatchMen,Cellingt... | scripts/data-load/find-memory-leaks.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nvar SelectEntityMixin = require(\"../select_entity_mixin\");\nvar _ = require(\"substance/helpers\");\n\nvar TagEntityPanelMixin = _.extend({}, SelectEntityMixin, {\n \n // Called with entityId when an entity has been clicked\n handl... | javascript | edit | 0 | 2 | mit | 6742434432484be3d2a32b5875882133a68e75db | archivist/archivist-core | writer/components/panels/entities/tag_entity_panel.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n#!/usr/bin/env node\n\n'use strict';\n\nconst Liftoff = require('liftoff');\nconst argv = require('minimist')(process.argv.slice(2));\nconst chalk = require('chalk');\n\nconst glueyCli = new Liftoff({\n name: 'gluey',\n processTitle: ... | javascript | edit | 0 | 4 | mit | 996866eb32d567a725174f85bdc9ba9994c07cb9 | skarfacegc/Gue,skarfacegc/Gue | bin/gluey.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nvar gcm = require('node-gcm');\n\nexports.sendNotification = function(db, title, messageNotif) {\n db.serialize(function() {\n db.all(\"SELECT notification_id from notification_client\", function(err, results){\n if... | javascript | edit | 0 | 3 | mit | b1f2c22f03609cea3c9365e9e3c28f3adf989a32 | orome656/HOFCServer,orome656/HOFCServer,orome656/HOFCServer | send_notification.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nmodule.exports = function(addressee, correlationId, response) {\n var msg, responseJSON;\n\n response = response || {};\n\n if(String(addressee).length === 0) {\n return new Error(\"No known addressee\");\n }\n\n if(String(corre... | javascript | edit | 0 | 5 | apache-2.0 | fe1ba0dc3917b592fab5e782c2349f6c8bcd8002 | radiodan/messaging-client | lib/worker/respond.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nimport { ReactiveVar } from 'meteor/reactive-var';\nimport { Promise } from 'meteor/promise';\n\nfunction eqls(a, b) {\n return JSON.stringify(a) === JSON.stringify(b);\n}\n\nexport class ReactiveObserver {\n constructor(observer, {\n... | javascript | edit | 0 | 2 | mit | c13d6116814fe81dd34419299ed2ef5862fcb31f | Swydo/blaze-apollo | lib/ReactiveObserver.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nexport default {\n title: 'Core|Errors',\n};\n\nexport const exception = () => {\n throw new Error('error');\n};\nexception.title = 'story throws exception';\nexception.parameters = {\n storyshots: { disabled: true },\n};\n\nexport c... | javascript | edit | 0 | 1 | mit | 9f5affc5ab445c10eeb4b2d24c3bb7719330dcd7 | storybooks/react-storybook,kadirahq/react-storybook,storybooks/react-storybook,storybooks/storybook,storybooks/storybook,storybooks/storybook,storybooks/storybook,storybooks/storybook,storybooks/storybook,storybooks/storybook,storybooks/react-storybook,storybooks/react-storybook,kadirahq/react-storybook | examples/official-storybook/stories/core/errors.stories.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nconst Command = require('../Command');\n\nmodule.exports = Command.extend({\n commandName: 'time',\n commandAliases: ['now'],\n moment: null,\n Discord: null,\n dependencies: {\n 'moment': 'moment',\n 'Disco... | javascript | edit | 0 | 1 | isc | 9524c1e2cb034235f914003f1c2b850fabef817e | Shotbow/ChatBot | src/Command/Time.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n$(function() {\n\n // Pre-populate values from localStorage\n $('#tweet_url').val(localStorage.getItem('tweetUrl') || '');\n $('#usernames').val(localStorage.getItem('usernames') || '');\n\n // User large version of jstree\n $.jstr... | javascript | edit | 0 | 3 | mit | 454a37c98c1a1e3ef5a56475f9d88c754e4fc23f | thameera/cfviewer,thameera/cfviewer | public/js/script.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n// @flow strict-local\nimport React, { Fragment } from 'react'\nimport vt323 from './vt323/VT323-Regular.ttf'\nimport { Global, css } from '@emotion/core'\n\nfunction GlobalStyles() {\n return (\n <Fragment>\n <Global\n ... | javascript | edit | 0 | 1 | isc | 54352658f15e6ffea368c46dc5ae60d252314916 | bjohn465/republia-times,bjohn465/republia-times | src/GlobalStyles.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n\n\nvar self = module.exports = {\n __module: {\n provides: {\n \"resources/use_scripts\": {},\n \"resources/use_stylesheets\": {},\n \"resources/register_assets_dir\": {after: ['resources/bootstrap', 'resources/hadro... | javascript | edit | 0 | 1 | mit | 5971271991af60c6fd0060414d32048cfc49e448 | hadronjs/hadron-theme-nodus | lib/resources/hadron-theme-nodus.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nimport reactTransform from 'babel-plugin-react-transform'\nimport es2015 from 'babel-preset-es2015'\nimport stage0 from 'babel-preset-stage-0'\nimport react from 'babel-preset-react'\n\nexport default {\n name: 'webpack-babel',\n conf... | javascript | edit | 0 | 1 | mit | ae12d3094709dd62f4c3507ed538e71acb31d942 | saguijs/sagui,saguijs/sagui | src/configure/webpack/plugins/babel.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nimport Ember from 'ember'\nimport layout from '../templates/components/sy-loading-dots'\n\nexport default Ember.Component.extend({\n layout,\n\n classNames: [ 'loading-dots' ]\n})\n\n```\n\nApply this change: Set tagName of loading d... | javascript | edit | 0 | 0 | mit | 168a2d0895797400979716e886f25e02dae1df69 | adfinis-sygroup/ember-sy,adfinis-sygroup/ember-sy | addon/components/sy-loading-dots.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n/**\n * Created by shellus on 2016-03-16.\n */\nangular.module('ngMQTT', [])\n .config(['$provide', function($provide){\n $provide.provider('MQTT', function(){\n\n var settings = {\n href: \"\"\n ... | javascript | edit | 0 | 3 | apache-2.0 | 91e7a73e3053f50e8908fe014cc895044fa5f8cd | shellus/angular-MQTT,shellus/angular-MQTT | src/angular-MQTT.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\ndefine([\n\n], function () {\n\n function removeElement (node) {\n var parent = node.parentNode;\n while (node.hasChildNodes()) {\n node.removeChild(node.lastChild);\n }\n if (parent) {\n ... | javascript | edit | 0 | 4 | mit | 7771a16ca8577fb9a9a746a1f6152d3b71b0d818 | rockabox/Auxilium.js | src/utils/remove-element.js | accepted | null | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.