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\nangular.module('orderCloud')\n .config(OrdersConfig)\n;\n\nfunction OrdersConfig($stateProvider) {\n $stateProvider\n .state('orders', {\n parent: 'account',\n templateUrl: 'myOrders/orders/templates/o...
javascript
edit
0
1
mit
1e2e796d806f87ebd0eae4e7f68394ec0730febe
spencerwalker/angular-buyer,crhistianr/angular-buyer,ordercloud-api/angular-buyer,crhistianr/angular-buyer,spencerwalker/angular-buyer,Four51/demo_buyer,ordercloud-api/angular-buyer,Four51/demo_buyer
src/app/myOrders/orders/js/orders.config.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\n\nfunction something()\n{\n\n\tvar x =window.localStorage.getItem('cc');\n\t\n\tx = x * 1 + 1;\n\n\twindow.localStorage.setItem('cc', x);\n\n\talert(x);\t\n\t\n}\n\n\nfunction add_to_cart(id)\n{\n\n\tvar key_id = 'product_' + id;\n \tva...
javascript
edit
0
1
mit
79b97488d91f194721d1d2c9a0c612e2b18307ec
airwall/PizzaShop,airwall/PizzaShop,airwall/PizzaShop
public/app.js
accepted
null
true
[ { "role": "user", "content": "Write javascript code for the following: Hide module.exports for rollup compatibility" }, { "role": "assistant", "content": "// require('./contentmeter.js');\nimport ContentMeter from './ContentMeter.js';\n// module.exports = ContentMeter;\n" } ]
javascript
new_file
0
0
mit
394ab4a2d670415e792504aaa25dbe7cb2b619ae
bezet/baza-contentmeter
src/index.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\nimport http from \"http\"\nimport { app, CONFIG } from \"./server\"\n\nlet currentApp = null\nconst server = http.createServer(app)\nserver.listen(CONFIG.port)\nconsole.log(`GraphQL-server listening on port ${CONFIG.port}.`)\n\nif (modu...
javascript
edit
0
1
mit
26799b61303d713c055705876e6e070c7726527f
DevNebulae/ads-pt-api
src/index.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\n\nvar mongoose = require('mongoose');\nmongoose.connect(process.env.MONGO_URI);\n\nmongoose.Model.prototype.psave = function () {\n\n var that = this;\n\n return new Promise(function (resolve) {\n\n that.save(function (err)...
javascript
edit
0
2
mit
43e6579c55ff8eb592d864c7cfc4858ca69e25ef
kt3k/pomodoro-meter,kt3k/pomodoro-meter,kt3k/pomodoro-meter
src/mongo.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\nconst UPower = imports.ui.status.power.UPower\nconst Main = imports.ui.main\n\nlet watching\n\nfunction bind () {\n getBattery(proxy => {\n watching = proxy.connect('g-properties-changed', update)\n })\n}\n\nfunction unbind () {\n ...
javascript
edit
0
5
mit
f7f7d921e1153a86c74d5dfb2d728095313885f9
ai/autohide-battery
extension.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\nconst moment = require('moment');\nconst urlForStatic = require('./url').urlForStatic;\nconst getStaticHash = require('./utility').getStaticHash;\n\n// only reload if it's more than 10 minutes since the last reload\nconst should...
javascript
edit
0
6
apache-2.0
810136cdab53dcc29751cb4584f9012c73aed0c3
kellybinary/binary-static,ashkanx/binary-static,kellybinary/binary-static,binary-com/binary-static,ashkanx/binary-static,kellybinary/binary-static,binary-com/binary-static,ashkanx/binary-static,binary-com/binary-static
src/javascript/_common/check_new_release.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\nimport React from 'react';\nimport {Link} from 'react-router';\nimport ObservationStatus from '../../unit/components/ObservationStatus';\nimport {getAttr, getUnitIconURL, getServiceName, getObservation} from '../../unit/helpers';\n\ncon...
javascript
edit
0
1
mit
03a6a9e6a2e50fcb5d8a425e7a6275f30e8e95f1
nordsoftware/outdoors-sports-map,nordsoftware/outdoors-sports-map,nordsoftware/outdoors-sports-map
src/modules/search/components/UnitSuggestions.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\nexport function createPostbackAction(label, input, issuedAt) {\n return {\n type: 'postback',\n label,\n data: JSON.stringify({\n input,\n issuedAt,\n }),\n };\n}\n\nexport function createFeedbackWords(feedbacks)...
javascript
edit
0
4
mit
4f61ec02643d6c200301c63c56c40c58bb6a3209
cofacts/rumors-line-bot,cofacts/rumors-line-bot,cofacts/rumors-line-bot
src/utils.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\n(function (Modules) {\n \"use strict\";\n\n Modules.ParentTaxonPrefixPreview = function () {\n this.start = function(el) {\n var $parentSelectEl = $(el).find('select.js-parent-taxon');\n var $pathPrefixEl = $(el).find('.j...
javascript
edit
0
2
mit
168bd2c28dedbed8b7c22a97138bf33d487250e4
alphagov/content-tagger,alphagov/content-tagger,alphagov/content-tagger
app/assets/javascripts/parent-taxon-prefix-preview.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\n// Returns primitive { ownerId: sortIndexValue } map for provided sortKeyPath\n\n'use strict';\n\nvar ensureString = require('es5-ext/object/validate-stringifiable-value')\n , ee = require('event-emitter')\n , memoize =...
javascript
edit
0
2
mit
429d78580b2f78b0bb12c79fe182c77986f89a5d
egovernment/eregistrations,egovernment/eregistrations,egovernment/eregistrations
server/utils/get-db-sort-index-map.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\n$(function() {\n\n $(\"#publishButton\").click( function() {\n showPleaseWait('Publishing... (This can take some time depending on the number of resources you have selected..)');\n\n if (!$(this).hasClass('disabled')) ...
javascript
edit
0
2
apache-2.0
7fa801c636d9b4bc3176699c154b927b8389cf8f
inbloom/APP-tagger,inbloom/APP-tagger
app/assets/javascripts/tagger/onClick/publishButton.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\n/**\n * This bundle logs the map click coordinates to the console. This is a demonstration of using DefaultExtension.\n *\n * @class Oskari.routing.bundle.inapprouting.InAppRoutingBundleInstance\n */\nOskari.clazz.define('Oskari.routing...
javascript
edit
0
1
mit
6bb308cd9a8860e6b99d9c23e070386883feaf17
uhef/Oskari-Routing-frontend,uhef/Oskari-Routing-frontend,uhef/Oskari-Routing-frontend,uhef/Oskari-Routing-frontend,uhef/Oskari-Routing-frontend,uhef/Oskari-Routing-frontend
bundles/routing/bundle/inapprouting/instance.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\nvar page = require('webpage').create(),\n system = require('system'),\n address, output, size;\n\nif (system.args.length < 4 || system.args.length > 5) {\n console.log('Usage: '+system.args[0]+' URL selector filename [zoom]');\...
javascript
edit
0
3
mit
d2c4c56877f64262d2d7637021f94af75671e909
buo/stamper
stamper.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\nconst path = require('path');\nconst express = require('express');\nconst router = express.Router();\nconst log = require('../logger');\nconst wordsRepository = new (require(\"../repositories/word.repository\"))();\n\nrouter.get('/', (r...
javascript
edit
0
2
bsd-3-clause
3bd40745f69a0f44bcb47dd77180e3a675fc851a
Saka7/word-kombat,Saka7/word-kombat,Saka7/word-kombat,Saka7/word-kombat
back/controllers/index.controller.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\n$(function() {\n\n // toggle on/off switch\n $(document).on('click', '[data-toggle]', function() {\n targetHide = $(this).data('toggle-hide')\n targetShow = $(this).data('toggle-show')\n $('[data-toggle-name=\"' + targetHide ...
javascript
edit
0
1
mit
2b4f8c7d914a2539af765ee2d1a56688073b2c25
aelogica/express_admin,aelogica/express_admin,aelogica/express_admin,aelogica/express_admin
app/assets/javascripts/express_admin/utility.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\n/*\n * Copyright (C) 2013 salesforce.com, inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n ...
javascript
edit
0
2
apache-2.0
ff82e198ca173fdbb5837982c3795af1dec3a15d
forcedotcom/aura,forcedotcom/aura,madmax983/aura,forcedotcom/aura,forcedotcom/aura,forcedotcom/aura,madmax983/aura,madmax983/aura,madmax983/aura,madmax983/aura,madmax983/aura
aura-components/src/main/components/ui/abstractList/abstractListRenderer.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\n$(function() {\n\n $('#side-menu').metisMenu();\n\n});\n\n//Loads the correct sidebar on window load,\n//collapses the sidebar on window resize.\n$(function() {\n $(window).bind(\"load resize\", function() {\n console.log($...
javascript
edit
0
2
apache-2.0
acbd127fda54894c0f99b8f852c39402049bcabf
habibmasuro/startbootstrap,roth1002/startbootstrap,javierperezferrada/startbootstrap,thejavamonk/startbootstrap,Sabertn/startbootstrap,agustik/startbootstrap,WangRex/startbootstrap,anupamme/startbootstrap,IronSummitMedia/startbootstrap,lee15/startbootstrap,lee15/startbootstrap,dguardia/startbootstrap,roth1002/startboot...
templates/sb-admin-v2/js/sb-admin.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\n/*global TodoMVC */\n'use strict';\n\nTodoMVC.module('Todos', function (Todos, App, Backbone) {\n\t// Todo Model\n\t// ----------\n\tTodos.Todo = Backbone.Model.extend({\n\t\tdefaults: {\n\t\t\ttitle: '',\n\t\t\tcompleted: false,\n\t\t\...
javascript
edit
0
3
mit
582e35fe2da8239bec3675e837cb704f7275f1fc
skatejs/todomvc,luxiaojian/todomvc,amy-chiu/todomvc,sophiango/todomvc,raiamber1/todomvc,Granze/todomvc,webcoding/todomvc,laomagege/todomvc,wangcan2014/todomvc,digideskio/todomvc,planttheidea/todomvc,wangjun/todomvc,vanyadymousky/todomvc,nbr1ninrsan2/todomvc,msi008/todomvc,mboudreau/todomvc,watonyweng/todomvc,nancy44/to...
examples/backbone_marionette/js/TodoMVC.Todos.js
rejected_duplicate
Near-duplicate of sample 98098
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\nload('bower_components/qunit/qunit/qunit.js');\nload('bower_components/qunit-tap/lib/qunit-tap.js');\nload('bower_components/power-assert-formatter/lib/power-assert-formatter.js');\nload('bower_components/empower/lib/empower.js');\n\n(f...
javascript
edit
0
1
mit
5387eae85dcaf6051d0d9fde7c108509d8cd7755
twada/power-assert,saneyuki/power-assert,power-assert-js/power-assert,twada/power-assert,falsandtru/power-assert,yagitoshiro/power-assert,falsandtru/power-assert,power-assert-js/power-assert,saneyuki/power-assert,yagitoshiro/power-assert
sandbox/run_rhino.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\n// ==UserScript==\n// @name Selfish Youtube\n// @namespace https://github.com/ASzc/selfish-youtube\n// @description On the watch page, prevent the share panel from being switched to after pressing Like\n...
javascript
edit
0
0
mit
d4b1e50aa6d35fffc4e6ce579ea33c97d2799614
ASzc/selfish-youtube
selfish-youtube.user.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\nvar assert = chai.assert;\n\ndescribe('LMLayer', function () {\n describe('[[constructor]]', function () {\n it('should construct with zero arguments', function () {\n let lmLayer = new LMLayer();\n assert.instanceOf(lmLay...
javascript
edit
0
1
apache-2.0
68045361c6f994e015f2d28026a443d67fc0507a
tavultesoft/keymanweb,tavultesoft/keymanweb
common/predictive-text/unit_tests/in_browser/cases/top-level-lmlayer.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\nvar express = require('express');\n\nvar utils = require('../utils');\n\nvar router = express.Router();\n\n/**\n * Render the home page.\n */\nrouter.get('/', function(req, res) {\n res.render('index.jade');\n});\n\n\n/**\n * Render th...
javascript
edit
0
1
mit
27b62998e1c57d39bcd051c7c9d75ed487136af7
DecisionSystemsGroup/dsg.teiste.gr,DecisionSystemsGroup/dsg.teiste.gr,DecisionSystemsGroup/dsg.teiste.gr,DecisionSystemsGroup/dsg.teiste.gr
routes/main.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\n/**\n\n Copyright 2015 Covistra Technologies Inc.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n htt...
javascript
edit
0
1
apache-2.0
f25865901f69302ca1f924ebb1644506ce6ec63c
Covistra/hapi-plugin-covistra-socket
index.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\n'use strict';\n\nvar nomnom = require('nomnom');\n\nvar signal = require('./lib/signal');\nvar tree = require('./lib/tree');\n\nvar task = function (name, callback, options) {\n var command = nomnom.command(name);\n\n options.forE...
javascript
edit
0
2
mit
0cb448c2978cdb213e9dc04ccad7fcc571f519c7
byggjs/bygg
index.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\nimport $ from 'jquery';\n\nexport default function plugit( pluginName, pluginClass ) {\n\tlet dataName = `plugin_${pluginName}`;\n\n\t$.fn[pluginName] = function( options ) {\n\t\treturn this.each( function() {\n\t\t\tlet $this = $( thi...
javascript
edit
0
2
mit
2fb53769d3e52170accaa7b978ca7eb1ca4f5ba0
statnews/pugin
index.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\nvar gulp = require('gulp');\nvar elixir = require('laravel-elixir');\nvar urlAdjuster = require('gulp-css-url-adjuster');\n\n/*\n |----------------------------------------------------------------\n | adjust css urls for images and stuff...
javascript
edit
0
1
mit
7482a98a1050118ec5f52568ea66945e5429162f
farrrr/laravel-elixir-css-url-adjuster
index.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\n'use strict'\n\nconst express = require('express')\nconst bodyParser = require('body-parser')\nconst config = require('./config')\nconst app = express()\nconst publisher = require('./publisher')\nvar cronJob = require('cron').CronJob\n\...
javascript
edit
0
1
mit
db100aa0ca744fb152d32b1453135c5175b78125
igroomgrim/Crypty
index.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\nvar _arity = require('./_arity');\n\n\n/**\n * Internal curryN function.\n *\n * @private\n * @category Function\n * @param {Number} length The arity of the curried function.\n * @return {array} An array of arguments received thus far.\...
javascript
edit
0
10
mit
70c052fb4faeafd3fa31fc3d030f70b5aed19b5c
jimf/ramda,arcseldon/ramda,maowug/ramda,kedashoe/ramda,asaf-romano/ramda,ccorcos/ramda,iofjuupasli/ramda,jimf/ramda,asaf-romano/ramda,besarthoxhaj/ramda,Bradcomp/ramda,davidchambers/ramda,ramda/ramda,svozza/ramda,arcseldon/ramda,maowug/ramda,Nigiss/ramda,CrossEye/ramda,angeloocana/ramda,angeloocana/ramda,Nigiss/ramda,r...
src/internal/_curryN.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\n'use strict';\n\nexport default class Fragment {\n render () {\n return null;\n }\n\n /**\n * Generic event handler. Turns class methods into closures that can be used as event handlers. If you need to use\n * da...
javascript
edit
0
2
mit
73eb904356c11abab11481a9585005afc017edd8
smiley325/conjure
src/conjure/fragment.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\n'use strict';\n\nvar toStr = Number.prototype.toString;\n\nmodule.exports = function isNumberObject(value) {\n\tif (typeof value === 'number') { return true; }\n\tif (typeof value !== 'object') { return false; }\n\ttry {\n\t\ttoStr.call...
javascript
edit
0
3
mit
7e6be2fd2346557fc81bd544ac8745021c50e266
ljharb/is-number-object
index.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\n#!/usr/bin/env node\n\n/**\n * index.js\n *\n * for `character-map` command\n */\n\nvar opts = require('minimist')(process.argv.slice(2));\nvar opentype = require('opentype.js');\n\nif (!opts.f || typeof opts.f !== 'string') {\n\tconsol...
javascript
edit
0
4
mit
0f375c2e85a348ce377cd7c6eced277b47a470ba
bitinn/character-map
index.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\nPackage.describe({\n summary: \"Common code for OAuth-based login services\",\n version: \"1.3.0\",\n});\n\nPackage.onUse(api => {\n api.use('check', 'server');\n api.use('webapp', 'server');\n api.use(['accounts-base', 'ecmascript...
javascript
edit
0
1
mit
d14a4867f19147c40efa0d09fc1d623f7373424c
Hansoft/meteor,Hansoft/meteor,Hansoft/meteor,Hansoft/meteor,Hansoft/meteor,Hansoft/meteor,Hansoft/meteor
packages/accounts-oauth/package.js
rejected_duplicate
Near-duplicate of sample 89099
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\nimport Vue from 'vue';\nimport notesApp from '../notes/components/notes_app.vue';\nimport discussionCounter from '../notes/components/discussion_counter.vue';\nimport store from '../notes/stores';\n\nexport default function initMrNotes(...
javascript
edit
0
1
mit
1db4ea20c6ce67559a5c28b6b423abe292354dd8
jirutka/gitlabhq,mmkassem/gitlabhq,iiet/iiet-git,jirutka/gitlabhq,mmkassem/gitlabhq,axilleas/gitlabhq,dreampet/gitlab,dreampet/gitlab,iiet/iiet-git,axilleas/gitlabhq,stoplightio/gitlabhq,dreampet/gitlab,mmkassem/gitlabhq,axilleas/gitlabhq,stoplightio/gitlabhq,jirutka/gitlabhq,dreampet/gitlab,jirutka/gitlabhq,iiet/iiet-...
app/assets/javascripts/mr_notes/index.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\n/* \n* @Author: Mike Reich\n* @Date: 2016-01-26 11:48:16\n* @Last Modified 2016-01-26\n*/\n\n'use strict';\n\nimport MandrilService from './MandrilService'\n\nexport default class Mailer {\n\n constructor(app) {\n new MandrilServi...
javascript
edit
0
3
mit
efbb2dbe9425a831507ccbab1843784b525a255a
nxus/mailer
src/Mailer.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\nmodule.exports = {\n extends: [\n './base.js'\n ],\n plugins: [\n 'node'\n ],\n rules: {\n 'node/no-unsupported-features': 'error',\n 'node/no-deprecated-api': 'error',\n\n 'generator-star-spacing': ['error', { befor...
javascript
edit
0
0
mit
221852e851ed84d1d8e2f5db6e973f0a8fcc7307
logux/eslint-config-logux
node4.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\n// Copyright (c) 2010 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nvar localStrings = new LocalStrings();\n\n/**\n * Window onloa...
javascript
edit
0
3
bsd-3-clause
5472489991a1b85cc75ec0f8d95ed35b1213cf48
Chilledheart/chromium,hujiajie/pa-chromium,hujiajie/pa-chromium,ChromiumWebApps/chromium,Chilledheart/chromium,mogoweb/chromium-crosswalk,bright-sparks/chromium-spacewalk,mohamed--abdel-maksoud/chromium.src,krieger-od/nwjs_chromium.src,bright-sparks/chromium-spacewalk,hgl888/chromium-crosswalk-efl,timopulkkinen/BubbleF...
chrome/browser/resources/print_preview.js
rejected_duplicate
Near-duplicate of sample 68061
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\nTemplate.duplicates.onRendered(function() {\n\n var playlist_id = Router.current().params['_id']\n\n Meteor.call('getDuplicateTracksFromPlaylist', playlist_id, function(err, response) {\n console.log(response);\n\n S...
javascript
edit
0
1
mit
ddedc841fb1459118668496987704e085d315a83
Assios/Spotify-Deduplicator,Assios/Spotify-Deduplicator
client/templates/duplicates/duplicates.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\nexport default function getBaseUrl() {\n const inDevelopment = window.location.hostname === 'localhost';\n return inDevelopment ? 'http://localhost:3001/' : '/'\n}\n```\n\nApply this change: Check for mock api in path" }, { "r...
javascript
edit
0
2
mit
84414914d90dc00b512be0ba838b9df95399253d
chrisrymer/js-dev-env,chrisrymer/js-dev-env
src/api/baseUrl.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\nimport Bit from '../components/Bit'\nimport { createElement } from 'react'\n\nconst COMMENT_TAG = '--'\nconst DEFAULT_TAG = Bit\n\n// eslint-disable-next-line max-params\nfunction parse (buffer, doc, options, key) {\n switch (doc.type)...
javascript
edit
0
9
mit
bbd0d87faade33d2a072b012ad163aa8ac1973c2
dlindahl/stemcell,dlindahl/stemcell
src/util/reactify.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\n// Test object id find.\n\nfunction testObjectIdFind( db ) {\n r = db.ed_db_find2_oif;\n r.drop();\n\n z = [ {}, {}, {} ];\n for( i = 0; i < z.length; ++i )\n\tr.save( z[ i ] );\n \n center = r.find( { _id: z[ 1 ]._id ...
javascript
edit
0
2
apache-2.0
83f96ed1f8fb5938b6b1c129ec19f3f7f1892ae1
babble/babble,babble/babble,babble/babble,babble/babble,babble/babble,babble/babble
src/test/ed/db/find2.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\nvar Utils = {};\n\n(function() {\n Utils.convertTemp = function(temp) {\n if(Ti.App.Properties.getString('units','c')==='f') {\n return Math.round(temp*1.8+32) +'\\u00b0F'; // convert to Fahrenheit & append degree symbol-F\n ...
javascript
edit
0
2
apache-2.0
e3f82b199c2f1e287b3d7892584c0836b894316e
danielhanold/DannySink
Resources/utils/utils.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\nlet Q = require(\"q\");\n\nmodule.exports = {\n // `pcall` takes a function that takes a set of arguments and\n // a callback (NON-Node.js style) and turns it into a promise\n // that gets resolved with the arguments to the callback....
javascript
edit
0
2
mit
b58632ecc31006ecb64f1879abc55537d44125b8
jaredsohn/mutetab,jaredsohn/mutetab,jaredsohn/mutetab
src/js/util.js
accepted
null
true
[ { "role": "user", "content": "Write javascript code for the following: Add TODO to fix animation." }, { "role": "assistant", "content": "$(\".hamburger\").click(function () {\n $('.slider').slideToggle();\n}); //TODO: Write own CSS animation or use animate.css or alternative\n" } ]
javascript
new_file
0
1
cc0-1.0
9ba19962871bac5bcf79db9be6252d0cc5cd966a
ShayHall/shayhall.github.io,ShayHall/shayhall.github.io
src/js/main.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\n'use strict';\n\nvar JsMockito = require('jsmockito').JsMockito;\nvar JsHamcrest = require('jsmockito/node_modules/jshamcrest').JsHamcrest;\n\nvar mochito = {\n installTo: function(target) {\n JsMockito.Integration.importTo(target);...
javascript
edit
0
1
apache-2.0
aacc74db050f1ba5889a12a35014d83070ed028b
dchambers/mochito
src/mochito.js
accepted
null
true
[ { "role": "user", "content": "Write javascript code for the following: Add unit tests for 100% coverage logger module" }, { "role": "assistant", "content": "/**\n * @module src/logger_test\n */\n'use strict'\n\nconst test = require('unit.js')\n\nconst logger = require('./logger')\n\nconst sinon ...
javascript
new_file
0
1
mit
8a5ae248a879106ab6f41cfdf8772ecd1bf667ab
cflynn07/simple-producer-consumer,cflynn07/simple-producer-consumer
src/logger_test.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\n/* eslint-disable no-console */\n\nimport AccessTokenRetriever from './access-token-retriever';\nimport ConfigurationProvider from './configuration-provider';\nimport WebServer from './web-server';\nimport WindowsGraphUsersRetriever fro...
javascript
edit
0
4
mit
2d092c88e1d45102dd32b9a9b92c7a1f5bd00d13
ritterim/star-orgs,kendaleiv/star-orgs,ritterim/star-orgs,kendaleiv/star-orgs
src/server/main.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\nconst string = require('../../src/util/string.js');\n\ndescribe('string', () => {\n it('exports string', () => {\n expect(string).toBeDefined();\n });\n\n describe('mapAscii', () => {\n it('should return same result for no-ops'...
javascript
edit
0
1
mit
d22f47cff38a0f65ae6e5fde9f1f6517ec0f2c57
PhilHarnish/forge,PhilHarnish/forge,PhilHarnish/forge,PhilHarnish/forge,PhilHarnish/forge,PhilHarnish/forge
spec/util/stringTest.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\nimport React, { PropTypes } from 'react';\nimport cx from 'classnames';\nimport Background from './background';\nimport Icon from './icon';\nimport Mask from './mask';\nimport { keyFor } from './networks';\nimport { socialIcon, socialCo...
javascript
edit
0
2
mit
ccc01b4599b586651bab6a60df91517bced9e4d4
jaketrent/react-social-icons,jaketrent/react-social-icons
src/social-icon.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\nimport { createStore, applyMiddleware, compose } from 'redux';\nimport createHistory from 'history/createHashHistory';\nimport { routerMiddleware } from 'connected-react-router';\nimport createRootReducer from 'reducers/root';\nimport g...
javascript
edit
0
0
mit
f8787b6bccd15d8850a10ea66a9d13bb059437cc
Gisto/Gisto,Gisto/Gisto,Gisto/Gisto,Gisto/Gisto
src/store/store.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\nimport React from 'react'\nimport { applyMiddleware, createStore, compose } from 'redux'\nimport { render } from 'react-dom'\nimport { Provider } from 'react-redux'\nimport { applyRouterMiddleware, browserHistory, Router } from 'react-r...
javascript
edit
0
1
mit
4fb0b46888829fb6b325dfa666cad5763eacdfeb
nomkhonwaan/nomkhonwaan.github.io
src/client.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\nvar markup = null;\r\n$(function() {\r\n var markupTools = MarkupTools('.button-bar > div');\r\n markup = Markup('#pdf-markup', markupTools);\r\n\r\n $(markup).on('update add', function() {\r\n $('#result').text(JSON.stri...
javascript
edit
0
1
mit
5754f8e24f47a86f442e5833bff15661a45c6a30
Soneritics/pdf-markup,Soneritics/pdf-markup
scripts.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\nvar hits = 0;\n\nfunction setup() {\n hits = 0;\n}\n\nfunction hit() {\n hits++;\n console.log(hits);\n}\n\nfunction showAll() {\n $('.hole').flip(true);\n}\n\nfunction hideAll() {\n $('.hole').flip({\n trigger: 'm...
javascript
edit
0
1
mit
0e0e931c759a1ed3589481eaa2e6b82511519bba
efritz/arrows,JoshuaSCochrane/arrows
examples/whack/js/common.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\nconst config = require('../../../knexfile').web\nconst knex = require('knex')(config)\nmodule.exports = function (id, type) {\n var table = \"team_caseload_overview\"\n var whereObject = {}\n if (id !== undefined) {\n whereObject....
javascript
edit
0
2
mit
a04c89d7251148fdc298828535fdfd4977893135
ministryofjustice/wmt-web,ministryofjustice/wmt-web
app/services/data/get-team-caseload.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\n(function (define) { 'use strict';\ndefine(function (require) {\n\n var _ = require('lodash');\n\n function DSL() {\n this.matches = [];\n }\n\n _.extend(DSL.prototype, {\n route: function (name, options, callback) {\n if...
javascript
edit
0
6
mit
28e6e967eac14e0d4196e45dcdea9c06cd5562b4
QubitProducts/cherrytree,QubitProducts/cherrytree,nathanboktae/cherrytree,nathanboktae/cherrytree
lib/dsl.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\nvar config = module.exports;\n\nconfig[\"specs\"] = {\n rootPath: \"../\",\n environment: \"browser\",\n sources: [\n \"lib/*.js\"\n ],\n tests: [\n \"spec/*.spec.js\"\n ],\n}\n\n```\n\nApply this change: Fix loading error o...
javascript
edit
0
0
mit
6eabbb5565d5b529835cd36ac5d7d3c380416105
jmdeldin/content-usability,jmdeldin/content-usability
spec/buster.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\n/* globals requirejs, require */\n(function() {\ndefine(\"ember-cli/test-loader\",\n [],\n function() {\n \"use strict\";\n\n var TestLoader = function() {\n };\n\n TestLoader.prototype = {\n shouldLoadModule: functio...
javascript
edit
0
3
mit
1b8b28bad82576de80b8066ccd4d23663a11598b
ember-cli/ember-cli-test-loader
test-loader.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\nimport React from \"react/addons\";\n\nimport Resolver from \"./Resolver\";\n\nclass ResolverContext extends React.Component {\n getChildContext() {\n const resolver = this.props.resolver || this.context.resolver;\n\n return { re...
javascript
edit
0
2
isc
dd634ae9873d1dddb44a20396e0d8ee8f764c429
matthiasak/react-resolver,iamdustan/react-resolver,gilesbradshaw/react-resolver-csp,iamdustan/react-resolver,kwangkim/react-resolver,goatslacker/react-resolver,Daniel15/react-resolver,shaunstanislaus/react-resolver,gilesbradshaw/react-resolver-csp,eiriklv/react-resolver,donabrams/react-resolver
src/Context.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\nimport test from 'ava';\nimport plugin from '../postcss-rem-phi-units'\nimport postcss from 'postcss';\nimport { readFileSync } from 'fs';\n\ntest('Settingless units', async t => {\n\tpostcss(plugin)\n\t\t.process(readFileSync('in.css')...
javascript
edit
null
null
mit
01db3107f6f7d6b4edddd1375b8096810099adff
posthumans/postcss-rem-phi-units
test/index.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 utils = require('../../').utils;\nvar assert = require('chai').assert;\n\nsuite('Utils', () => {\n test('create a random hex string', () => {\n const test1 = utils.getRandomHexString();\n assert.isString(test...
javascript
edit
0
2
mit
fd5251c0a047cf100ce051e2a6d4bfb4184d5131
MariusRumpf/node-lifx
test/unit/utils-test.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\n'use strict';\n\nangular\n .module('lmServices')\n .constant('Admin', (/((; )|^)admin=true(;|$)/).test(document.cookie));\n\n```\n\nApply this change: Add comments explaining how the admin interface works" }, { "role": "as...
javascript
edit
0
0
mit
109b89e89845eaa7371d74ab603ba993be0fb504
peferron/lilymandarin-web,peferron/lilymandarin-web,peferron/lilymandarin-v1-web,peferron/lilymandarin-v1-web
app/services/Admin/Admin.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\nimport React from 'react'\nimport { Segment, Message } from 'semantic-ui-react'\nimport JSONTree from 'react-json-tree'\n\ntype Props = {\n loading: boolean,\n expanded: boolean,\n response: any,\n error: ?Error,\n}\n\nconst Respons...
javascript
edit
null
null
apache-2.0
50036eab17d4ead74316e2023bed1a4a55b256a7
phenyl-js/phenyl,phenyl-js/phenyl,phenyl-js/phenyl,phenyl-js/phenyl
modules/phenyl-api-explorer-client/src/components/OperationResult/Response.js
rejected_syntax
Syntax error detected by tree-sitter
false
[ { "role": "user", "content": "Here is the current file:\n```javascript\nimport Command from '../../ui/Command'\nimport insertInlineNode from '../../model/transform/insertInlineNode'\n\nclass InsertInlineNodeCommand extends Command {\n constructor(...args) {\n super(...args)\n\n if (!this.params.nodeT...
javascript
edit
0
4
mit
5368611171153c0abdd37e65b654415d6314e9ca
stencila/substance,andene/substance,podviaznikov/substance,substance/substance,michael/substance-1,substance/substance,podviaznikov/substance,michael/substance-1,andene/substance
packages/inline-node/InsertInlineNodeCommand.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\nconst React = require('react');\nconst classNames = require('classnames');\n\nconst SIZES = require('./SIZES');\n\nconst Spinner = React.createClass({\n propTypes: {\n centered: React.PropTypes.bool,\n size: React.P...
javascript
edit
0
1
apache-2.0
f4fb9da3a005a95126cff182659d9415a0fe7b28
rlugojr/styleguide,GitbookIO/styleguide,GitbookIO/styleguide,rlugojr/styleguide
src/Spinner.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\nconst { expect } = require('chai');\nconst cheerio = require('cheerio');\nconst request = require('supertest');\nconst app = require('../app');\n\n\ndescribe('Pages', function() {\n let req;\n\n describe('/', function() {\n beforeE...
javascript
edit
0
1
mit
e3ec369f409c759573b64f44ce904acfcc8a87a6
slavapavlutin/pavlutin-node,slavapavlutin/pavlutin-node
test/pages-test.js
rejected_duplicate
Near-duplicate of sample 97279
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\nvar fs = require('fs')\nvar assert = require('assert')\nvar rmrf = require('rimraf')\nvar Writer = require('../src/writer')\n\ndescribe('Writer', function() {\n\n this.timeout(5000)\n\n var tempPath = __dirname + '/../tmp'\n var file...
javascript
edit
0
3
mit
057fde01ab9527d3a48d053d17b356d0fb6f6428
typicode/lowdb,etiktin/lowdb,CreaturePhil/lowdb,beni55/lowdb,typicode/lowdb
test/writer.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\ndescribe(\"$.create\", function() {\n\tit(\"creates an element and sets properties on it\", function() {\n\t\tvar element = $.create(\"article\", {\n\t\t\tclassName: \"wide\"\n\t\t});\n\n\t\texpect(element).to.be.an.instanceOf(Element);...
javascript
edit
0
1
mit
c29f89a08b83fe3d907978d0ff38e0094a390b92
LeaVerou/bliss,zdfs/bliss,LeaVerou/bliss,dperrymorrow/bliss,zdfs/bliss,dperrymorrow/bliss
tests/DOM/CreateSpec.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\n/* eslint-env mocha */\n'use strict';\n\nimport plugin from '../src';\n\nimport assert from 'assert';\nimport fs from 'fs';\nimport path from 'path';\n\nconst rules = fs.readdirSync(path.resolve(__dirname, '../src/rules/'))\n .map(f =>...
javascript
edit
0
1
mit
4c2bfe4fa16e2fdca974fe3abe8890313bc00500
jessebeach/eslint-plugin-jsx-a11y,evcohen/eslint-plugin-jsx-a11y
tests/index.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\n// karma.conf.js\nmodule.exports = function(config) {\n config.set({\n basePath : '../',\n frameworks: ['jasmine'],\n files : [\n 'public/bower_components/jquery/dist/jquery.js',\n 'public/bower_components/angular/an...
javascript
edit
0
1
mit
cb2e70635a77d1b503d9c9f4c313c6e29eae4f0a
solarkennedy/uchiwa,pantheon-systems/uchiwa,pauloconnor/uchiwa,sensu/uchiwa,pantheon-systems/uchiwa,palourde/uchiwa,palourde/uchiwa,palourde/uchiwa,solarkennedy/uchiwa,Contegix/uchiwa,pgporada/uchiwa,palourde/uchiwa,upfluence/uchiwa,sensu/uchiwa,palourde/uchiwa,ransoni/uchiwa,jsoriano/uchiwa,pgporada/uchiwa,jsoriano/uc...
test/karma.conf.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\nimport React from 'react';\nimport { Route, IndexRoute } from 'react-router';\n\n/* containers */\nimport { App } from 'components/App';\nimport { Home } from 'components/Home';\nimport { DataDisplay } from 'components/DataDisplay';\n//...
javascript
edit
0
0
mit
bd2ea150c6922e686b12c5f7a658b802bfafb3b7
TerryCapan/twitchBot,badT/Chatson,badT/Chatson,TerryCapan/twitchBot,badT/twitchBot,dramich/twitchBot,dramich/Chatson,dramich/Chatson,badT/twitchBot,dramich/twitchBot
src/routes.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\nimport bodyParser from \"body-parser\"\nimport cors from \"cors\"\nimport express from \"express\"\nimport graphqlHTTP from \"express-graphql\"\nimport { graphqlExpress, graphiqlExpress } from \"graphql-server-express\"\nimport models f...
javascript
edit
0
1
mit
85e242dd7e5293a92f124fb1976dfd51fbda6f6e
DevNebulae/ads-pt-api
src/server.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\nPackage.describe({\n summary: 'Web tracing framework wrapper for Meteor',\n version: \"0.0.2\",\n git: '<EMAIL>:eluck/meteor-web-tracing-framework.git'\n});\n\nNpm.depends({\n \"tracing-framework\": \"2014.8.18-1\"\n});\n\nPackage.o...
javascript
edit
0
1
mit
52f11529a145f849f3db58a85c35c124c53ac4a5
eluck/meteor-web-tracing-framework
package.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\nvar nconf = require('nconf');\n\n// Specifying an env delimiter allows you to override below config when shipping to production server\n// by e.g. defining piping__ignore or version variables.\nnconf.env('__');\n\nvar config = {\n appL...
javascript
edit
0
0
mit
3235e1e88f357be9172b45edf32a276065b7c291
puzzfuzz/othello-redux,XeeD/test,laxplaer/este,este/este,puzzfuzz/othello-redux,skyuplam/debt_mgmt,gaurav-/este,TheoMer/Gyms-Of-The-World,grabbou/este,neozhangthe1/framedrop-web,amrsekilly/updatedEste,steida/este,ViliamKopecky/este,XeeD/este,TheoMer/este,este/este,sikhote/davidsinclair,obimod/este,AugustinLF/este,cazac...
src/server/config.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\nvar webpack = require('webpack');\n\nmodule.exports = {\n devtool: 'eval',\n entry: [\n 'webpack-dev-server/client?http://localhost:3000',\n 'webpack/hot/only-dev-server',\n './scripts/index'\n ],\n output: {\n path: __d...
javascript
edit
0
0
mit
1c1c9481bcebaf95125c451b31c18c83bf18114c
DelvarWorld/cats-react,Ehesp/react-flux-webpack-boilerplate,michaelBenin/react-hot-boilerplate,atlonis/teach-react,bedrich/gimme-react,rikukissa/flappy-bird,meta-meta/react-synonym-game,autozimu/react-hot-boilerplate,lyhoanglong/react-hot-boilerplate,miknonny/reflux_stores,mjxm/loadingscreen,Eol217/redux-course,alphanu...
webpack.config.js
rejected_duplicate
Near-duplicate of sample 97022
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\nconst Block = require('./block');\nconst typeToConfig = require('./type-to-config');\n\nclass Board {\n\tconstructor() {\n\t\tthis.height = 3;\n\t\tthis.width = 3;\n\t\tthis.blocks = [\n\t\t\t[null, null, null],\n\t\t\t[null, null, null...
javascript
edit
0
1
mit
0d9dd06d48773c1caeb130265f0f5d0e2d9b4f8f
tsg-ut/mnemo,tsg-ut/mnemo
lib/board.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\n/* global require, module */\n\nvar EmberApp = require('ember-cli/lib/broccoli/ember-app');\n\nvar app = new EmberApp({\n 'ember-cli-jquery-ui': {\n 'theme': 'redmond'\n },\n vendorFiles: {\n 'handlebars.js': {\n productio...
javascript
edit
0
0
mit
182621443c609d145f8185e97611bf53d6337607
liveband/liveband
Brocfile.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\n/*global contract, it, embark, assert, before*/\nconst SimpleStorage = embark.require('Embark/contracts/SimpleStorage');\n\ncontract(\"SimpleStorage Deploy\", function () {\n let SimpleStorageInstance;\n\n before(async function() {\n ...
javascript
edit
0
2
mit
63d2478dd04fb1287232a59225cb11fe567e3dcd
iurimatias/embark-framework,iurimatias/embark-framework
test_apps/test_app/test/simple_storage_deploy_spec.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\nconst DrawCard = require('../../drawcard.js');\nconst EventRegistrar = require('../../eventregistrar.js');\nconst { CardTypes, Players } = require('../../Constants');\n\nclass MagnificentTriumph extends DrawCard {\n setupCardAbilitie...
javascript
edit
0
2
mit
e29fc0a4f15bd33237ecf8465a4eacebb1461b6f
gryffon/ringteki,gryffon/ringteki,jeremylarner/ringteki,jeremylarner/ringteki,gryffon/ringteki,jeremylarner/ringteki
server/game/cards/06-CotE/MagnificentTriumph.js
accepted
null
true
[ { "role": "user", "content": "Write javascript code for the following: Tidy up ogranisation of Brick objects in a level" }, { "role": "assistant", "content": "var LevelOne = function(){\n this.bricks = [\n new Brick(),\n new Brick(140),\n new Brick(230),\n new Brick(320),\n new B...
javascript
new_file
0
1
mit
20e426730539d3df99e3999926ce670b2fd3cee0
theomarkkuspaul/Brick-Breaker,theomarkkuspaul/Brick-Breaker
js/models/levels/level_1.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\nvar allTestFiles = [];\nvar TEST_REGEXP = /(spec|test)\\.js$/i;\n\nvar pathToModule = function(path) {\n return path.replace(/^\\/base\\//, '').replace(/\\.js$/, '');\n};\n\nObject.keys(window.__karma__.files).forEach(function(file) {\...
javascript
edit
0
2
mit
09fe7ea33c4037b47d3128a95ae76ebddf836fc7
rishabhsrao/voxel-hologram,rishabhsrao/voxel-hologram,rishabhsrao/voxel-hologram
tests/main.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\n// if you checked \"fancy-settings\" in extensionizr.com, uncomment this lines\n\n// var settings = new Store(\"settings\", {\n// \"sample_setting\": \"This is how you use Store.js to remember values\"\n// });\n\nfunction generateUU...
javascript
edit
0
2
mit
80736399737e0c3e5d7b203d2d3234cb32805aae
zhoutwo/url_connect,zhoutwo/url_connect,zhoutwo/url_connect
client/src/bg/background.js
rejected_duplicate
Near-duplicate of sample 86736
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\n// RPC reply serializer, that should heppen in the end,\n// because we pass errors in serialized form too\n//\n\n\n'use strict';\n\n\n////////////////////////////////////////////////////////////////////////////////\n\n\nmodule.exports =...
javascript
edit
0
3
mit
d56023c3b7beb44184aaee799cd5448e76acef1d
nodeca/nodeca.core,nodeca/nodeca.core
lib/hooks/responder/rpc/rpc_serialize.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\n'use strict'\n\nmodule.exports = (ctx) => ({\n map: ctx.file.dirname.includes('examples') ? false : {\n inline: false,\n annotation: true,\n sourcesContent: true\n },\n plugins: {\n autoprefixer: {}\n }\n})\n\n```\n\nApp...
javascript
edit
0
2
mit
bc2108c68406a22f2b339942336a292c85935a21
todc/todc-bootstrap,todc/todc-bootstrap,todc/todc-bootstrap
build/postcss.config.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\nconst test = require('tape');\nconst User = require('../../../models/User');\nconst { connect, add, remove } = require('../../database');\n\ntest('connection to database', async (assert) => {\n const res = await connect();\n assert.eq...
javascript
edit
0
1
mit
55f0f4ab81f18cf33ff62389752ee7571623c27f
mkermani144/freecodecamp-projects,mkermani144/freecodecamp-projects
backend/dynamic-web-apps/voting-app/src/tests/integrated/database.spec.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\nmodule.exports = {\n rules: {\n 'quote-props': [2, 'as-needed'],\n 'array-bracket-spacing': [2, 'never'],\n 'vars-on-top': 0,\n 'no-param-reassign': 0,\n 'max-len': [\n 1,\n 110,\n 2,\n {\n \"i...
javascript
edit
0
0
mit
da5deec709e4f2f1635ad72e26dd69740f20cd02
algolia/eslint-config-algolia,algolia/eslint-config-algolia,algolia/eslint-config-algolia
rules/base.js
rejected_duplicate
Near-duplicate of sample 84742
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\nimport React, { Component, PropTypes } from 'react';\n\nfunction can(permissionsData, permission) {\n const permissions = JSON.parse(permissionsData);\n return permissions[permission];\n}\n\nclass Can extends Component {\n render() {...
javascript
edit
0
2
mit
4a4686e98d33d5eda9df4d5d21884254c6c11fa7
meedan/check-web,meedan/check-web,meedan/check-web
src/app/components/Can.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\n// We have to remove node_modules/react to avoid having multiple copies loaded.\n// eslint-disable-next-line import/no-unresolved\nimport React, { PropTypes } from 'react';\nimport { modules } from 'stripes-loader'; // eslint-disable-li...
javascript
edit
0
6
apache-2.0
0dbbf93fb66f7d158622ed6dcd1957634f64e859
folio-org/stripes-core,folio-org/stripes-core,folio-org/stripes-core
Pluggable.js
rejected_duplicate
Near-duplicate of sample 94813
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\n'use strict';\n\nconst HTTP_OK = 200;\nconst HTTP_METHOD_NOT_ALLOWED = 405;\n\n/**\n * Conqueso compatible API\n *\n * @param {Express.App} app\n */\nfunction Conqueso(app) {\n app.get('/v1/conqueso*', (req, res) => {\n res.set('Con...
javascript
edit
0
1
mit
351594b202b9fe655a380031d2dce7d7a797f29e
rapid7/propsd,rapid7/propsd,rapid7/propsd
lib/control/v1/conqueso.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\nmodule.exports = function(City) {\n City.search = function(query, callback) {\n // TODO: sanitize query\n City.find(\n {\n where: {\n name: {\n like: '%' + query + '%'\n }\n }\n ...
javascript
edit
0
1
bsd-3-clause
fbb9efc5ac0c7b7e673ade6fbfb214c51024fdf3
craigcabrey/ratemycoop,dkgramming/ratemycoop,craigcabrey/ratemycoop,dkgramming/ratemycoop
common/models/city.js
rejected_duplicate
Near-duplicate of sample 68067
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\nconst expect = require('expect');\nconst proxyquire = require('proxyquire');\n\nconst ContextMock = require('./mocks/context');\nconst GitHubMock = require('./mocks/github');\nconst RobotMock = require('./mocks/robot');\n\nfunction arra...
javascript
edit
0
1
mit
44f9a70d53832e467aafba3a87c6fb06215a2a28
jarrodldavis/probot-gpg
test/plugin.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\n\nMeteor.methods({\n 'competencies.insert': function(params) {\n Nodes.insert({\n name: params.name,\n type: 'C'\n });\n }\n});\n\n```\n\nApply this change: Add node to competency method" }, { "role": "assistan...
javascript
edit
0
1
apache-2.0
821f61f3d1c4df9ca4d9710b9f5c57b0b5b27795
ExtensionEngine/talc,ExtensionEngine/talc
lib/methods/competencies.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\n$(document).ready(function() {\n var canvas = document.getElementById('canvas');\n canvas.width = $('#tileset').width();\n canvas.height = $('#tileset').height();\n});\n\n```\n\nApply this change: Add clip number resolving function" ...
javascript
edit
0
1
mit
badc42261d76c1437f949ac260f6b82cb1628de4
nihey/tilemapper,nihey/tilemapper
js/tilemapper.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\nvar\nsocket = window.socket = new WebSocket(\"ws://localhost:8080/\");\nsocket.onmessage = function(event) {\n var message = $.parseJSON(event.data);\n\n $(\"#events table\")\n .append(\"<tr><td>\" + message.name + \" has entered t...
javascript
edit
0
1
mit
4c9c3ded30c71caa797cee69190d09bf936f6da5
tristandunn/cucumber-websocket-example,tristandunn/cucumber-websocket-example
app/assets/javascripts/application.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\nimport React from 'react';\nimport { mount } from 'enzyme';\nimport { createStore } from 'redux';\n\nimport Phone from '../dev-server/Phone';\nimport App from '../dev-server/containers/App';\nimport brandConfig from '../dev-server/brand...
javascript
edit
0
2
mit
04d1cd56b942f5830e8be4f50c5603d0fed23fed
u9520107/ringcentral-js-widget,ringcentral/ringcentral-js-widget,u9520107/ringcentral-js-widget,ringcentral/ringcentral-js-widget,u9520107/ringcentral-js-widget,ringcentral/ringcentral-js-widget
test/shared.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\nconst env = process.env.BABEL_ENV || process.env.NODE_ENV || 'development';\nconst browsers = process.env.BROWSERSLIST;\n\nconst targets = {};\nif (browsers) {\n targets.browsers = browsers;\n}\nif (env === 'production') {\n targets.u...
javascript
edit
0
9
mit
0bf440d7214159c76d5aa57ea44dd3e431984be2
u-wave/web,welovekpop/uwave-web-welovekpop.club,welovekpop/uwave-web-welovekpop.club,u-wave/web
.babelrc.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\nimport React from 'react';\nimport FocusCore from 'focus-core';\nimport FocusComponents from 'focus-components';\nimport render from 'focus-core/application/render';\nimport Layout from 'focus-components/components/layout';\nimport Conf...
javascript
edit
0
0
mit
d9792a52a49efcf3ad1c4e343d2782a68002719c
KleeGroup/focus-demo-app,get-focus/focus-demo-app,KleeGroup/focus-demo-app,KleeGroup/focus-starter-kit,KleeGroup/focus-starter-kit
app/initializer/layout-initializer.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\nvar webpack = require('webpack');\nvar path = require('path');\nvar fs = require('fs');\nvar assignDeep = require('assign-deep');\nvar values = require('object-values');\nvar configureCommon = require('./configureCommon');\nvar configur...
javascript
edit
0
4
bsd-3-clause
f66815b189260d66090e1f3de5a0967a23fb5155
interactivethings/packup,interactivethings/packup
configure.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\n'use strict';\n\nvar github = require('./github');\nvar npm = require('./npm');\nvar db = require('./db');\nvar email = require('./email');\n\nvar _ = require('underscore');\n\n\nvar cache = {};\n\nvar yesterday = new Date();\nyesterday...
javascript
edit
0
4
mit
a1a087d2db9b67895ee7ac6220e3dc39d969f82a
seriema/npmalerts,creationix/npmalerts
lib/npmalerts.js
rejected_duplicate
Near-duplicate of sample 82785
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\n'use strict'\n\nmodule.exports = wrap\n\nwrap.needed = needed\n\nvar phrasing = require('mdast-util-phrasing')\n\n/* Wrap all inline runs of MDAST content in `paragraph` nodes. */\nfunction wrap(nodes) {\n var result = []\n var length...
javascript
edit
0
6
mit
57b0d056e3ecd7676edc641f75d69e93b06f54c9
syntax-tree/hast-util-to-mdast
lib/util/wrap.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\nimportScripts('https://storage.googleapis.com/workbox-cdn/releases/4.3.1/workbox-sw.js');\n\nworkbox.core.skipWaiting();\nworkbox.precaching.precacheAndRoute([]);\n\n// NOTE: All HTML pages should be dynamically cached, and also constan...
javascript
edit
0
1
mit
7a65f45051fbede11859fd2c044d35982cd9a51a
arnellebalane/arnellebalane.com,arnellebalane/arnellebalane.com,arnellebalane/arnellebalane.com
source/sw.js
accepted
null
true