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\nconst express = require('express')\nconst fs = require('fs')\nconst http = require('http')\nconst https = require('https')\nconst path = require('path')\n\nfunction startHttpServer(app, port) {\n const httpServer = http.Server(app)\n ...
javascript
edit
0
2
mit
c6ab3077925eb574062b1b9815bed6c954ab3cb6
heikkipora/registry-sync,heikkipora/registry-sync,heikkipora/registry-sync
lib/server.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\nimport test from 'ava';\nimport removeTrailingSeparator from '..';\n\ntest('strip trailing separator:', t => {\n\tt.is(removeTrailingSeparator('foo/'), 'foo');\n\tt.is(removeTrailingSeparator('foo\\\\'), 'foo');\n});\n\ntest('don\\'t st...
javascript
edit
0
1
isc
7098ecba8c91c0851fbd070a1798bd2562c4f264
darsain/remove-trailing-separator
test/index.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\n'use strict';\n\n/**\n * @ngdoc directive\n * @name vlui.directive:pasteDataset\n * @description\n * # pasteDataset\n */\nangular.module('vlui')\n .directive('pasteDataset', function (Dataset, Alerts, Logger, Config, _, Papa) {\n re...
javascript
edit
0
1
bsd-3-clause
42b4ff08ac63d894afdf75eee999bb763a2c5b96
uwdata/vega-lite-ui,vega/vega-lite-ui,uwdata/vega-lite-ui,vega/vega-lite-ui,vega/vega-lite-ui,uwdata/vega-lite-ui
src/dataset/pastedataset.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\nconst router = require('express').Router()\n\nconst { ENTITIES } = require('../../../search/constants')\n\nconst QUERY_FIELDS = require('../../constants')\n\nconst { getCollection, exportCollection } = require('../../../../modules/searc...
javascript
edit
0
0
mit
636201763e023889587448dcf6e60d46ea8cd52b
uktrade/data-hub-frontend,uktrade/data-hub-fe-beta2,uktrade/data-hub-fe-beta2,uktrade/data-hub-frontend,uktrade/data-hub-frontend
src/apps/omis/apps/list/router.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\nlet config = require(\"./config\");\nlet Token = require(\"../lib/token\");\n\n(async function() {\n\n let token = new Token(config.token);\n let value = await token.value;\n console.log(value);\n\n})();\n\n```\n\nApply this ch...
javascript
edit
0
1
apache-2.0
7fe66bd01126d5f670ea02d988b217e706b46a2b
Tomella/fsdf-elvis,Tomella/fsdf-elvis,Tomella/fsdf-elvis
test/token.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\nvar express = require('express');\nvar redis = require('ioredis');\nvar logger = require('morgan');\nvar cookieParser = require('cookie-parser');\nvar bodyParser = require('body-parser');\n\nvar routes = require('./routes/endpoints');\n...
javascript
edit
0
2
mit
16bc4ac36243d04e1dbc3e7675137cb016ed9c5e
nathansmyth/node-stack,nathansmyth/node-stack
server.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\n'use strict';\n\n// Dependencies\nvar express = require('express');\nvar http = require('http');\nvar bodyparser = require('body-parser');\n\n// Config\nvar app = express();\napp.use(bodyparser.json());\napp.use(express.static(__dirname...
javascript
edit
0
1
mit
f7bba22e5b5b3ee2fc1b14402f5c265a8a087170
Localhost3000/along-the-way
server.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\nconst { search, exportSearch } = require('../services')\nconst { transformApiResponseToSearchCollection } = require('../transformers')\n\nfunction getCollection (searchEntity, entityDetails, ...itemTransformers) {\n return async functi...
javascript
edit
0
2
mit
6f19117980bf8943f0c36d310e9b74466e82dc11
uktrade/data-hub-fe-beta2,uktrade/data-hub-frontend,uktrade/data-hub-fe-beta2,uktrade/data-hub-frontend,uktrade/data-hub-frontend
src/modules/search/middleware/collection.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\nvar Sockets = {}\n\nSockets.Socket = function Socket (signal) {\n if(!('WebSocket' in window)) throw new Error(\"Websockets not supported in this browser\")\n\n this.connection = io.connect('http://localhost:3001')\n this.signa...
javascript
edit
0
5
mit
25ca4515d828802927aec301c7721fe4fe294e0b
kjgorman/melchior,kjgorman/melchior,kjgorman/melchior,kjgorman/melchior,kjgorman/melchior,kjgorman/melchior
Melchior/JS/Socket.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\n\"use strict\";\n\nconst Handler = require('./handler');\n\nclass PermissionHandler extends Handler {\n constructor(data={}) {\n super(data);\n ['permissions'].map(val => this[val] = data[val] ? data[val] : (this[val] ? this[val]...
javascript
edit
0
5
mit
314fdb4ec7a97d488ba231847a7dbfac78045fd2
coreyp1/defiant,coreyp1/defiant
lib/plugin/router/handler/permissionHandler.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\nif (!cbus.hasOwnProperty(\"server\")) { cbus.server = {} }\r\n\r\n(function() {\r\n const request = require(\"request\");\r\n const x2j = require(\"xml2js\");\r\n const path = require(\"path\");\r\n\r\n cbus.server.getPodcastInfo = ...
javascript
edit
0
8
apache-2.0
17b3022d261f64d8ca427a8999a3008f0038bcbc
z-------------/cumulonimbus,z-------------/cumulonimbus,z-------------/cumulonimbus
public/app/js/cbus-server-get-podcast-info.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\n/*global module */\nmodule.exports = function validAuthType(type) {\n\t'use strict';\n\tvar authTypes = ['AWS_IAM', 'NONE', 'CUSTOM'];\n\treturn (authTypes.indexOf(type) >= 0);\n};\n\n```\n\nApply this change: Allow cognito user pool au...
javascript
edit
0
1
mit
14382c87363ebc85f58b0da4b5689f8d0f0140bd
dhackner/claudia,dhackner/claudia
src/util/valid-auth-type.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\n// Simple file for handling text.\nvar Text = (function() {\n\t\n\tvar emailRegex = /[A-Z0-9._%+-]+@[A-Z0-9.-]+\\.[A-Z]{2,4}/ig;\n\tvar emailReplacement = '<a class=\"email\" href=\"mailto:$&\">$&</a>';\n\tvar urlRegex = /(ftp|http|http...
javascript
edit
0
1
apache-2.0
806b668ac7fce02ede78aad9528024a771d0631b
ox-it/wl-course-signup,ox-it/wl-course-signup,ox-it/wl-course-signup,ox-it/wl-course-signup,ox-it/wl-course-signup
tool/src/main/webapp/static/lib/Text.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\n/**\n * @require {core.ext.Object}\n * @require {core.ext.String}\n * @require {core.ext.Function}\n */\ncore.Class(\"lowland.Object\", {\n include : [core.property.MGeneric, lowland.base.UserData, lowland.base.Events],\n \n construc...
javascript
edit
0
2
mit
6eae6d6034c9b3ceb6e564498d9fc0bfeb4bbc9b
fastner/lowland,fastner/lowland
src/Object.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\n// https://en.bitcoin.it/wiki/List_of_address_prefixes\nmodule.exports = {\n bitcoin: {\n bip32: {\n pub: 0x0488b21e,\n priv: 0x0488ade4\n },\n pubKeyHash: 0x00,\n scriptHash: 0x05,\n wif: 0x80\n },\n dogecoi...
javascript
edit
0
0
mit
5fd9fe62dcd6e442344d202bc7d9c4fa0fea0a18
bitcoinhaber/bitcoinjs-lib,bpdavenport/bitcoinjs-lib,ptcrypto/bitcoinjs-lib,erikvold/bitcoinjs-lib,junderw/bitcoinjs-lib,BitGo/BitGoJS,p2pmining/bitcoinjs-lib,BitGo/bitcoinjs-lib,bitcoinjs/bitcoinjs-lib,visvirial/bitcoinjs-lib,visvirial/bitcoinjs-lib,habibmasuro/bitcoinjs-lib,blocktrail/bitcoinjs-lib,whitj00/opalcoinjs...
src/network.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\nimport { createAction } from 'redux-actions';\nimport { createThunkAction } from 'utils/redux';\n\nconst fetchStoriesInit = createAction('fetchStoriesInit');\nconst fetchStoriesReady = createAction('fetchStoriesReady');\nconst fetchStor...
javascript
edit
0
2
mit
62bcabb8826bea721d9d53c6141ea2393737e90d
Vizzuality/climate-watch,Vizzuality/climate-watch,Vizzuality/climate-watch,Vizzuality/climate-watch
app/javascript/app/components/stories/stories-actions.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\nvar components = require('./components');\nvar javascript = require('../tasks/javascript');\nvar extend = require('extend');\n\n/**\n * Helper function for rendering a page\n * Abstracted out here to reduce some duplication in the main ...
javascript
edit
0
2
mit
aa8eda993799431082acdaf1c515ee2902817a06
LandRegistry/land-registry-elements,LandRegistry/land-registry-elements,LandRegistry/land-registry-elements,LandRegistry/land-registry-elements,LandRegistry/land-registry-elements
build/modules/renderPage.js
rejected_duplicate
Near-duplicate of sample 73779
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\nimport { ADD_TEAM_SUCCESS } from './actionCreators'\r\n\r\nlet initialState = [\r\n { id: 2, name: 'gym', colour: \"#49078d\", balance: 105463 },\r\n { id: 1, name: 'fred', colour: \"#23fe4d\", balance: 105463 },\r\n { id: 3, name: '...
javascript
edit
0
2
mit
55dbc0efa497718406293b8d1d0165464c212413
xpsurgery/shopping-cart,xpsurgery/shopping-cart,xpsurgery/shopping-cart
client/src/teams/reducer.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\n(function() {\n 'use strict';\n\n define(['sockjs'], function (sockjs) {\n var sockjs_opts = {\n sockjs_url: 'http://cdn.sockjs.org/sockjs-0.3.min.js'\n };\n\n return sockjs.createServer(sockjs_opts);\n });\n}());\n\n``...
javascript
edit
0
1
mit
4c5679e121aa1a5c32fd18c40619df0c01c93ff5
ndhoule/underscoreboard,ndhoule/underscoreboard
app/config/sockjs_server.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\nconst Command = require('../Command')\n\nmodule.exports =\nclass PingCommand extends Command {\n constructor (client) {\n super(client, {\n name: 'ping',\n properName: 'Ping',\n description: 'Ping the bot to see API l...
javascript
edit
0
1
apache-2.0
37b2967fc7523e849273d4b739184cdfc3778761
evaera/RoVer
src/commands/rover/PingCommand.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\n// @flow\nimport fs from 'fs';\nimport path from 'path';\nimport { appFolderPath } from '../config';\nimport { getNumberOfEpochsConsolidatedChannel } from '../ipc/getNumberOfEpochsConsolidated.ipc';\nimport type { GetNumberOfEpochsConso...
javascript
edit
null
null
apache-2.0
c7fff6c1a91a69a54b9096d3698433abbcf2dd8e
input-output-hk/daedalus,input-output-hk/daedalus,input-output-hk/daedalus,input-output-hk/daedalus,input-output-hk/daedalus,input-output-hk/daedalus
source/main/utils/getNumberOfEpochsConsolidated.js
rejected_syntax
Syntax error detected by tree-sitter
false
[ { "role": "user", "content": "Here is the current file:\n```javascript\n// Server startup script\n// =====================\n// Responsible for configuring the server,\n// inserting middleware, and starting the\n// app up. \n//\n// Note: this was written on my iPhone, please excuse typos\n\n'use strict'\n\nl...
javascript
edit
0
1
mit
7eb5153314da93c30f41e5615ea55fb672e5534e
billpatrianakos/coverage-web,billpatrianakos/coverage-web,billpatrianakos/coverage-web
server/app.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\n/** Copyright (c) 2013 Jan Nicklas Released under MIT license */\n\n/* global define: false, jQuery: true */\n/* jshint sub:true */\n\n// RequireJS amd factory\n// http://stackoverflow.com/questions/10918063/how-to-make-a-jquery-plugin-...
javascript
edit
0
3
mit
20fbc6c4ccda450b31c39c739f5c438c994a67ed
jantimon/ariaMenu,jantimon/ariaMenu
src/wrapper.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\n'use strict';\n\nvar trackStar = (function(){\n function TrackStar() {\n var integrations = {};\n\n if(!(this instanceof TrackStar)){\n return new TrackStar();\n }\n\n this.getIntegrations = function() {\n return ...
javascript
edit
0
5
apache-2.0
03ae44a0ef4d4c96f2578c317967bf38778f27b0
dustincoates/trackstar
src/tracker.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\n/**\n * Cache data.\n *\n * Site Kit by Google, 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 ...
javascript
edit
0
3
apache-2.0
603409dc7896549d58ab36821d581820c298c7ee
google/site-kit-wp,google/site-kit-wp,google/site-kit-wp,google/site-kit-wp
assets/js/util/api.js
rejected_duplicate
Near-duplicate of sample 71280
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\nimport React, { useState } from 'react';\nimport classnames from 'classnames';\nimport { search } from './api';\nimport SearchByPostcode from './SearchByPostcode';\nimport EmailComposer from './EmailComposer';\nimport ComponentWrapper f...
javascript
edit
0
4
mit
ce99af2e737a2afc6ffcb6a2c5e6869953b21757
SumOfUs/Champaign,SumOfUs/Champaign,SumOfUs/Champaign,SumOfUs/Champaign,SumOfUs/Champaign
app/javascript/modules/EmailParliament/index.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\n'use strict';\nimport React from 'react';\n\nvar CommunityCard = React.createClass({\n displayName: 'CommunityCard',\n\n propTypes: {\n title: React.PropTypes.string,\n linkTitle: React.PropTypes.string,\n url: React.PropType...
javascript
edit
0
1
bsd-3-clause
407921321c4746588b60c441f69820368ed8bee3
openaq/openaq.org,openaq/openaq.github.io,openaq/openaq.github.io,openaq/openaq.org,openaq/openaq.github.io,openaq/openaq.org
app/assets/scripts/components/community-card.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\nimport Metalsmith from 'metalsmith';\nimport common from '@rollup/plugin-commonjs';\nimport inPlace from '@metalsmith/in-place';\nimport layouts from '@metalsmith/layouts';\nimport markdown from '@metalsmith/markdown';\nimport {dirname,...
javascript
edit
0
2
bsd-2-clause
9e4c6ea66332e0f9cf6472dad44bf8dc1dc31443
stweil/openlayers,openlayers/openlayers,stweil/openlayers,openlayers/openlayers,ahocevar/openlayers,stweil/openlayers,openlayers/openlayers,ahocevar/openlayers,ahocevar/openlayers
site/build.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\nimport { isArray } from 'lodash';\nimport { AppNavigator } from 'DailyScrum/src/Scenes';\n\nexport default (state, action) => {\n const { type } = action;\n if (type === 'Navigation/NAVIGATE' && isRouteSameAsLastRouteFromNavigationSta...
javascript
edit
0
5
mit
0a643864d51d550234a6391b761512467cf44e73
Minishlink/DailyScrum,Minishlink/DailyScrum,Minishlink/DailyScrum,Minishlink/DailyScrum,Minishlink/DailyScrum
src/modules/navigation/reducer.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\nimport express from 'express';\nimport UserController from '../controllers/UserController';\n\nconst userRouter = express.Router();\nuserRouter.post('/api/user/signup', UserController.createUser());\nuserRouter.post('/api/user/signin', ...
javascript
edit
0
0
mit
0a95b27d95b6310072080a41e1edcb5af75b32d1
tomipaul/PostIt,tomipaul/PostIt
server/routes/UserRoutes.js
rejected_duplicate
Near-duplicate of sample 79635
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\nimport Kata from './kata.js';\n\nexport default class KataGroup {\n \n static withKatas(groupName, rawKataItems) {\n var group = new KataGroup();\n group.name = groupName;\n group.createKatas(rawKataItems);\n group.sortByNa...
javascript
edit
0
2
mit
0c3cf9273f3bef100484b50bbdb1968cddc06717
tddbin/es6katas.org
src/katagroup.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\n$(document).ready(function (){\n var width = $(window).width(),\n costumizedWith = width - 30,\n image = $('.artis-img');\n headline = $('.headline-img');\n ads = $('.ads');\n image.css('width', costumi...
javascript
edit
0
1
mit
b306f5568b17eaae2b1289ebfb6ea47c7676c9a4
tauduluan/php,tauduluan/php,tauduluan/php
js/responsive.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\n'use strict';\nvar fs = require('fs');\nvar Download = require('download');\nvar CSV = require('comma-separated-values');\nvar arrayUniq = require('array-uniq');\n\nnew Download({extract: true})\n\t.get('http://www.mapcode.com/kader/iso...
javascript
edit
0
4
mit
26e8c6f32ca4dda553ca2394a155cb7174b1bf05
sindresorhus/mapcode-regex
generate.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\ndefine([\n 'jquery', // src/jquery.js,\n 'defaults'\n], function ($, defaults) {\n\n function Crayon(element, options) {\n console.error('construct');\n this.element = element;\n this.options = $.extend({}, defaults, options...
javascript
edit
0
3
mit
21696a17dc4596908764c291b251916f2735177b
aramk/crayon.js,aramk/crayon.js
src/Crayon.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\n\n'use strict';\n\nvar path = require('path');\n\nvar expect = require('thehelp-test').expect;\nvar supertest = require('supertest');\nvar util = require('./util');\n\ndescribe('top-level crash in worker', function() {\n var agent, chi...
javascript
edit
0
1
mit
21659890301ececebda2ed6b70c782a2eb8cff11
thehelp/cluster
test/integration/server/test_crash_worker.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\n'use strict';\n\nlet blessed = require('blessed');\nlet _ = require('lodash');\nlet config = require('../../config/config');\n\n\nmodule.exports = function () {\n let hostDetailsPanel = blessed.list({\n top: 5,\n bottom...
javascript
edit
0
2
mit
dae0c1ce82b2c0abfde8b633728dd393b094e0c1
etissieres/ssh-config-ui
lib/widgets/host_details_panel.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\nangular.module('nnConsumerUi')\n .config(function($translateProvider) {\n $translateProvider.translations('fi', {\n 'REQUIRED_FIELD': 'Pakollinen kenttä',\n 'CHARACTERS_LEFT': 'Merkkiä jäljellä',\n 'CHOOSE_FILE': 'Val...
javascript
edit
0
1
mit
a2e6df5e9dee79f636b21016c8a5b1b810679e19
nordsoftware/nettineuvoja,nordsoftware/nettineuvoja,nordsoftware/nettineuvoja,nordsoftware/nettineuvoja,nordsoftware/nettineuvoja
consumer-ui/src/app/config/angular-translate.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\n\"use strict\";\n\nvar Vow = require( \"vow\" );\n\nmodule.exports = function( grunt ) {\n\n var filter = Array.prototype.filter,\n JSCS = require( \"./lib/jscs\" ).init( grunt );\n\n grunt.registerMultiTask( \"jscs\", \"Ja...
javascript
edit
0
2
mit
5e456f6017c550a56d685963f007b8f73563fb57
markelog/grunt-checker
tasks/jscs.js
rejected_duplicate
Near-duplicate of sample 107236
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\nexport default class GeorgeForeman {\n constructor() {\n }\n}\n\n```\n\nApply this change: Implement class/static method for George" }, { "role": "assistant", "content": "export default class GeorgeForeman {\n constructor...
javascript
edit
0
3
mit
5525d5f5d22faf3a65324de927de277cbb877e94
Riverside-Ruby/learning-es6,Riverside-Ruby/learning-es6
app/utils/george-foreman.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\nvar $ = require('jQuery');\nvar onReady = require('kwf/on-ready');\nvar cookieOpt = require('kwf/cookie-opt');\n\nonReady.onRender('.kwcClass', function (el, config) {\n if (!cookieOpt.isSetOpt()) {\n if (config.showBanner) {\...
javascript
edit
0
3
bsd-2-clause
a89ea164e9bc1a883283bd9c610a8f0738c53828
koala-framework/koala-framework,koala-framework/koala-framework
Kwc/Statistics/OptBox/Component.defer.js
rejected_duplicate
Near-duplicate of sample 91682
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\n/*\n * Paper.js - The Swiss Army Knife of Vector Graphics Scripting.\n * http://paperjs.org/\n *\n * Copyright (c) 2011 - 2016, Juerg Lehni & Jonathan Puckey\n * http://scratchdisk.com/ & http://jonathanpuckey.com/\n *\n * Distributed u...
javascript
edit
0
1
mit
8f4e0f16a0985578c49462475df6abf89540c673
lehni/paper.js,iconexperience/paper.js,lehni/paper.js,iconexperience/paper.js,lehni/paper.js,iconexperience/paper.js
gulpfile.js
rejected_duplicate
Near-duplicate of sample 74670
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\nvar babelify = require('babelify');\nvar browserify = require('browserify');\nvar browserSync = require('browser-sync');\nvar buffer = require('vinyl-buffer');\nvar gulp = require('gulp');\nvar gulpif = require('gulp-if');\nvar nodemon ...
javascript
edit
0
1
mit
b0b89a45029eff805828dda77c1e2c19ff7b991e
DevelopersGuild/lollipop-fantastyland,DevelopersGuild/lollipop-fantastyland
gulpfile.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\n'use strict';\n\nvar gulp = require('gulp');\nvar browserify = require('browserify');\nvar source = require('vinyl-source-stream');\nvar streamify = require('gulp-streamify');\nvar size = require('gulp-size');\nvar uglify = require('gul...
javascript
edit
0
1
mit
85cd4f35e321082c407bb41ab6ea6f22b7bf1017
braintree/credit-card-type
gulpfile.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\n\"use strict\";\n\nangular.module(\"hikeio\").\n\tdirective(\"headerEntry\", function() {\n\t\treturn {\n\t\t\tscope: {\n\t\t\t\talign: \"@\",\n\t\t\t\tlabel: \"@\",\n\t\t\t\turl: \"@\"\n\t\t\t},\n\t\t\ttemplate: \"<a href='{{url}}'>\" ...
javascript
edit
0
1
mit
9839b8526e45a1f5d8b99ffab99a37e06f3f6598
zaknelson/hike.io,zaknelson/hike.io,zaknelson/hike.io,zaknelson/hike.io
client/js/directives/header-entry-directive.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\nvar parse = require('./parse');\n\nmodule.exports = function(data) {\n this.token = data.token;\n};\n\nmodule.exports.prototype = {\n get: function() {\n query = parse.query(arguments);\n callback = parse.callback(ar...
javascript
edit
0
1
apache-2.0
845280ecb6b8ad4c97ca248a6f7322e1fd38da25
phonegap/node-phonegap-build-api
lib/api.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\nconst babelLoaderMatcher = function(rule) {\n return rule.loader && rule.loader.indexOf(\"babel-loader/\") != -1;\n}\n\nconst getLoader = function(rules, matcher) {\n var loader;\n\n rules.some(rule => {\n return loader = matcher(...
javascript
edit
0
4
mit
1c1f3d90b4b66f335351ae4d66c86ca98cb8b339
timarney/react-app-rewired,timarney/react-app-rewired
packages/react-app-rewired/index.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\nlet userConfig;\n\ntry {\n userConfig = require('../config');\n} catch (e) {\n throw new Error(`Config file could not be found or read! The error given was: ${e.message}`);\n}\n\nconst defaultConfig = {\n \"token\": null,\n \"mailGu...
javascript
edit
0
0
mit
893bfb091ed0e6f9f46672ca280334171098defe
Dragory/modmailbot
src/config.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\nimport slurmAllocationDetailsDialog from './slurm-allocation-details-dialog';\nimport slurmAllocationUsageChart from './slurm-allocation-usage-chart';\nimport slurmAllocationUsageTable from './slurm-allocation-usage-table';\nimport Slur...
javascript
edit
0
1
mit
4a84fb7aa778541683143cad87f442defe50e001
opennode/waldur-homeport,opennode/waldur-homeport,opennode/waldur-homeport,opennode/waldur-homeport
app/scripts/components/slurm/details/module.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\n// ==UserScript==\n// @name Display Stats\n// @namespace https://github.com/EFox2413/initiumGrease\n// @version 0.1\n// @description try to take over the world!\n// @author EFox2413\n// @match https://www.p...
javascript
edit
0
2
mit
13c8749224dd2d7014953acd295cb582bbefaf10
EFox2413/initiumGrease
display-stats.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\n///\nvar pkg = require(\"./package.json\")\n , gulp = require(\"gulp\")\n , plumber = require(\"gulp-plumber\")\n\n///\n// Lint JS\n///\nvar jshint = require(\"gulp-jshint\")\n , jsonFiles = [\".jshintrc\", \"*.json\"]\n , jsFiles =...
javascript
edit
0
2
mit
d08eeb39468740085f1488e7e031e8122dba0124
MoOx/parallaxify,MoOx/parallaxify
gulpfile.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\n'use strict';\n\nvar gulp = require('gulp');\nvar zip = require('gulp-zip');\n\n// Release\ngulp.task('release', function () {\n\n var zippedFiles = [\n 'controller.php',\n 'css/**/*',\n 'vendor/**/*',\n '...
javascript
edit
0
1
mit
5e709349ce99b83a6b443db20b6d317adbf5e17f
dorian-marchal/concrete5-kint-debug,dorian-marchal/concrete5-kint-debug
gulpfile.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\nconst _ = require('underscore');\n\nmodule.exports = function dbConnSetup (pgConnection) {\n return function dbConnSetupMiddleware (req, res, next) {\n const { user } = res.locals;\n\n pgConnection.setDBConn(user, res.l...
javascript
edit
0
4
bsd-3-clause
9dc4e7c955b0252f1e5b0a89f2dc1cfbaf030088
CartoDB/Windshaft-cartodb,CartoDB/Windshaft-cartodb,CartoDB/Windshaft-cartodb,CartoDB/Windshaft-cartodb
lib/cartodb/middleware/context/db-conn-setup.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\nimport RavenService from 'ember-cli-sentry/services/raven';\nimport { inject as service } from '@ember/service';\nimport config from '../config/environment';\nimport { versionRegExp } from 'ember-cli-app-version/utils/regexp';\n\nexport...
javascript
edit
0
1
mit
e1703b576feb0fadab897da7a8b8ee697f7f4f67
djvoa12/frontend,djvoa12/frontend,jrjohnson/frontend,thecoolestguy/frontend,ilios/frontend,thecoolestguy/frontend,dartajax/frontend,ilios/frontend,dartajax/frontend,jrjohnson/frontend
app/services/raven.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\n// Include common configuration\nconst {karmaCommon, getKarmaConfig, defaultBrowserMatrix} = require('../../../test/karma.common');\n\nmodule.exports = function (config) {\n const cfg = getKarmaConfig({\n // I get error from browser...
javascript
edit
0
1
apache-2.0
d54755756243d651f6274c41e461e9fc62f79592
dfahlander/Dexie.js,dfahlander/Dexie.js,dfahlander/Dexie.js,jimmywarting/Dexie.js,dfahlander/Dexie.js,jimmywarting/Dexie.js,jimmywarting/Dexie.js,jimmywarting/Dexie.js
addons/dexie-export-import/test/karma.conf.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\nimport hljs from 'highlight.js/lib/highlight';\nimport javascript from 'highlight.js/lib/languages/javascript';\nimport ruby from 'highlight.js/lib/languages/ruby';\nimport elixir from 'highlight.js/lib/languages/elixir';\nimport shell ...
javascript
edit
0
1
mit
bdfc949f40eef5f43febb7e1fb2e53874fad399f
rossta/rossta.github.com,rossta/rossta.github.com,rossta/rossta.github.com
source/assets/javascripts/syntax-highlight.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\n/*globals module, require*/\n\nvar stack = require('stack'),\n http = require('http'),\n _hs = http.createServer;\n\nhttp.createServer = function createServer () {\n 'use strict';\n return _hs.call(http,\n stack.apply...
javascript
edit
0
1
mit
c9707e7a63d446ae1c60814c705d48b604b9ddca
brettz9/htteepee
htteepee.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\nHandlebars.registerHelper('select_box', function(field, options) {\n var html_options,\n _this = this;\n if (!field) {\n return;\n }\n\n if (options.hash.optionValues && options.hash.optionValues.length > 0) {\n optionsValues...
javascript
edit
0
5
mit
622c972dd4d23923b40799cf945206c0c774b5bb
meteorclub/simple-form
helper.js
rejected_duplicate
Near-duplicate of sample 99727
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\nimport dotProp from 'dot-prop-immutable'\nimport * as types from './forecastDailyActionTypes'\n\nconst initialState = {\n forecastDaily: {\n data: [],\n app: {\n locationId: 5128581 // nyc usa\n },\n ui: {}\n }\n}\n\n...
javascript
edit
0
3
mit
a4e52e3d9c017cacaa688de5b8a747a08c98d478
gibbok/react-redux-weather-app,gibbok/react-redux-weather-app
src/forecastDaily/forecastDailyReducer.js
accepted
null
true
[ { "role": "user", "content": "Write javascript code for the following: Add test endpoint for /orders" }, { "role": "assistant", "content": "export default function() {\n\n this.get('/orders', function(db, request) {\n return {\n data: [\n {\n id: 1,\n type: \"or...
javascript
new_file
0
1
mit
c5f148c6ec29c86671471bcde50cea809479b5c6
yandex-shri-minsk-2016/yummy-time,yandex-shri-minsk-2016/yummy-time,yandex-shri-minsk-2016/yummy-time
client/app/mirage/config.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\nvar captureDigit = '([1-9][0-9]*)'\n\nvar EUCD = new RegExp(\n '^' +\n captureDigit + 'e' +\n optional(captureDigit + 'u') +\n optional(captureDigit + 'c') +\n optional(captureDigit + 'd') +\n '$')\n\nfunction optional(reString) {...
javascript
edit
0
1
mit
4b027289b5f1aebca17f64b7fe240bfe0a0c2930
kemitchell/reviewers-edition-parse.js
build-regular-expression.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\n// Copyright (c) 2012 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\ntry {\nvar runtime = require('org.chromium.runtime.runtime');\...
javascript
edit
0
5
bsd-3-clause
2d588f811b671d46f3a70451f6f7201e20e03fe2
iDay/cordova-plugin-chrome-apps-common,MobileChromeApps/cordova-plugin-chrome-apps-common
errors.js
rejected_duplicate
Near-duplicate of sample 68307
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\n//= require jquery\n//= require jquery.ui.all\n//= require georgia/jquery.ui.touch-punch\n//= require jquery_ujs\n//= require jquery-fileupload\n//= require twitter/bootstrap\n//= require select2\n//= require shadowbox\n//= require mous...
javascript
edit
0
0
mit
581ca42c1e0c35fbeef9fffc501292d10e15974d
georgia-cms/georgia,georgia-cms/georgia,georgia-cms/georgia
app/assets/javascripts/georgia/application.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\n// This mock sensor implementation triggers an event with some data every once in a while\n\nvar emitter = require( \"events\" ).EventEmitter,\n\tpossibleStrings = [\n\t\t\"Helsinki\",\n\t\t\"Espoo\",\n\t\t\"Tampere\",\n\t\t\"Oulu\",\n\...
javascript
edit
0
1
mit
8f233b5f65981b79ef88f2c1dad315fe6e9e34d3
zolkis/iotivity-node,zqzhang/iotivity-node,zolkis/iotivity-node,zqzhang/iotivity-node,zolkis/iotivity-node,zolkis/iotivity-node,zqzhang/iotivity-node,zqzhang/iotivity-node,zqzhang/iotivity-node,zolkis/iotivity-node
js/mock-sensor.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\nconst REQUIRED_FIELDS = Object.freeze(['to']);\nconst OPTIONAL_FIELDS = Object.freeze([\n 'customer_id',\n 'transactional_message_id',\n 'message_data',\n 'from',\n 'from_id',\n 'reply_to',\n 'reply_to_id',\n 'bcc',\n 'subject'...
javascript
edit
0
3
mit
ecbb97b5d0b9698de4ceb47a94cd7499460cbf11
customerio/customerio-node,customerio/customerio-node,customerio/customerio-node
lib/transactional-email.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\nimport { R, BPromise } from \"../../utils\";\nimport { Github } from \"../../github\";\nimport { Mentor } from \"../../mentor\";\nimport { Pivotal } from \"../../pivotal\";\n\nexport class GithubToPivotal {\n constructor(keys, options)...
javascript
edit
0
3
apache-2.0
40add9e89540f99aa95273637d8dce007d6ca4e9
azukiapp/github-pivotal,azukiapp/github-pivotal
src/github/to/pivotal.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\n'use strict';\n\nvar mongoose = require('mongoose');\nvar Transaction = require('../models/Transaction');\nmongoose.Promise = global.Promise;\nmodule.exports = mongoose.connection;\n\nvar index = function (req, res, next) {\n Transacti...
javascript
edit
0
2
mit
0e3abf3fd573780b0898240ba06b1a19a4e2f1b4
Church-ill/project3-back,Church-ill/project3-back,Church-ill/project3-back
controllers/transactions.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\n/* See license.txt for terms of usage */\n\nFBL.ns(function() { with (FBL) {\n\nvar Fireformat = {},\n Formatters;\n\ntry {\n Components.utils.import(\"resource://fireformat/formatters.jsm\", Fireformat);\n Formatters = Fireformat....
javascript
edit
0
12
bsd-3-clause
5fbac9e0eb03fdb32f052a732e280a888fd0a0b3
kpdecker/firediff
content/firediff/cssReps.js
rejected_complexity
Cyclomatic complexity too high: 12
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\n/**\n * Development commands plugin\n * \n * This houses the bot's development commands.\n * These commands should only be used if the operator knows what their doing.\n *\n * @license MIT license\n */\n'use strict';\n\nexports.commands...
javascript
edit
0
3
mit
c2de65fb35c1e621e711527b7d2f357d1c4c3885
panpawn/Discord-Bot
chat-plugins/development.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\n$(document).ready(function(){\n if (analytics) {\n $('a[target=_blank]').click(function (e) {\n var url = this.getAttribute(\"href\") || this.getAttribute(\"xlink:href\");\n analytics.track(\"externalLink\", {url: url});\...
javascript
edit
0
2
mit
cf18968b1115f67dbb48c36834d1ba08e32aeb8d
cyberFund/cyberep.cyber.fund,cyberFund/cyberep.cyber.fund
js/nalyt.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\n$(document).ready(function() {\n $('#verified').click(function() {\n if($(this).attr(\"checked\")) {\n $('#activate').removeAttr('disabled');\n } else {\n $('#activate').attr('disabled', 'disabled'...
javascript
edit
0
2
apache-2.0
202b819f2e1f1caa1c00f4503900de2ceef1d3bb
omniscale/gbi-server,omniscale/gbi-server,omniscale/gbi-server
app/gbi_server/static/js/admin/create_user.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\n(function (angular) {\n 'use strict';\n\n angular\n .module('movieClub.auth')\n .factory('authApi', authApi);\n\n function authApi($firebaseAuth, usersApi, firebaseRef) {\n var factory = {\n ...
javascript
edit
0
1
mit
d7bfb87ea5580463c9fc058ea0718ac90a3f32f1
charwking/movie-club,charwking/movie-club,charwking/movie-club
src/auth/authApi.service.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\n'use strict';\n\n// MODULES //\n\nvar tape = require( 'tape' );\nvar lib = require( './../lib' );\n\n\n// TESTS //\n\ntape( 'main export is a function', function test( t ) {\n\tt.ok( typeof lib === 'function', 'main export is a function...
javascript
edit
0
1
mit
d527917af4d2213d23cf5165b15d30ff50a976ac
kgryte/test-snippet
lib/tape/test.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\n#!/usr/bin/env node\n\n'use strict';\n\nvar serveStdIn = require('./lib/serveStdIn.js');\nvar launchChromecastStreamingApp = require('./lib/sendChromecast.js');\nvar argv = require('yargs')\n .usage('Usage: $0 --localIP [--port]')\n ...
javascript
edit
0
1
mit
8294c6af9e0b469de05b044655fd6e354945c85b
fbngrmr/castpipe
bin/castpipe.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\nmodule.exports = function(grunt) {\n\n\tgrunt.config('css_mqpacker', {\n\t\toptions: {\n\t\t\tmap: false, // enable/disable source maps\n\t\t},\n\t\tmain: {\n\t\t\tsrc: '<%= project.styles_dev %>/main.dev.css',\n\t\t\tdest: '<%= project...
javascript
edit
0
1
mit
1024e5132e2f39fdaa46ee9f538046ef6e9d17ff
jolantis/altair,jolantis/altair
grunt/config/css-mqpacker.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\nimport React from 'react'\nimport PropTypes from 'prop-types'\nimport Dropdown from 'fyndiq-component-dropdown'\n\nimport styles from '../styles.less'\n\nconst Tooltip = ({ text, children, position }) => (\n <Dropdown\n button={<spa...
javascript
edit
0
1
mit
5aa574897c21a5f39d6c66768ea5653c14b869a0
fyndiq/fyndiq-ui,fyndiq/fyndiq-ui
packages/fyndiq-component-tooltip/src/index.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\nconst toArray = nodelist => Array.prototype.slice.call(nodelist);\nconst things = ['method', 'case', 'organization'];\n\nconst languageSelect = {\n redirectUrl: null,\n isThingDetailsPageWithLanguageParam: false,\n init(tracking) {\n...
javascript
edit
0
5
mit
8c9231fd97425de77c41764be8f779e7cb07493b
participedia/api,participedia/api,participedia/api,participedia/api
public/js/language-select.js
rejected_duplicate
Near-duplicate of sample 83345
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\nimport Repl from './Repl.html';\nimport examples from './examples.js';\n\nfunction tryParseData ( encoded ) {\n\ttry {\n\t\treturn JSON.parse( decodeURIComponent( atob( encoded ) ) );\n\t} catch ( err ) {\n\t\treturn {};\n\t}\n}\n\nif (...
javascript
edit
0
2
mit
4aa4466ac5f30870be92724a571c557dc48dc4ed
sveltejs/svelte.technology,sveltejs/svelte.technology
src/repl/main.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\nimport React from 'react'\n\nconst App = () => (\n <h1>Hello from React</h1>\n)\n\nexport default App\n\n```\n\nApply this change: Put the Counter into App" }, { "role": "assistant", "content": "import React from 'react'\n\...
javascript
edit
0
1
mit
e9841437c4834710354bf0c00ccf5d7c9eb8ffaa
epicsharp/react-boilerplate,RSS-Dev/live-html,epicsharp/react-boilerplate,RSS-Dev/live-html
src/components/App/index.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\nPackage.describe({\n summary: \"Meteor unit testing framework for packages\",\n name: \"spacejamio:munit\",\n version: \"1.0.0\",\n git: \"https://github.com/spacejamio/meteor-munit.git\"\n});\n\nPackage.onUse(function (api,...
javascript
edit
0
1
mit
ee03bf731294a55a6c59d567f4540dc7e8d88d16
awatson1978/clinical-verification,practicalmeteor/meteor-munit
package.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\n(function() {\n 'use strict';\n\n // Model\n\n var Task = Backbone.Model.extend({\n defaults: {\n title: 'do something!',\n completed: false\n },\n validate: function (attr) {\n if (_.isEmpty(attr.title)) {\n ...
javascript
edit
0
1
mit
b0609358beb1785b07e1eb2b643a9e25a8b500a4
shgtkshruch/dotinstall-backbone
js/app.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\nimport React, { Component } from 'react';\nimport { NavLink } from 'react-router-dom';\nimport nav from '../icons/nav';\nimport styles from './index.module.less';\n\nexport default class index extends Component {\n constructor() {\n ...
javascript
edit
0
9
mit
ec23be002f6658e2743f02a673e30cacd704b34c
uiw-react/uiw,uiw-react/uiw
src/components/Nav/index.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\nconst {JsContext} = require('stencila')\n\n/**\n * A Node.js context for executing Javascript code\n */\nclass NodeContext extends JsContext {}\n\nNodeContext.spec = {\n name: 'NodeContext',\n base: 'Context',\n aliases: ['js', 'node...
javascript
edit
0
0
apache-2.0
801a263ea3a7aac846b860b8933669a728af06d0
stencila/node,stencila/node
src/contexts/NodeContext.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\n/**\n * @license\n * Copyright 2016 Google Inc. All Rights Reserved.\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 cop...
javascript
edit
0
1
apache-2.0
b9be6a6fccd7558f3aa704972c4ac53e377c43c1
foam-framework/foam2,jacksonic/vjlofvhjfgm,foam-framework/foam2,foam-framework/foam2,foam-framework/foam2,jacksonic/vjlofvhjfgm,foam-framework/foam2,jacksonic/vjlofvhjfgm
src/foam/dao/DAOProperty.js
rejected_duplicate
Near-duplicate of sample 78342
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\n'use strict';\n\nvar assign = require('es5-ext/object/assign')\n , setPrototypeOf = require('es5-ext/object/set-prototype-of')\n , d = require('d')\n\n , captureStackTrace = Error.captureStackTrace\n , AbstractE...
javascript
edit
0
8
mit
d8c5d622facc6459b1e97f99bac8d9cc1819480f
medikoo/error-create
abstract.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\n(function () {\n 'use strict';\n\n angular\n .module('doleticApp')\n .service('APIInterceptorService', APIInterceptorService);\n\n APIInterceptorService.$inject = ['$rootScope', '$q', 'AuthService', 'store'];\n\n ...
javascript
edit
0
3
mit
230e7fa0663afc90df0359c574309afe8d018749
JuCN/DoleticRESTClient,ETICINSATechnologies/DoleticRESTClient,nsorin/DoleticRESTClient,JuCN/DoleticRESTClient,ETICINSATechnologies/DoleticRESTClient,nsorin/DoleticRESTClient
app/services/interceptor/api-interceptor.service.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\n/**\n * Values suitable for use within `propTypes` of components.\n *\n * @module higherform\n */\n\nimport { PropTypes } from 'react';\n\nexport const FormShape = PropTypes.shape({\n validate: PropTypes.func,\n errors: PropTypes....
javascript
edit
0
0
mit
9a7d99c50367f8b9e0fcf31d5e326ac622672850
AgencyPMG/higherform,AgencyPMG/higherform
src/shapes.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\nvar Bookmark = require('../models/index.js').Bookmark;\n\nvar create = function(props, callback) {\n Bookmark.build(props)\n .save()\n .then(function(bookmark) {\n callback(bookmark);\n }).catch(function(err) {\n console.log(e...
javascript
edit
0
2
mit
b8eedc06fef0a78f6d58a49c0efec766d186d67e
francoabaroa/escape-reality,lowtalkers/escape-reality,lowtalkers/escape-reality,francoabaroa/escape-reality
db/controllers/bookmarks.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\n/**\n * Searches a content string for titles by the keyword\n * @param {string} contents - File contents as a utf8 string\n * @param {object} cfg - Config object\n * @param {string} [title] - Title to search for\n */\nmodule.exports = (...
javascript
edit
0
3
isc
eb4b103186cc77f543b463fe3b2f9a5e79676c2d
JasonEtco/todo
lib/search-contents-for-titles.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\n/*****************************************************************************/\n/* Client and Server Routes */\n/*****************************************************************************/\nRouter.configure({\n layoutTemplate: 'Mas...
javascript
edit
0
3
mit
ad002ab21ef7400ef8df3314ac739a544e1220d3
bojicas/letterhead,bojicas/letterhead
both/router/routes.js
rejected_duplicate
Near-duplicate of sample 73737
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\nmodule.exports = exports = function BaseObject(key, myRedis, options) {\n this.key = key;\n\n if (myRedis && !options) {\n options = myRedis;\n myRedis = null;\n }\n if (!options) options = {};\n\n this.options = options;\n ...
javascript
edit
0
4
mit
02a3f5b3fb131e05b10a4dc0fe868ea28b275f61
hfwang/node-redis-objects
lib/BaseObject.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\n'use strict';\n\nvar os = require('os');\nvar path = require('path');\nvar dotenv = require('dotenv');\n\nvar defaultMappings = {\n username: 'SCS_USERNAME',\n password: 'SCS_PASSWORD'\n};\n\nmodule.exports = {\n\n /**\n * ...
javascript
edit
0
5
mit
cf17c59c7ad1848edd16c10cfcbf493aa6640b0f
VIISON/scs-commander
lib/env_loader.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\n'use strict';\n\nvar gulp = require('gulp');\nvar jshint = require('gulp-jshint');\nvar csslint = require('gulp-csslint');\n\ngulp.task('lint', ['jshint', 'csslint']);\n\ngulp.task('jshint', function() {\n return gulp.src('./js/*.js')\...
javascript
edit
0
1
apache-2.0
afa60ffa30d497be5ece6dce6bee957e4f18e1f2
sidharta/sales-gallery,sidharta/sales-gallery,sidharta/sales-gallery
src/main/webapp/gulpfile.js
rejected_duplicate
Near-duplicate of sample 107048
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\n'use strict';\n\nvar QUEUE = require('../job_queue').QUEUE;\n\nfunction QueueSeeker(pool) {\n this.pool = pool;\n}\n\nmodule.exports = QueueSeeker;\n\nQueueSeeker.prototype.seek = function (callback) {\n var initialCursor = ['0'];...
javascript
edit
0
5
bsd-3-clause
34b352a0a6bae910dfb825ee74ec8c15848e5cfc
CartoDB/CartoDB-SQL-API,CartoDB/CartoDB-SQL-API
batch/pubsub/queue-seeker.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\n// Import AVA\nimport test from 'ava'\n\n// Imports\nimport Amount from '../../src/primitives/amount'\nimport BigNumber from 'bignumber.js'\n\n// Test data\nconst testNumber = 78953286724\nconst testValue = '78953286724'\n\n/**\n * Valu...
javascript
edit
0
1
unlicense
41f93f380688849092f036a37a0f0a40d94ef473
jestcrows/ethtaint,jestcrows/ethtaint
test/primitives/amount.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\nimport { retryUntil } from '../utils'\nimport { descriptorToRange, markRange } from './annotations'\n\nimport styles from './styles.css'\n\nexport async function highlightAnnotation({ annotation }) {\n // console.log('highlighting')\...
javascript
edit
0
1
mit
c30d406e330c1c69877cd80e9f3b9ba3cdddc983
WorldBrain/WebMemex,WorldBrain/WebMemex
src/direct-linking/content_script/rendering.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\nconst Q = require('q');\n\n// Regex to test if the string is likely a facebook user ID\nconst USER_ID_REGEX = /^\\d+$/;\n\nasync function getFBUserInfoByID(api, id) {\n return await Q.nfcall(api.getUserInfo, id);\n}\n\nasync function...
javascript
edit
0
4
mit
bd8e1369263d865f8457ef47c592876279db8be7
Weetbix/facebot
lib/util.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\n/* global URI */\n\n/**\n * QueryConverter stores a list of string to string pairs\n * as a hash (Embereño for POJO) and can export that list as a JSON string,\n * a URL query string, or a hash.\n * We will use the JSON string represent...
javascript
edit
0
1
mit
18c04888ea69acaa86bf43246a1aa135c50c03df
UrbanCCD-UChicago/plenario-explorer,UrbanCCD-UChicago/plenario-explorer,UrbanCCD-UChicago/plenario-explorer
app/utils/query-converter.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\n// Copyright (c) 2015 Uber Technologies, Inc.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software w...
javascript
edit
0
0
mit
cf93826d032895946baf0bfc9742b45dc8623a46
uber/tcurl,uber/tcurl,benfleis/tcurl,bobegir/tcurl
test/index.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\nimport Phaser from 'phaser';\n\nimport { tile, nextTile, alignToGrid, pixelToTile } from '../../tiles';\nimport { clone } from '../../utils';\nimport objectPool from '../../object-pool';\n\nimport tween from './tween';\n\nexport default...
javascript
edit
0
3
mit
5554134cd1b7f4170a8f100672969ed856a3a929
ThomasMays/incremental-forest,ThomasMays/incremental-forest
src/sprites/Common/index.js
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```javascript\nimport {createStore, applyMiddleware, compose} from 'redux';\nimport { routerMiddleware } from 'react-router-redux';\nimport throttle from 'lodash/throttle';\nimport recipes from './data/recipes';\nimport { loadState, saveState } from '...
javascript
edit
0
5
mit
f0c283b2c50c8bc43798efa188feef58c61f0415
blitze/fcc-react-recipebox,blitze/fcc-react-recipebox
src/store/configureStore.js
accepted
null
true