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\nmodule.exports = (sequelize, Sequelize) => {\n const Comment = sequelize.define('comments', {\n id: {\n type: Sequelize.INTEGER,\n primaryKey: true,\n allowNull: false,\n autoIncrement: true\n },\n body: {\... | javascript | edit | 0 | 1 | mit | bf4b26c1c1ff7e07d394f315545e95b6a550cb58 | lowtalkers/escape-reality,francoabaroa/escape-reality,lowtalkers/escape-reality,francoabaroa/escape-reality | db/models/comments.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nimport CustomAuthenticator from '../authenticators/custom';\nimport CustomAuthorizer from '../authorizers/custom';\n\nexport default {\n name: 'authentication',\n before: 'simple-auth',\n initialize: function (container) {\n conta... | javascript | edit | 0 | 1 | mit | 2c2c0f8876e7297e2edf3610c9e814f383e72789 | Flexberry/ember-flexberry,Flexberry/ember-flexberry,Flexberry/ember-flexberry,Flexberry/ember-flexberry | app/initializers/authentication.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n'use strict';\nvar fs = require('fs');\nvar path = require('path');\nvar merge = require('webpack-merge');\nvar webpack = require('webpack');\n\nmodule.exports = function(config) {\n return new Promise(function(resolve, reject) {\n ... | javascript | edit | 0 | 3 | mit | 5a3c89ca2670e6a00e053366bc6d2d4763210471 | antwarjs/antwar | config/common.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nvar GameInfo = require('module');\n\n'use stricts';\n\n/*\n * Render th first page\n */\n exports.index = function(req, res){\n res.render('index'{\n user : req.user || null\n });\n }\n exports.getGame = function(req, res){\n ... | javascript | edit | null | null | mit | ea6c13ef83ff7d7179ff43d23c71232dc93daf58 | BerniceChua/landr,BerniceChua/landr,BerniceChua/landr | server/controller.js | rejected_syntax | Syntax error detected by tree-sitter | false |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nconst request = require('request');\nconst yargs = require('yargs');\n\n// 68 Studencheskaya street Engels\n\nconst argv = yargs\n .options({\n a: {\n demand: true,\n alias: 'address',\n describe: 'Address to fetch we... | javascript | edit | 0 | 1 | mit | 33f5ab12196fd736efcca458f596692fe840882c | cunctat0r/udemy_nodejs_cource,cunctat0r/udemy_nodejs_cource | weather-app/app.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n/* eslint prefer-arrow-callback: 0, func-names: 0, 'react/jsx-filename-extension': [1, { \"extensions\": [\".js\", \".jsx\"] }] */\n\nimport React from 'react';\nimport assert from 'assert';\nimport { shallow } from 'enzyme';\nimport Ab... | javascript | edit | 0 | 1 | apache-2.0 | d0577eb2422723b2b063cc8661cfa56170a99bd3 | jelliotartz/Panoptes-Front-End,amyrebecca/Panoptes-Front-End,amyrebecca/Panoptes-Front-End,zooniverse/Panoptes-Front-End,jelliotartz/Panoptes-Front-End,amyrebecca/Panoptes-Front-End,jelliotartz/Panoptes-Front-End | app/pages/about/about-home.spec.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n\"use strict\";\n\nannotationApp.service('morphRetriever', function($http) {\n this.getData = function(callback) {\n var result;\n var request = $.ajax({\n url: './static/analyses.json',\n async: false\n });\n\n r... | javascript | edit | 0 | 2 | mit | 1beaa461dd647398b3040fc8b06f048882232591 | fbaumgardt/arethusa,alpheios-project/arethusa,latin-language-toolkit/arethusa,fbaumgardt/arethusa,Masoumeh/arethusa,Masoumeh/arethusa,PonteIneptique/arethusa,alpheios-project/arethusa,PonteIneptique/arethusa,latin-language-toolkit/arethusa,fbaumgardt/arethusa,alpheios-project/arethusa | app/js/services/morph_retriever.js | rejected_duplicate | Near-duplicate of sample 99219 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nconst React = require('react')\nconst {Card, CardActions, CardHeader, CardText} = require('material-ui/Card')\nconst FlatButton = require('material-ui/FlatButton').default\n\n/* eslint-disable react/jsx-indent */\nmodule.exports = ({ re... | javascript | edit | 0 | 1 | isc | 8d84972362aaa3d0fe03ad4831ffbbe6889e4b32 | niklasi/halland-proxy,niklasi/halland-proxy | app/src/components/request-pane.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n/**\n * Default model configuration\n * (sails.config.models)\n *\n * Unless you override them, the following properties will be included\n * in each of your models.\n *\n * For more info on Sails models, see:\n * http://sailsjs.org/#!/... | javascript | edit | 0 | 0 | mit | 47f73cbbdf4c12b7925bc71ffc6de8cb1f424373 | YannBertrand/SimpleSailsChatroom,YannBertrand/SimpleSailsChatroom | config/models.js | rejected_duplicate | Near-duplicate of sample 67984 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nimport Route from '@ember/routing/route';\nimport { inject as service } from '@ember/service';\n\nexport default class FilteredRoute extends Route {\n @service store;\n\n async beforeModel() {\n await this.store.update((t) => {\n ... | javascript | edit | 0 | 1 | mit | 5d43ac93264644b0b4821de3df0f3cf6256a6f4f | orbitjs/ember-orbit,orbitjs/ember-orbit,orbitjs/ember-orbit | tests/dummy/app/routes/filtered.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n$(document).ready(function() {\n\n $(\"a.up-vote-answer\").click(function(event) {\n event.preventDefault();\n console.log(\"we here\");\n }\n );\n\n});\n```\n\nApply this change: Add ajax call for upvotes"
},
{
"r... | javascript | edit | 0 | 1 | mit | ce7f98d32ed99177587848838484e1a76e7fb844 | lucasrsantos1/lucky-ambassador,lucasrsantos1/lucky-ambassador,lucasrsantos1/lucky-ambassador | shaq_overflow/app/assets/javascripts/app.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nvar rectangle = (function (parent) {\n var rectangle = Object.create(parent);\n\n Object.defineProperty(rectangle, 'init', {\n value: function (xCoordinate, yCoordinate, fill, stroke) {\n parent.init.call(this, x... | javascript | edit | 0 | 2 | mit | 6bd313d195acc26650c361b8c05365dec0a3af29 | TeamMoscowMule/MultitaskGame,TeamMoscowMule/MultitaskGame | scripts/rectangle.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nimport React, { Component } from 'react';\nimport {\n AppRegistry,\n StyleSheet,\n Text,\n View,\n Navigator,\n TabBarIOS,\n Dimensions,\n Image,\n TouchableHighlight\n} from 'react-native';\n\nimport MapView from 'react-native... | javascript | edit | 0 | 1 | mit | 586f20a78d81fa6297f5cd1226ec43a827f70346 | Tooconfident/Puppy_PlayDate,Tooconfident/Puppy_PlayDate,Tooconfident/Puppy_PlayDate | PuppyPlayDate/MapScene.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nimport Socket from './socket'\nimport { actions } from '../store/actions'\nimport {\n supportsWebSockets,\n supportsGetUserMedia\n} from '../utils/feature-detection'\n\nconst {\n setToken,\n setWebSocketSupport,\n setGumSupport,\n ... | javascript | edit | 0 | 3 | mit | aec2dd3853efe31c06373c6b999b4f2a9451debf | onfido/onfido-sdk-core | src/connect/index.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nimport ContainerManager from './container_manager';\nimport { LockModes } from '../control/constants';\nimport renderCrashed from '../crashed/render';\nimport renderPasswordlessEmail from '../passwordless-email/render';\nimport renderPa... | javascript | edit | 0 | 3 | mit | 6d53471a7ba379fb95e5af04fca2a1b7602afd4e | mike-casas/lock,auth0/lock-passwordless,mike-casas/lock,auth0/lock-passwordless,mike-casas/lock,auth0/lock-passwordless | src/lock/renderer.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nvar maxLength = 20;\nvar pendingRequest = undefined;\n\nfunction updateResults(e) {\n if (e.which === 0) {\n return;\n }\n var query = $(\"#query\").val();\n if (pendingRequest) {\n pendingRequest.abort();\n }\n pendingReq... | javascript | edit | 0 | 4 | mit | ec9ab13ec943bc021e7359654f16beea38d896ab | albertyw/reaction-pics,albertyw/devops-reactions-index,albertyw/reaction-pics,albertyw/reaction-pics,albertyw/devops-reactions-index,albertyw/devops-reactions-index,albertyw/devops-reactions-index,albertyw/reaction-pics | server/static/app.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n//= require ./core\n\n(function () {\n\"use strict\";\n\n/*\n * State object mixin\n *\n * Requires Object `state` and Array `__changeListeners` properties\n */\n\nMarbles.State = {\n\taddChangeListener: function (handler) {\n\t\tthis._... | javascript | edit | 0 | 1 | bsd-3-clause | 2e5a22e1736cfa663dc38f7e3a3851c67e8e56bb | jvatic/marbles-js,jvatic/marbles-js | src/marbles/state.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nvar _ = require('underscore');\n\nmodule.exports = function(opts) {\n \n var config = {\n base_url: '/database/:dbname/table/:table',\n grainstore: {datasource: global.environment.postgres},\n redis: global.en... | javascript | edit | 0 | 2 | bsd-3-clause | 703fc7dfdae14382b5937dee9f51673f8cec8452 | manueltimita/Windshaft,HydroLogic/Windshaft,CartoDB/Windshaft,CartoDB/Windshaft,wsw0108/Windshaft,CartoDB/Windshaft,manueltimita/Windshaft,HydroLogic/Windshaft,wsw0108/Windshaft,HydroLogic/Windshaft,wsw0108/Windshaft,manueltimita/Windshaft | test/support/server_options.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n'use strict'\n\nconst config = require('./config')\nconst db = require('./db')\nconst app = require('../http/app')\n\ndb.init(config.dbUrl, 'shortlinks').then(() => {\n app.listen(config.port, () => {\n console.log('Server listening... | javascript | edit | 0 | 1 | mit | 5059ee00e4d492de354f0442a5c8293e15a56075 | jotaen/j4n.io,jotaen/j4n.io | app/bootstrap/server.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n'use strict';\n\n/** @type {import('sequelize-cli').Migration} */\nmodule.exports = {\n async up(queryInterface, Sequelize) {\n queryInterface.bulkInsert(\"Subareas\", [{\n id: 1,\n name: \"Alpha\",\n color: Math.floo... | javascript | edit | 0 | 1 | mit | 02bc73aac9b1a616dcdcbdcd418254efd0af4ce1 | ScoutingIJsselgroep/Jotihunt,ScoutingIJsselgroep/Jotihunt,ScoutingIJsselgroep/Jotihunt | seeders/20220928200618-subarea.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nimport app from 'flarum/app';\n\nimport AkismetSettingsModal from './components/AkismetSettingsModal';\n\napp.initializers.add('flarum-akismet', () => {\n app.extensionSettings['flarum-akismet'] = () => app.modal.show(new AkismetSettin... | javascript | edit | 0 | 1 | mit | e4fa9a38d761df687b5a87f69af015cb74030412 | flarum/akismet,flarum/akismet,flarum/akismet | js/src/admin/index.js | rejected_duplicate | Near-duplicate of sample 95642 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n/**\n * Copyright (c) 2014 by Center Open Middleware. All Rights Reserved.\n * Titanium Appcelerator 3.3.0GA\n * Licensed under the terms of the Apache Public License\n * Please see the LICENSE included with this distribution for detail... | javascript | edit | 0 | 3 | apache-2.0 | 6702552092059a52ab3ad3bc1c5b7c62a4ddcdcc | Wirecloud/wirecloud-mobile,Wirecloud/wirecloud-mobile | Resources/app.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n/**\n * Created by meysamabl on 11/1/14.\n */\n\n$(document).ready(function () {\n// $('#picture').change(function () {\n// $(\"#catForm\").ajaxForm({ target: \"#image_view\" }).submit();\n// return false;\n// });\n\... | javascript | edit | 0 | 2 | apache-2.0 | 6ba19e069a2a8a7cd4074c8a9d7bda5df3d59faa | zarest/zarest-commerce,zarest/zarest-commerce | public/javascripts/admin.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nTemplate.postPage.onCreated( () => {\n var t = Template.instance();\n t.subscribe('listForId',FlowRouter.getParam('id'));\n});\n\nTemplate.postPage.helpers({\n post: () => {\n return List.findOne();\n }\n});\n```\n\nA... | javascript | edit | 0 | 1 | mit | fd29d12c536bc3163b9e28dbde5a4c7cad0671fe | lnwKodeDotCom/WeCode,lnwKodeDotCom/WeCode | client/templates/post/post_page.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n/**\n * Copyright 2014, Yahoo! Inc.\n * Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms.\n */\n'use strict';\nvar createStore = require('fluxible-app/utils/createStore');\n\n\nvar TimeStore = c... | javascript | edit | 0 | 1 | bsd-3-clause | b771c8eee6f2d607b643bf0231eb967b1f63e1f3 | jeffreywescott/flux-examples,joshbedo/flux-examples,JonnyCheng/flux-examples,devypt/flux-examples,ybbkrishna/flux-examples,src-code/flux-examples,michaelBenin/flux-examples,eriknyk/flux-examples | routing/stores/TimeStore.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nimport 'instapromise';\n\nimport fs from 'fs';\nimport logger from 'gulplog';\nimport path from 'path';\nimport spawnAsync from '@exponent/spawn-async';\n\nconst paths = {\n template: path.resolve(__dirname, '../template'),\n template... | javascript | edit | 0 | 4 | mit | 529c1e82de484c1cdc55da76f124a1ab8cca232d | exponentjs/xdl,exponentjs/xdl,exponentjs/xdl | gulp/release-tasks.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nimport { tracked } from '@glimmer/tracking';\nimport { Resource } from 'ember-could-get-used-to-this';\nexport default class ResolveAsyncValueResource extends Resource {\n @tracked data;\n\n get value() {\n return this.data;\n }\n... | javascript | edit | 0 | 2 | mit | 0e0defaf7ed906386c0c348b18252e8a308dbc3c | ilios/common,ilios/common | addon/classes/resolve-async-value.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nconst webpack = require('webpack');\nconst BrowserSyncPlugin = require('browsersync-webpack-plugin');\n\nconst config = require('./config');\n\nmodule.exports = {\n output: {\n pathinfo: true,\n publicPath: config.proxyUrl + conf... | javascript | edit | 0 | 0 | mit | 790c3d9bcbb8a559f6e36d119369931117a7d9d9 | PCHC/pharmacyresidency2017,generoi/sage,kalenjohnson/sage,ChrisLTD/sage,roots/sage,NicBeltramelli/sage,ptrckvzn/sage,democracy-os-fr/sage,agusgarcia/sage9,c50/c50_roots,NicBeltramelli/sage,gkmurray/sage,ChrisLTD/sage,ChrisLTD/sage,kalenjohnson/sage,ChrisLTD/sage,c50/c50_roots,levito/kleineweile-wp-theme,kalenjohnson/sa... | assets/build/webpack.config.watch.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nvar temp = require('../lib/temp'),\n fs = require('fs'),\n util = require('util'),\n exec = require('child_process').exec;\n\nvar myData = \"foo\\nbar\\nfoo\\nbaz\";\n\ntemp.open('myprefix', function(err, info) {\n if (err) ... | javascript | edit | 0 | 2 | mit | a098d921a11065059f06555074b9d810b2431786 | hildjj/node-temp,bruce/node-temp | examples/grepcount.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n(function() {\n\n 'use strict';\n\n describe('angular-feedback', function() {\n\n beforeEach(module('angular-feedback'));\n\n /*\n var feedbackProvider;\n\n beforeEach(function() {\n // Here ... | javascript | edit | 0 | 1 | mit | 56e1a8ebaa5cff84c9a188b0d03cea0074d02bab | andreipfeiffer/angular-feedback | spec/feedbackSpec.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n// Use the gulp-help plugin which defines a default gulp task\n// which lists what tasks are available.\nvar gulp = require('gulp-help')(require('gulp'));\n\n// Sequential Gulp tasks\nvar runSequence = require('run-sequence').use(gulp);... | javascript | edit | 0 | 1 | mit | d661f3e064ceed22990e913af5c71a101825653e | oss-specs/specs,oss-specs/specs | gulp-tasks/testing.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nvar Path = require('path')\nglobal.CONFIG = require('./index.json')\nCONFIG.projectFile = (path) => Path.resolve(__dirname, '../..', path)\n\n\nmodule.exports = function config (router) {\n for (var item of CONFIG.routerPipeline) {\n ... | javascript | edit | 0 | 4 | mit | 328d1abab5fd2f21b5c9392d7df23b88a6f8d003 | Concatapult/pult,Concatapult/pult,Concatapult/pult | base-template/server/config/index.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nimport React from \"react\";\nimport ReactDOM from \"react-dom\";\nimport YoutubeEmbedVideo from 'youtube-embed-video';\n\nReactDOM.render(<YoutubeEmbedVideo size=\"large\" videoId=\"RnDC9MXSqCY\" suggestions={false} />, document.getEle... | javascript | edit | 0 | 0 | mit | e15defc90cff15889c30abe86d8c21221c4736c1 | Tiendq/youtube-embed-video | examples/app.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nconst Boom = require('boom');\n\nexports.register = function (server, options, next) {\n if (!options) options = {};\n const policies = options.policies || [];\n\n // General check function\n check = async(user, action, targ... | javascript | edit | 0 | 7 | mit | 72a8c966ba842baa557524a62f7e82c2b011c634 | bakjs/bak,fandogh/bak | lib/policy/authorize.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nconst Plugin = require('imdone-api')\nconst _path = require('path')\nconst { statSync } = require('fs')\n\nmodule.exports = class ExtensionPlugin extends Plugin {\n constructor(project) {\n super(project)\n console.log('loading e... | javascript | edit | 0 | 2 | mit | b8d5354c1ca0f06c41b0c3f4c271cdf0f4ca3585 | imdone/imdone-core,imdone/imdone-core | lib/extension-plugin.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nfunction render(world) {\n var rendering = '';\n for (var y = world.boundaries()['y']['min']; y <= world.boundaries()['y']['max']; y++) {\n for (var x = world.boundaries()['x']['min']; x <= world.boundaries()['x']['max']; x++) {\n ... | javascript | edit | 0 | 4 | mit | 12618aa1792803acc7635451befd13f77faeb3ae | KieranP/Game-Of-Life-Implementations,KieranP/Game-Of-Life-Implementations,KieranP/Game-Of-Life-Implementations,KieranP/Game-Of-Life-Implementations,KieranP/Game-Of-Life-Implementations,KieranP/Game-Of-Life-Implementations,KieranP/Game-Of-Life-Implementations,KieranP/Game-Of-Life-Implementations,KieranP/Game-Of-Life-Imp... | javascript/play.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n'use strict';\n\n/**\n * Module dependencies.\n */\nvar cron = require('cron'),\n\tpingdom = require('pingdom-api');\n\nexports.init = function(){\n\tconsole.log('initttttttt');\n};\n```\n\nApply this change: Add a cronjob that runs eve... | javascript | edit | 0 | 1 | mit | 9cdb56f072286f6be2db88c3fe6ec9ec660a1b86 | rsdebest/pingtool,rsdebest/pingtool,rsdebest/pingtool | app/controllers/pingdom.server.controller.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nimport React from 'react';\nimport { storiesOf } from '@storybook/react';\nimport withReadme from 'storybook-readme/with-readme';\nimport Readme from './readme.md';\n\nimport Accordion from './Accordion';\n\nstoriesOf('Accordion', modul... | javascript | edit | 0 | 1 | apache-2.0 | d6c9063694f3052f5b0270de18667b2b3dc45316 | folio-org/stripes-components,folio-org/stripes-components | lib/Accordion/Accordion.stories.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nvar _ = require('lodash');\n\n/**\n * Sets options\n * @param {Object} [options]\n * @param {String[]} [options.ignoreAttributes]\n * @param {String[]} [options.compareAttributesAsJSON]\n * @param {Boolean} [options.ignoreWhitespaces=tr... | javascript | edit | 0 | 4 | mit | deac25ca15e9a2bf31ba207c6f3aec5efc684bd1 | bem/html-differ,bem/html-differ | lib/utils/defaults.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nmodule.exports = [\n {\n collection: 'attachments',\n spec: { key: 1 },\n options: { unique: true }\n },\n {\n collection: 'entries',\n spec: { locationId: 1 },\n options: {}\n },\n {\n collection: 'events',\n ... | javascript | edit | 0 | 0 | mit | 08f7cd695a147bd62324565846047ce68b8fbac6 | axelpale/tresdb,axelpale/tresdb | local_modules/tresdb-db/indices.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nimport WrapperBuilder from './wrapper';\nimport { shallow, mount } from 'enzyme';\nimport React from 'react';\n\nconst CheckedFixture = () => (\n <input type=\"checkbox\" defaultChecked value=\"coffee\" />\n);\n\n// const NotCheckedFix... | javascript | edit | 0 | 1 | mit | 0089918d2b03b5fb6196861448a393127a92c554 | rkotze/should-enzyme | src/checked.spec.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n/**\n * DashboardController\n *\n * @description :: Server-side logic for managing Dashboards\n * @help :: See http://links.sailsjs.org/docs/controllers\n */\n\nmodule.exports = {\n index: function (req, res) {\n if(!re... | javascript | edit | 0 | 2 | mit | c6e1d1685efe55edb048d3ad34f14239ffe62b85 | kumpelblase2/modlab,kumpelblase2/modlab | api/controllers/DashboardController.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n'use strict';\n\nimport emptyFunction from '../utils/empty-function';\n\nfunction initializeShopifyPlatform(context, currentConfig, hull) {\n\n const { customerId, accessToken, callbackUrl } = currentConfig.get();\n\n if (!customerId ... | javascript | edit | 0 | 5 | mit | 5be7b88174faa8925223eab62498a9ba61680497 | hull/hull-js,hull/hull-js,hull/hull-js | src/client/initialize-platform.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n'use strict';\n\nangular.module( 'ngynServerConnection' )\n .value( 'defaultResponseInterceptors', {\n jsonNetStripper: function( hubName, methodName, response ) {\n if ( response.$values ) {\n return response.$values;\n... | javascript | edit | 0 | 3 | mit | faf80832c80b16ed10d3fde70fd2da1475120206 | configit/ngyn | src/server-connection/server-connection-default-response-interceptors.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nexport function textViewBuilder(node) {\n var view = document.createElement(\"div\");\n var textView = document.createElement(\"div\");\n textView.style.whiteSpace = \"pre-wrap\";\n\n view.appendChild(textView);\n\n if (node.value ... | javascript | edit | 0 | 3 | mit | 215485b42d4249ac668617fd416dd4b2e154532d | lynx-json/jsua-lynx | src/builders/text-view-builder.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nclass TestBackend {\n constructor(manager) {\n this.actions = manager.getActions();\n }\n\n setup() {\n this.didCallSetup = true;\n }\n\n teardown() {\n this.didCallTeardown = true;\n }\n\n simulateBeginDrag(sourceIds, o... | javascript | edit | 0 | 1 | mit | 100f297b02149079f3b09bfff267d32be1acb514 | zetkin/dnd-core,gaearon/dnd-core,randrianov/dnd-core,zetkin/dnd-core,mattiasgronlund/dnd-core | src/backends/createTestBackend.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n/*\n * Copyright 2020 Google LLC\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 * http... | javascript | edit | 0 | 2 | apache-2.0 | 73ddb98197c2ca879880efb8d51d168253f380a8 | googleinterns/voxetta,googleinterns/voxetta,googleinterns/voxetta | ui/src/utils/QualityControl.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nmodule.exports = {\n borderWidth: 5,\n strokeWidth: 0.1,\n // in percentage of borderWidth\n outlineWidth: 0.2,\n outlineStyle: \"#FFF\",\n\n /**\n * Provide a custom stroke function that draws a fat white line THEN a\n * narr... | javascript | edit | 0 | 1 | mit | d48ef82944f27ae9cccf7a12e0d58419da86c561 | iFixit/node-markup,iFixit/node-markup,iFixit/node-markup | mixins/highlighted_stroke.mixin.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n'use strict';\n\nconst { EventEmitter } = require('events');\n\nconst logger = require('./logger')('server-impl.js');\nconst migrator = require('../migrator');\nconst getApp = require('./app');\n\nconst { startMonitoring } = require('./... | javascript | edit | 0 | 2 | apache-2.0 | d8f8bf6fd961de69ff432261b5af8fa10479c2ef | finn-no/unleash,Unleash/unleash,Unleash/unleash,Unleash/unleash,finn-no/unleash,Unleash/unleash,finn-no/unleash | lib/server-impl.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nimport { createAction } from 'redux-actions'\nimport { createEvent as createAPI, showEvent as showAPI } from '../api/Event'\nimport Actions from '../constants/Actions'\nimport errorUrls from '../constants/ErrorUrls'\nimport ActionDispat... | javascript | edit | 0 | 1 | mit | b2adbf066323a600f4728c21d66862c070a0467b | gazayas/tebukuro,gazayas/tebukuro,gazayas/tebukuro,gazayas/tebukuro,ytorii/tebukuro,ytorii/tebukuro,ytorii/tebukuro,ytorii/tebukuro | front/client/actions/Event.js | rejected_duplicate | Near-duplicate of sample 72336 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n'use strict';\n\nvar assert = require('assert')\nvar handlebars = require('handlebars')\nvar cssInjector = require('../wrappers/cssInjector')\nvar assetManager = require('./assetManager')\n\n/**\n * Class to handle css and html... | javascript | edit | 0 | 1 | mit | 06746ed23aee3ab6ff931ea89c90a38893cb4b64 | mediasuitenz/mappy,mediasuitenz/mappy | lib/popupPresenter.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nvar nullEvents = require('./nullEvents.js');\n\nmodule.exports = createDocumentEvents();\n\nfunction createDocumentEvents() {\n if (typeof window === undefined) {\n return nullEvents;\n }\n\n return {\n on: on,\n off: off\n ... | javascript | edit | 0 | 2 | bsd-3-clause | 9824a59c2a94db807924ffced01fe43cdb036d86 | rlugojr/VivaGraphJS,rlugojr/VivaGraphJS | src/Utils/windowEvents.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\ndocument.addEventListener(\"turbolinks:load\", function() {\n function inventoryButtonClickHandler(e) {\n e.preventDefault();\n let formInputs = document.getElementById('form-inputs');\n time = new Date().getTime()\n regexp... | javascript | edit | 0 | 2 | mit | afdc029605de38f0b70216d9dc41e232f5c93e90 | enthusiastick/my_crossroads,enthusiastick/my_crossroads,enthusiastick/my_crossroads,enthusiastick/my_crossroads | app/assets/javascripts/inventories.index.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nimport Ember from 'ember';\nimport md5 from 'md5';\n\nexport default Ember.Component.extend({\n tagName: 'img',\n attributeBindings: ['src', 'alt', 'title'],\n classNames: ['gravatar-image'],\n size: 250,\n email: '',\n title: '',... | javascript | edit | 0 | 2 | mit | 2f4cf118d5748569acd77d861503a91d24a776e5 | johnotander/ember-cli-gravatar,johnotander/ember-cli-gravatar | addon/components/gravatar-image.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nmodule.exports.unit = {\n environment: 'node',\n rootPath: process.cwd(),\n sources: [\n 'lib/**/*.js'\n ],\n tests: [\n 'test/**/*.js'\n ],\n extensions: [\n require('buster-istanbul')\n ],\n 'buster-istanbul': {\n ... | javascript | edit | 0 | 0 | mit | ecdb97ae3553772a88afd1cb8d7e9edd3f122a68 | cliffano/bob | conf/buster-coverage.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n/*\n * Mixin for resources that are children of a draft resource.\n *\n * This will ensure that the draft is in a proper state before operating\n * on the resource.\n */\nRB.DraftResourceChildModelMixin = {\n /*\n * Calls a funct... | javascript | edit | 0 | 2 | mit | 2b3a1d54ff611dc1919282eac0803f83ae4e655e | bkochendorfer/reviewboard,1tush/reviewboard,reviewboard/reviewboard,custode/reviewboard,1tush/reviewboard,chipx86/reviewboard,KnowNo/reviewboard,KnowNo/reviewboard,sgallagher/reviewboard,brennie/reviewboard,beol/reviewboard,chipx86/reviewboard,davidt/reviewboard,1tush/reviewboard,KnowNo/reviewboard,beol/reviewboard,beo... | reviewboard/static/rb/js/resources/models/draftResourceChildModelMixin.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nimport React from 'react';\nimport Icon from '../../../Icon';\n\nconst MediaDevicesControls = ({ snaps, areMultipleVideoDevices, handleVideoDeviceChange }) => (\n <div\n className=\"experiment__playground__content--media-devices__co... | javascript | edit | 0 | 3 | mit | fbb153862dd281c6f491ba0a93955fe9e6b38157 | soyguijarro/magic-web,soyguijarro/magic-web | src/components/Experiment/Playground/MediaDevices/MediaDevicesControls.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n\nmodule.exports = {\n extends: [\n 'eslint-config-airbnb-base/rules/best-practices'\n ],\n rules: {\n // Enforce that class methods use `this`\n // http://eslint.org/docs/rules/class-methods-use-this\n 'class-methods-use... | javascript | edit | 0 | 0 | mit | 547c90c7b2c93c65aa2c6306da36cbc3681fd727 | njakob/eslint-config | lib/best-practices.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nimport Ember from 'ember';\n\nexport default Ember.Component.extend({\n\n foundation: null,\n\n currentClassName: Ember.computed(\"className\", function(){\n return this.get(\"className\") ? `.${this.get('className')}` : document;\... | javascript | edit | 0 | 2 | mit | 951d3a877b48ee623713f8af7daec9fbfbe6b7ce | crossroads/shared.goodcity,crossroads/shared.goodcity | app/components/init-foundation.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nvar extURL = chrome.extension.getURL(\"tabs.html\");\n\nfunction openMyPage() {\n\tbrowser.windows.getCurrent({}).then(function(window) {\n\t\treturn browser.tabs.query({windowId: window.id});\n\t}).then(function(tabs) {\n\t\t//check fo... | javascript | edit | 0 | 6 | mit | 9bd0feab475daa578b40d3875e95b01a149165fb | fiveNinePlusR/tabist,fiveNinePlusR/tabist,fiveNinePlusR/tabist | tabist/background.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nconst fs = require('fs');\nconst path = require('path');\n\nconst exec = require('child_process').exec;\nconst nodepath = process.env._;\nconst version = process.versions.v8;\nconst tmpfile = path.join(__dirname, version+'.flags.json');... | javascript | edit | 0 | 2 | mit | cb4e0e3a06046d3550a449a6a5716251dc4a60ec | js-cli/js-v8flags,tkellen/js-v8flags | fetch.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nimport React, { Component } from 'react';\nimport * as d3 from 'd3';\n\nclass Drawing extends React.Component {\n constructor(props) {\n super(props);\n\n this.state = {\n drawing: null,\n };\n }\n\n componentDidMount()... | javascript | edit | 0 | 1 | mit | b683a0d862159b376f4f2ee69bb8e9367c21bdb7 | rjbernaldo/lines,rjbernaldo/lines | src/components/Drawing.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nimport { Platform, StyleSheet } from 'react-native';\nimport { colors } from '../../styles';\n\nconst styles = StyleSheet.create({\n root: {\n height: 1,\n backgroundColor: colors.grey,\n opacity: 0.5,\n },\n shadow: {\n ... | javascript | edit | 0 | 0 | apache-2.0 | 6d2bfaa51b816843ff038f5502b495328c92e129 | JSSolutions/Perfi | app/components/Separator/styles.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nmodule.exports = function(multiLang){\n\n const MoviePoster = require('./movie-poster')(multiLang);\n\n function selectTemplate(templateName) {\n let template = null;\n\n switch (templateName) {\n case 'MoviePoster':\n ... | javascript | edit | 0 | 2 | mit | 9430f00ad994b192322b2f7ad3063fdaa7af72e6 | newvertex/FreeNightTelegramBot | templates/manager.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nvar PassThrough = require('stream').PassThrough\nvar inherits = require('util').inherits\n\nfunction SeriesStream () {\n PassThrough.apply(this, arguments)\n this._current = null\n this._queue = []\n}\ninherits(SeriesStream, PassThro... | javascript | edit | 0 | 3 | isc | cb924f6ae065f5b1aea16710b5b588ca8370b1ec | alanshaw/series-stream | index.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nconst Commando = require('discord.js-commando')\n\nmodule.exports =\nclass Command extends Commando.Command {\n constructor(client, info) {\n info.group = 'rover';\n info.guildOnly = true;\n info.memberName = inf... | javascript | edit | 0 | 2 | apache-2.0 | 01eee15a0a1306121a33152d4df8e1c94840cbf0 | evaera/RoVer | src/commands/Command.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nvar opener = require('opener');\nvar http = require('http');\nvar fs = require('fs');\nvar url = require('url');\nvar exec = require('child_process').execSync;\n\nvar registry = exec('npm config get registry').toString().trim()\n\nopene... | javascript | edit | 0 | 2 | mit | 09b5001145ca91dad561d360404f2bb48c274890 | soundtrackyourbrand/sinopia-github-oauth-cli,soundtrackyourbrand/sinopia-github-oauth-cli | index.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nvar fs = require('fs');\nvar rest = require(__dirname + \"/lib/rest\");\nvar unzip = require(\"unzip2\");\n\nmodule.exports = {\n hello: function() {\n\t return \"Hi!\"\n }\n}\n```\n\nApply this change: Bring in the first function."
... | javascript | edit | null | null | apache-2.0 | 682f05e5b372593a5cee89e651372ad01d3090df | IBM-Blockchain/ibm-blockchain-js | index.js | rejected_syntax | Syntax error detected by tree-sitter | false |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nvar bridge = require('vigour-native/lib/bridge')\nvar env = require('vigour-native/lib/env')\n// var name = 'plugin'\nvar id = 'vigour-native-plugin'\nvar supportedPlatforms = [\n 'android',\n 'ios'\n]\nvar supportedDevices = [\n 'ph... | javascript | edit | 0 | 2 | bsd-2-clause | fd980be3a4251e66157be907123e93c09e173dfe | vigour-io/statusbar,vigour-io/statusbar | index.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n'use strict'\n\nconst standard = require('standard')\nconst format = require('util').format\nconst assign = require('object-assign')\nconst loaderUtils = require('loader-utils')\n\nmodule.exports = function standardLoader (text) {\n co... | javascript | edit | 0 | 3 | isc | efcf34f201a88b4f1226eb958d633207024ed422 | timoxley/standard-loader | index.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n'use strict'\n\nvar commentMarker = require('mdast-comment-marker')\n\nmodule.exports = commentconfig\n\n// Modify `processor` to read configuration from comments.\nfunction commentconfig() {\n var proto = this.Parser && this.Parser.pr... | javascript | edit | 0 | 12 | mit | bba1a9b1743826cac147cd6f7d84b9731acf9ddc | wooorm/mdast-comment-config | index.js | rejected_complexity | Cyclomatic complexity too high: 12 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nmodule.exports = {\n\tinit: function() {\n\t\tvar client = this\n\t\tfunction isClient(name) {\n\t\t\tvar agent = window.navigator.userAgent,\n\t\t\t\tindex = agent.indexOf(name)\n\t\t\tif (index < 0) { return false }\n\t\t\tclient.vers... | javascript | edit | 0 | 3 | mit | 5afbebd6633ba70b3ebdef3ce0adec6676a9b40f | marcuswestin/std.js,ASAPPinc/std.js | client.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nvar through2 = require('through2');\nvar File = require('vinyl');\nvar path = require('path');\n\nmodule.exports = function (filename, baseDir) {\n var ins = through2()\n var out = false\n\n var opts = {\n contents: ins\... | javascript | edit | 0 | 4 | mit | ab2e545f788854393547b9cf955e2c6ddaf8ddd9 | hughsk/vinyl-source-stream | index.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nvar debug = require( 'debug' )( 'wpcom-vip' );\nvar request = require( './lib/util/request' );\n\n// Modules\n\n\nfunction WPCOM_VIP( token ) {\n this.req = new Request( this );\n\n this.auth = {};\n}\n\nWPCOM_VIP.protot... | javascript | edit | 0 | 1 | mit | f1e1fa27c073ea9f452abb80b882c2e88f5fbeab | Automattic/vip-js-sdk | index.js | rejected_duplicate | Near-duplicate of sample 96054 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\ntype SourceLocation = {\n line: number,\n column: number\n};\n\nexport default class LinesAndColumns {\n constructor(string: string) {\n this.string = string;\n\n const lineLengths = [];\n let start = 0;\n while (true) {\... | javascript | edit | null | null | mit | 45e4e677b5c9840a8eb03ec8d42bd5cfe2a86f97 | eventualbuddha/lines-and-columns,eventualbuddha/lines-and-columns | index.js | rejected_syntax | Syntax error detected by tree-sitter | false |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nvar conf = require(\"./server/conf\"),\n app = require(\"./server/app\"),\n log = conf.log;\n\n \n\napp.listen(conf.PORT, function() {\n log.info(\"Server_listening on port %s\", conf.PORT);\n});\n```\n\nApply this change:... | javascript | edit | 0 | 1 | mit | 2c3fd0151118a3ab537b6318b2c9aeb839b78c31 | r3Fuze/base | index.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nexports.encode = exports.stringify = function (value) {\n var values = [value];\n var table = [];\n\n for (var v = 0; v < values.length; ++v) {\n value = values[v];\n if (value && typeof value === \"object\") {\n var copy ... | javascript | edit | 0 | 6 | mit | d75d0c9e4c1c8a948d227cfdeb19925163e111b9 | benjamn/arson | 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\nconsole.log('Hello World!');\n```\n\nApply this change: Add cli options using commander"
},
{
"role": "assistant",
"content": "#!/usr/bin/env node\n\n'use strict';\n\nconst program = r... | javascript | edit | 0 | 0 | mit | 98a885bed6d1fde11599d7f44d955339160b0f2c | joelgeorgev/google-wifi-status | index.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nimport {\n AppRegistry,\n StatusBar,\n} from 'react-native';\n\nimport Finance from './Finance';\n\nStatusBar.setBarStyle('light-content', true);\n\nAppRegistry.registerComponent('Finance', () => Finance);\n\n```\n\nApply this change:... | javascript | edit | 0 | 1 | mit | 920dbc6a1de0a8b0715a82d331f4dc9fe2b39611 | 7kfpun/FinanceReactNative,7kfpun/FinanceReactNative,7kfpun/FinanceReactNative | index.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n/* jshint node: true */\n'use strict';\n\nvar imagemin = require('broccoli-imagemin');\n\nmodule.exports = {\n name: 'ember-cli-imagemin',\n\n included: function(app) {\n this.app = app;\n\n var defaultOptions = {\n enabled... | javascript | edit | 0 | 5 | mit | a2891c09a90f3cc8682eee869eb2f0cf2bda5c2f | andybluntish/ember-cli-imagemin,andybluntish/ember-cli-imagemin | index.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nconst path = require('path');\nconst fs = require('fs');\n\n\nfunction findFile(cwd, pattern, cb) {\n fs.readdir(cwd, function(err, files){\n if(err) {\n console.log(\"Error in reading dir\");\n cb(err, null);\n } else ... | javascript | edit | 0 | 4 | mit | dcf5407b30d695a25856961555d9fd67b10ca909 | AkashBabu/file-regex | index.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n\"use strict\";\nconst pattern = /^\\s*(\\d+)(?:\\s*;(?:\\s*url\\s*=)?\\s*(.+)?)?$/i;\n\n\n\nconst parseMetaRefresh = content =>\n{\n\tconst result = { timeout:null, url:null };\n\tcontent = pattern.exec(content);\n\n\tif (content !== n... | javascript | edit | 0 | 4 | mit | f0fb357c989f23f21402adc46558e7924d2b710c | stevenvachon/http-equiv-refresh | index.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n'use strict';\n\nconst os = require('os');\nconst toarray = require('lodash/toArray');\nconst defaults = require('lodash/defaults');\nconst map = require('lodash/map');\nconst debug = require('debug')('asset-resolver');\nconst Bluebird ... | javascript | edit | 0 | 4 | mit | 6024be16f23c89ed425bc8b9b269859db22bf1bd | bezoerb/asset-resolver | index.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n'use strict'\n\nconst tokens = require('../database/tokens')\nconst config = require('../utils/config')\nconst KnownError = require('../utils/KnownError')\nconst ignoreCookie = require('../utils/ignoreCookie')\n\nconst response = (entry... | javascript | edit | 0 | 5 | mit | f86eddce1591dbfae4cc7601bf0f3e18a62b12b3 | electerious/Ackee | src/resolvers/tokens.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nvar can = require('can/util/util');\nvar RBTree = require('./lib/rbtree');\n\n// Add event utilities\ncan.extend(RBTree.prototype, can.event);\n\n// Trigger a \"add\" event on successful insert\nvar _insert = RBTree.prototype.insert;\nR... | javascript | edit | 0 | 5 | mit | f736b118113f781236d6dcb6f44e5a9b838f658d | canjs/can-binarytree,akagomez/can-binarytree,akagomez/can-binarytree,canjs/can-binarytree | index.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nvar pbkdf2 = require('crypto').pbkdf2\n , randomBytes = require('crypto').randomBytes;\n\nexports.verify = function(password, hash, callback) {\n hashParts = hash.split('$');\n var iterations = hashParts[2] * 500;\n var salt = hashP... | javascript | edit | 0 | 3 | mit | ddc1a606943b45871c8f7ac669ab2c946fd9b7ac | kudos/node-passwords | index.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n#! /usr/bin/env node\nlet program = require('commander')\nlet configResolver = require('./src/configResolver')\nlet configWriter = require('./src/configWriter')\nlet interpolationResolver = require('./src/interpolationResolver')\n\nlet ... | javascript | edit | 0 | 2 | mit | fea2334c4fe527b6e0d239cb27686bd20922ece5 | tOgg1/typical | index.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n/* jshint node: true */\n'use strict';\n\nmodule.exports = {\n name: 'ember-power-select',\n\n included: function(appOrAddon) {\n var app = appOrAddon.app || appOrAddon;\n if (!app.__emberPowerSelectIncludedInvoked) {\n app... | javascript | edit | 0 | 9 | mit | cb29d306bd8be1ba163809c502e7fdbcabe27e0a | esbanarango/ember-power-select,cibernox/ember-power-select,cibernox/ember-power-select,cibernox/ember-power-select,cibernox/ember-power-select,esbanarango/ember-power-select,esbanarango/ember-power-select | index.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nvar express = require('express');\nvar app = express();\n\napp.get('/', function(req, res){\n res.send('hello world');\n});\n\napp.get('/sayhello', function (req, res){\n res.setHeader('Content-Type', 'application/json');\n res.send(... | javascript | edit | 0 | 1 | mit | 8f736cac4c94d4f02c909f3091904eb2ccc47e23 | codehackdays/HelloWorld | index.js | rejected_duplicate | Near-duplicate of sample 95621 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n/*!\n * to-clipboard <https://github.com/jonschlinkert/to-clipboard>\n *\n * Copyright (c) 2015, Jon Schlinkert.\n * Licensed under the MIT License.\n */\n\n'use strict';\n\nvar cp = require('child_process');\n\nfunction toClipboard(arg... | javascript | edit | 0 | 5 | mit | e562f0ed78ddae0603ba1f012c87d34b0c2606d6 | jonschlinkert/to-clipboard | index.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nvar package = require('package')\nvar join = require('path').join\n\nfunction merge (a, b) {\n for(var k in b) {\n a[k] = b[k]\n }\n return a\n}\n\nmodule.exports = function (start, opts) {\n start = start || process.cwd()\n var... | javascript | edit | 0 | 5 | mit | e2a50a3cf0fda4f78d99b8e3c314077f56ec04cd | dominictarr/get-deps | index.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n/*jslint node:true */\nvar RequireAll = (function () {\n 'use strict';\n \n var fs = require('fs'),\n\n excludeDirectory = function (excludeDirs, dirname) {\n return excludeDirs && dirname.match(excludeDirs);\... | javascript | edit | 0 | 4 | mit | 816551098f9a61bb47b61fffd15a6919e58b2647 | jaalfaro/node-require-all | index.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n'use strict';\n\nmodule.exports = toMDAST;\n\nvar minify = require('rehype-minify-whitespace')();\nvar xtend = require('xtend');\nvar one = require('./one');\nvar handlers = require('./handlers');\n\nh.augment = augment;\n\nfunction toM... | javascript | edit | 0 | 7 | mit | a404d8d12abeaeae083368f8b5394ac2f998da32 | syntax-tree/hast-util-to-mdast | index.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n/*\n extract url or data-url from css\n - value - css value\n*/\nfunction urldata(value){\n if(!value){\n return;\n }\n var result = [];\n var urlCursor = value.indexOf(\"url\");\n var start = 0;\n var end = 0;\n while(urlCu... | javascript | edit | 0 | 17 | mit | e7c1d28564d6dacd8e912e7f0251696ccff9dd16 | lexich/urldata | index.js | rejected_complexity | Cyclomatic complexity too high: 17 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nvar dgram = require('dgram');\n\nconst PORT = 5050\nconst PING_PAYLOAD = \"dd00000a000000000000000400000002\"\nconst POWER_PAYLOAD = \"dd02001300000010\"\n\nmodule.exports = Xbox;\n\nfunction Xbox(ip, id) {\n this.ip = ip;\n this.id =... | javascript | edit | 0 | 2 | mit | bfa6210296d890b02f1f1f7acc7687824d4a1ea2 | arcreative/xbox-on | index.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n/* jshint node: true */\nvar PLUGIN_NAME = 'gulp-multi-dest';\nvar through = require('through2');\nvar gulp = require('gulp');\nvar async = require('async');\n\nmodule.exports = function(paths, options) {\n\toptions = options || {};\n\t... | javascript | edit | 0 | 3 | mit | 6c6060d667e06db6a2fd51eae924630832c9e9c9 | kdelmonte/gulp-multi-dest | index.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n'use strict';\n\napp.controller('CheckoutCtrl', function($scope, Basket, Order, AuthenticationService) {\n $scope.basket = Basket;\n $scope.currentUser = AuthenticationService.currentUser();\n var hour = 60 * 60 * 1000; // 1 Hour in ... | javascript | edit | 0 | 1 | mit | f5873fa7be7d537c68f584706c9ed3ec5d74d83d | scootcho/TMA-client,scootcho/TMA-client,diraulo/TMA-client,AgileVentures/TMA-client,AgileVentures/TMA-client,diraulo/TMA-client | app/scripts/controllers/checkout.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n//Require Module\nvar log4js = require('log4js');\nvar logger = log4js.getLogger('Logging');\n\nfunction sendAliveMail (connection,opt,callback){\n\n logger.debug('Sending Alive Mail......');\n\n connection.send(opt,callback);\n}\... | javascript | edit | 0 | 1 | apache-2.0 | e9ad2ee5eb506cfeeef01f633916ccfc949d443c | dollars0427/SQLwatcher | email.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n// Backbone.Collection.search-ajax v0.2\n// by Joe Vu - <EMAIL>\n// For all details and documentation:\n// https://github.com/homeslicesolutions/backbone-collection-search\n\n!function(_, Backbone){\n\n // Extending out... | javascript | edit | 0 | 2 | mit | 6b8ad9f04dfcae7fa830f30e82a52590c231a00b | homeslicesolutions/backbone-collection-search,homeslicesolutions/backbone-collection-search | backbone-collection-search-ajax.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nvar elixir = require('laravel-elixir');\nvar compile = require('./ingredients/commands/CompileCSS');\nvar _ = require('underscore');\n\nelixir.extend('compass', function (src, output, options) {\n\n\toptions = _.extend({\n\t\tconfig_fil... | javascript | edit | 0 | 1 | mit | 5cf609be1c1e1691e82cbce5e25c7a952eb03d1c | morrislaptop/laravel-elixir-compass | index.js | accepted | null | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.