messages listlengths 2 2 | language stringclasses 8
values | prompt_type stringclasses 2
values | lint_errors int64 0 129 ⌀ | cyclomatic_complexity int64 0 32 ⌀ | license stringclasses 7
values | commit stringlengths 40 40 | repos stringlengths 5 116k | new_file stringlengths 4 220 | status stringclasses 6
values | error stringlengths 26 74 ⌀ | is_valid_syntax bool 2
classes |
|---|---|---|---|---|---|---|---|---|---|---|---|
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n'use strict';\nconst util = require('util');\n\nconst CommandUtil = require('../src/command_util').CommandUtil;\nconst l10nFile = __dirname + '/../l10n/commands/remove.yml';\nconst l10n = require('../src/l10n')(l10nFile);\nconst _ = req... | javascript | edit | 0 | 5 | mit | 7d86f812b768a7a703af6bdc9a762d2b7a8de853 | seanohue/ranviermud,seanohue/ranviermud,shawncplus/ranviermud | commands/remove.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n#!/usr/bin/env node\n'use strict';\nvar meow = require('meow');\nvar sha1Cli = require('./');\n\nvar cli = meow([\n\t'Usage',\n\t' $ sha1-cli [input]',\n\t'',\n\t'Options',\n\t' --foo Lorem ipsum. [Default: false]',\n\t'',\n\t'Exampl... | javascript | edit | 0 | 0 | mit | 4567bba78bc90c645e813f88577c6ada3ff7bc5d | niksrc/sha1-cli | cli.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nvar browserify = require('browserify');\nvar brfs = require('brfs');\nvar through = require('through');\nvar fs = require('fs');\n\nrequire('browserify/lib/builtins').fs = 'create-webfs.js'; // TODO: find a better way to replace this mo... | javascript | edit | 0 | 2 | mit | 36e5d39271eeed02fce6453a92ef86aa0462880e | deathcap/webnpm,deathcap/webnpm | demo.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nconst express = require('express');\nconst path = require('path');\nconst fs = require('fs');\nconst router = express.Router();\n\n\n// Stamp css content into html during development.\nrouter.get('/custom-components/:component/*.html',... | javascript | edit | 0 | 2 | bsd-2-clause | ec2c1bf9a9573b0d1dd4ca1c1c86a189a22153f4 | KK578/generator-kk578,KK578/generator-kk578 | generators/polymer-app/templates/server/routes/components.dev.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n'use strict';\n\nvar gulp = require('gulp'),\n config = require('../../config'),\n postcss = require('gulp-postcss'),\n colorguard = require('colorguard'),\n filterstream = require('postcss-filter-stream'),\n scss = requi... | javascript | edit | 0 | 1 | mit | 0a34860a5b02741f8f869d9d17e88d7a00d8cfb2 | craigsimps/gulp-wp-toolkit | tasks/lint/colors.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nimport http from 'http'\nimport request from 'request'\nimport createProxy from '../../src/lib/proxy'\nimport tap from 'tap'\n\nfunction setup (options, cb) {\n if (typeof options === 'function') {\n cb = options\n options = {}\n... | javascript | edit | 0 | 2 | isc | 67d714821f4d1cf8366673c7e5b3e72d578ce4b6 | niklasi/halland-proxy,niklasi/halland-proxy | test/proxy/common.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nvar handleModalsRoute = require('cartodb3/routes/handle-modals-route');\n\ndescribe('routes/handleModalsRoute', function () {\n it('should handle modals route', function () {\n var modals = jasmine.createSpyObj('modals', ['destroy']... | javascript | edit | 0 | 1 | bsd-3-clause | 02419fb3e5089865fbd9c491cfd4b49d2e1e653d | CartoDB/cartodb,CartoDB/cartodb,CartoDB/cartodb,CartoDB/cartodb,CartoDB/cartodb | lib/assets/test/spec/cartodb3/routes/handle-modals-route.spec.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n// Copyright 2015, EMC, Inc.\n\n'use strict';\n\nmodule.exports = {\n friendlyName: 'Install Ubuntu',\n injectableName: 'Task.Os.Install.Ubuntu',\n implementsTask: 'Task.Base.Os.Install',\n schemaRef: 'rackhd/schemas/v1/task... | javascript | edit | 0 | 0 | apache-2.0 | b4757cbef2d1326ae31c9010c49de70b737b9d5a | bbcyyb/on-tasks,AlaricChan/on-tasks,nortonluo/on-tasks,bbcyyb/on-tasks,AlaricChan/on-tasks,nortonluo/on-tasks | lib/task-data/tasks/install-ubuntu.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nconst createFixer = ({range, left, right, operator}, source) => fixer => {\n const [leftStart, leftEnd] = left.range;\n const [rightStart] = right.range;\n const operatorRange = [leftEnd, rightStart];\n const operatorText = source.s... | javascript | edit | 0 | 2 | mit | d84624ec16f82b708e44deb8d5f3172f95dd1764 | CoorpAcademy/eslint-plugin-coorpacademy | src/rules/jsx-no-logical-expression.js | rejected_duplicate | Near-duplicate of sample 88877 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nimport Ember from 'ember';\nimport layout from './template';\n\nimport permissions from 'ember-osf/const/permissions';\n\nexport default Ember.Component.extend({\n READ: permissions.READ,\n WRITE: permissions.WRITE,\n ADMIN: pe... | javascript | edit | 0 | 1 | apache-2.0 | 6a2603f2ada763d2d6b6b410b6906fa3bf870d40 | baylee-d/ember-osf,hmoco/ember-osf,jamescdavis/ember-osf,crcresearch/ember-osf,pattisdr/ember-osf,chrisseto/ember-osf,cwilli34/ember-osf,CenterForOpenScience/ember-osf,hmoco/ember-osf,CenterForOpenScience/ember-osf,pattisdr/ember-osf,crcresearch/ember-osf,binoculars/ember-osf,cwilli34/ember-osf,chrisseto/ember-osf,bayl... | tests/dummy/app/components/contrib-manager/component.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nvar chai = require(\"chai\");\nchai.Should();\nchai.use(require('chai-things'));\nchai.use(require('signalk-schema').chaiModule);\n\nvar mapper = require(\"../n2kMapper.js\");\n\n\ndescribe('129039 Class B Update', function () {\n it('... | javascript | edit | 0 | 1 | apache-2.0 | bc692a8b85694dd231588a223b34ea32ba8849b6 | SignalK/n2k-signalk | test/129809_ais_class_b_static_data.js | rejected_duplicate | Near-duplicate of sample 100869 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n'use strict';\n\nexports.seed = function (knex, Promise) {\n return Promise.join(\n // Deletes ALL existing entries\n knex('lights').del(),\n\n // Inserts seed entries\n knex('lights').insert({\n ... | javascript | edit | 0 | 1 | apache-2.0 | 43f4e0538525cbb9cb1114b150690558a4355f5b | nobbyknox/hal | test/data/seeds/lights.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n(function(module) {\n module.directive(\"displayFileContents\", displayFileContentsDirective);\n function displayFileContentsDirective() {\n return {\n restrict: \"E\",\n controller: 'DisplayFileConten... | javascript | edit | 0 | 4 | mit | b830e5050fdb016f77822e59d6d6551ddc9e33ca | materials-commons/materialscommons.org,materials-commons/materialscommons.org,materials-commons/materialscommons.org,materials-commons/materialscommons.org,materials-commons/materialscommons.org | website/app/application/core/projects/project/files/display-file-contents-directive.js | rejected_duplicate | Near-duplicate of sample 91891 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nmodule.exports = {\n facebook: {\n FACEBOOK_APP_ID: 'YOUR_FACEBOOK_APP_ID',\n FACEBOOK_APP_SECRET: 'YOUR_FACEBOOK_APP_SECRET'\n }\n};\n\n```\n\nApply this change: Create example keys for aws"
},
{
"role": "assistant",
... | javascript | edit | 0 | 0 | mit | 022df8496a9174d80c83441c22651bcd654b032b | inspiredtolive/Picky-Notes,folksy-squid/Picky-Notes,inspiredtolive/Picky-Notes,derektliu/Picky-Notes,inspiredtolive/Picky-Notes,derektliu/Picky-Notes,folksy-squid/Picky-Notes,derektliu/Picky-Notes,folksy-squid/Picky-Notes | example_keys.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n'use strict';\n\nangular.module('insight.address').controller('AddressController',\n function($scope, $rootScope, $routeParams, $location, Global, Address, getSocket) {\n $scope.global = Global;\n\n\n var socket = getSocket($scop... | javascript | edit | 0 | 3 | mit | f50abae460558f5a1dd99b4026f68b22fe6e57d0 | bitpay/bitcore,bitpay/bitcore,bitjson/bitcore,bitjson/bitcore,martindale/bitcore,martindale/bitcore,martindale/bitcore,martindale/bitcore,bitjson/bitcore,bitjson/bitcore,bitpay/bitcore,bitpay/bitcore | public/src/js/controllers/address.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n'use strict';\n\nlet cli = require('heroku-cli-util');\nlet shellescape = require('shell-escape');\nlet co = require('co');\n\nfunction* run (context, heroku) {\n let configVars = yield heroku.request({path: `/apps/${c... | javascript | edit | 0 | 4 | isc | 798536ac5a8119320fec76c2d8a1191b10512242 | heroku/heroku-apps,heroku/heroku-apps | commands/config/get.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nimport {Meteor} from 'meteor/meteor';\nimport {autorun, toJS} from 'mobx';\nimport Movies from '../../api/documents/documents'\n\n\nexport default class Mongo2Mobx {\n constructor(store) {\n this.moviesSubscription = null;\n ... | javascript | edit | 0 | 3 | mit | 3d115b77de5e15ec005929acb00728d133d82d85 | zarazi/movies-listie,zarazi/movies-listie | imports/ui/states/Mongo2Mobx.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nclass MCProcessFilesTableComponentController {\n /*@ngInject*/\n constructor() {\n this.state = {\n files: [],\n };\n }\n\n $onChanges(changes) {\n if (changes.files) {\n this.state... | javascript | edit | 0 | 2 | mit | 16ea8bea2adcd747a171fcc144576fcfc65f43fc | materials-commons/materialscommons.org,materials-commons/materialscommons.org,materials-commons/materialscommons.org,materials-commons/materialscommons.org,materials-commons/materialscommons.org | website/src/app/components2/process-files-table/process-files-table.component.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n'use strict';\n\nvar dbm;\nvar type;\nvar seed;\n\n/**\n * We receive the dbmigrate dependency from dbmigrate initially.\n * This enables us to not have to rely on NODE_PATH.\n */\nexports.setup = function(options, seedLink) {\n dbm... | javascript | edit | 0 | 2 | apache-2.0 | 9fd0a284f0a48a1ed09a25d3fe1d1cbd24802587 | machinomy/machinomy,machinomy/machinomy,machinomy/machinomy | packages/machinomy/migrations/20180325060555-add-created-at.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nenyo.kind({\n\tname: \"moon.sample.IntegerScrollPickerSample\",\n\tclasses: \"moon enyo-unselectable enyo-fit\",\n\tcomponents: [\n\t\t{kind: \"enyo.Spotlight\"},\n\t\t{kind: \"moon.IntegerScrollPicker\", value: 2013, min: 1900, max: 21... | javascript | edit | 0 | 0 | apache-2.0 | 8b8a0ed595428f6712e241623ac5a0b404b22931 | mcanthony/moonstone,mcanthony/moonstone,mcanthony/moonstone,enyojs/moonstone | samples/IntegerScrollPickerSample.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nmodule.exports = {\n\talgorithm \t: 'aes-256-ctr',\n\tpassword \t: 'qmAXae3Ofx9K0NpX4ODB4Dt9l9QhEW',\n\tfilename \t: '.data.db'\n}\n\n\n\n```\n\nApply this change: Remove RSA password from repo."
},
{
"role": "assistant",
"... | javascript | edit | 0 | 0 | bsd-2-clause | 50f24f26524b20b87c59a393ea412224b35cc19f | soachishti/NeONStudentAPI,soachishti/NeONStudentAPI | config.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nimport React from 'react';\nimport CentralColumnLayout from '../../containers/CentralColumnLayout/CentralColumnLayout';\n\nimport { SprkDivider } from '@sparkdesignsystem/spark-core-react';\n\nconst SprkDividerDocs = () => {\n return (... | javascript | edit | 0 | 1 | mit | b38f6995f1d51144bd08c98ee75aee090a3e9ab3 | sparkdesignsystem/spark-design-system,sparkdesignsystem/spark-design-system,sparkdesignsystem/spark-design-system,sparkdesignsystem/spark-design-system | src/react/src/routes/SprkDividerDocs/SprkDividerDocs.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nimport html from \"innerself\";\nimport { connect } from \"./store\";\n\nfunction ScoreScreen({results, target_snapshot}) {\n const score = Math.floor(results[results.length - 1]) * 100;\n return html`\n <img class=\"ui\"\n st... | javascript | edit | 0 | 1 | isc | 3e8299eda13c911fcfd00003bf20ffc0db2ebfd9 | piesku/moment-lost,piesku/moment-lost | src/ScoreScreen.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n// Handlers\nvar\n version = require('./version'),\n content = require('./content'),\n assets = require('./assets');\n\nexports.loadRoutes = function (server) {\n server.get('/version', version.report);\n\n server.get('/content/:id... | javascript | edit | 0 | 1 | mit | 446b0bcdc5dff8d5260151210e0be761e3eab0c3 | deconst/content-service,deconst/content-service | src/routes.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nvar session = require('../env/session'),\n url = require('url');\n\nmodule.exports = {\n\n visit: function (query) {\n var config = require('moonraker').config;\n var path = url.parse(this.url.indexOf('http://') > -1 ? thi... | javascript | edit | 0 | 5 | mit | a8c86273c3a0c2a5e8523b67d500a10911836873 | testingbot/moonraker,riaan53/moonraker,blackout314/moonraker,tegud/moonraker,LateRoomsGroup/moonraker,LateRoomsGroup/moonraker,blackout314/moonraker,dandv/moonraker,testingbot/moonraker,dandv/moonraker,riaan53/moonraker,tegud/moonraker | lib/utils/page-utils.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nimport express from 'express';\nimport bodyParser from 'body-parser';\n\nimport log from './log';\nimport database from './database';\nimport configureHelmet from './middleware/configure-helmet';\nimport requestLogger from './middleware... | javascript | edit | 0 | 2 | mit | 1d369069e7700d9898e3cf8384d405c580396aaa | csblogs/api-server,csblogs/api-server | src/server.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nimport React from 'react';\nimport resumeStructures from './resume-structures';\nimport { capitalize } from 'lodash';\n\nconst buildForm = ([section, attributes]) => props => {\n\n const handleSubmit = (e) => {\n e.preventDefault();... | javascript | edit | 0 | 1 | mit | 4f2f792add2d08f0f843d484ade13bf8b3ed4365 | maxmechanic/resumaker,maxmechanic/resumaker | app/js/forms.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nvar forever = require('forever-mac');\nvar config = require('./config');\n\nfunction start () {\n forever.list('array', function (err, processes) {\n \n // stop all forever\n if (config === 'stop') {\n\n ... | javascript | edit | 0 | 6 | mit | 8a8a6a65bef69f50ab3ae47a6895dc2ddb79c70a | jillix/flow-nodejs | _lib/server/start.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nimport { coreInit } from 'isolated-core'\n\nconst CSS2 = { __html: require('./style2.less') }\n\ncoreInit({\n scriptURL: 'green.js',\n run: core => {\n const React = require('react')\n const DemoUI = require('./DemoUI').default\... | javascript | edit | 0 | 1 | mit | ce567c59e7b975961c7e0a1435ee83f56389fa7e | chromakode/isolated-core,chromakode/isolated-core,chromakode/isolated-core | demo/core.green.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n'use strict';\n\nprocess.stdin.pipe(require('fs').createWriteStream(__dirname + '/output.txt'));\nprocess.stdout.write('output written');\nprocess.stderr.write('error log exists');\n\nsetTimeout(function () {\n process.exit(13);\n}, 50... | javascript | edit | 0 | 1 | mit | 4243ae7ad3a9b69e3d02b8705d083e8dfae58141 | bcoe/spawn-sync,ForbesLindesay/spawn-sync,terabyte/spawn-sync,tmagiera/spawn-sync | test/test-spawn-fail.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n(function() {\n 'use strict';\n\n angular\n .module('app.layout')\n .directive('pvTopNav', pvTopNav);\n\n /* @ngInject */\n function pvTopNav () {\n var directive = {\n bindToController: true,... | javascript | edit | 0 | 2 | apache-2.0 | 588f88f9e530c92f7fd02737ab511f2a22dde80f | Poniverse/Poniverse.net | src/client/app/layout/pv-top-nav.directive.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nimport Obj from '../foundation/Object';\n\n/**\n Property: O.activeViews\n Type: O.Object\n\n Maps from id to the view object for all views currently in a document.\n\n Views with a manually specified ID are added using <O.C... | javascript | edit | 0 | 5 | mit | 54da4bc5ebbbfaf3ef4cb0485d19c47d58c54a33 | fastmail/overture | source/views/activeViews.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n// Source Server Stats\n// File: sourcestats/webpack/util.js\n// Desc: utility functions for the frontend\n\n\nexport function timeAgo(dateString) {\n const date = new Date(dateString);\n const seconds = Math.floor((new Date() - d... | javascript | edit | 0 | 6 | mit | 1f18956589b16ffc6cc312d104d113139b516e6d | Fizzadar/SourceServerStats,Fizzadar/SourceServerStats,Fizzadar/SourceServerStats | sourcestats/webpack/util.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nvar nfc = require('nfc').nfc;\nvar n = new nfc();\n\nvar middleware = function (req, res, next) {\n res.sseSetup = function() {\n res.writeHead(200, {\n 'Content-Type': 'text/event-stream',\n 'Cache-Contr... | javascript | edit | 0 | 3 | mit | 4dbd8db4145fafc6e88b6be1e90145e5b22c9e2d | anderssonjohan/nfc-express | nfc.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nfunction getDescriptionAndTags(input) {\n const pieces = input.split(' ');\n\n const descriptionPieces = [];\n const tags = [];\n\n pieces.forEach(piece => {\n if (piece[0] === '#') {\n tags.push(piece.slice(1)); // tag with... | javascript | edit | 0 | 2 | mit | b95980041727664708554ea9876b73216439506d | mknudsen01/today,mknudsen01/today | src/helpers.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nexport class BasketTemplate {\n static update(render, state, events) {\n const headerClasses = \"fw6 bb b--black-20 tl pb1 pr1 bg-white\";\n const trClasses = \"pv1 pr1 bb b--black-20\";\n\n /* eslint-disable ind... | javascript | edit | 0 | 0 | mit | e74840fcd3b6204f3dd65f5151729a646aeefe3a | albertosantini/node-conpa,albertosantini/node-conpa | src/client/app/components/basket/basket.template.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n'use strict';\nconst config = require('./config');\nconst gooGl = require('goo.gl');\nconst moment = require('moment-timezone');\nconst removeUrlGarbage = require('link-cleaner');\n\nif (config.shortenLinks) {\n gooGl.setKey(config.g... | javascript | edit | 0 | 3 | mit | c94b317ac7f44494e8d9a97f5b2c25ebbcf50d53 | andre487/news487,andre487/news487,andre487/news487,andre487/news487 | lib/formatter.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nxdescribe('Install Package Modal', function () {\n\n beforeEach(function () {\n cy\n .configureCluster({\n mesos: '1-task-healthy',\n universePackages: true\n })\n .visitUrl({url: '/universe'})\n .g... | javascript | edit | 0 | 1 | apache-2.0 | 3a5ea9fc0b9eec3040a3986be6e47187449de227 | dcos/dcos-ui,dcos/dcos-ui,dcos/dcos-ui,dcos/dcos-ui,dcos/dcos-ui | tests/pages/universe/packages/InstallPackageModal-cy.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n\n/**\n * Module dependencies.\n */\n\nimport packageConfig from './package.json';\nimport webpack from 'webpack';\n\n/**\n * Webpack configuration.\n */\n\nexport default {\n entry: './src/browser/index.js',\n module: {\n loaders:... | javascript | edit | 0 | 0 | mit | 011d3f2af278150c57c20e70ce5d0ccf69c070d0 | uphold/uphold-sdk-javascript,uphold/uphold-sdk-javascript | webpack.config.babel.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nimport React, { Component } from 'react';\nimport Icon from 'react-native-vector-icons/FontAwesome';\n\nimport styles from './styles';\n\n/**\n * Thumbnail badge for displaying the audio mute status of a participant.\n */\nexport class ... | javascript | edit | 0 | 1 | apache-2.0 | 2968f8edf801fdf651539f3662208454831b268a | jitsi/jitsi-meet,gpolitis/jitsi-meet,jitsi/jitsi-meet,jitsi/jitsi-meet,bgrozev/jitsi-meet,gpolitis/jitsi-meet,gpolitis/jitsi-meet,gpolitis/jitsi-meet,jitsi/jitsi-meet,jitsi/jitsi-meet,jitsi/jitsi-meet,bgrozev/jitsi-meet,jitsi/jitsi-meet,bgrozev/jitsi-meet,gpolitis/jitsi-meet,bgrozev/jitsi-meet,gpolitis/jitsi-meet,gpoli... | react/features/filmstrip/components/native/AudioMutedIndicator.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n//Karyo Options\r\nKaryo.prototype.Options = function(opt)\r\n{\r\n //Check preview regions\r\n if(typeof opt.previewRegions !== 'undefined'){ this.chrpreview.show = opt.previewRegions; }\r\n\r\n //Check navbar height\r\n if(typeof ... | javascript | edit | 0 | 12 | mit | df19b8ff3c81b2970801f33017e5a8d1888994f1 | biowt/karyojs,biowt/karyojs | src/options.js | rejected_complexity | Cyclomatic complexity too high: 12 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nexport default /* glsl */`\nuniform vec3 color;\nuniform float opacity;\n\n#include <common>\n#include <packing>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <shadowmap_pars_fragment>\n#include... | javascript | edit | 0 | 0 | mit | 07b21357297e002a70de3b9336594a54b1cf56e1 | Itee/three.js,Samsy/three.js,Liuer/three.js,TristanVALCKE/three.js,06wj/three.js,TristanVALCKE/three.js,makc/three.js.fork,makc/three.js.fork,WestLangley/three.js,fraguada/three.js,fraguada/three.js,Samsy/three.js,Samsy/three.js,fyoudine/three.js,TristanVALCKE/three.js,Samsy/three.js,TristanVALCKE/three.js,zhoushijie16... | src/renderers/shaders/ShaderLib/shadow_frag.glsl.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\ndefine(\n\t['backbone', 'views/filenameview', 'collections/files', 'app'],\n\tfunction(Backbone, FilenameView, Files, app) {\n\tvar FilesView = Backbone.View.extend({\n\t\ttagName: 'ul',\n\n\t\tinitialize: function(options) {\n\t\t\topt... | javascript | edit | 0 | 2 | mit | 3b6751431a68c5e56df77d4fc72d0cd255708c4c | anttisykari/angular-fileedit,anttisykari/backbone-fileedit | client/app/views/filesview.js | rejected_duplicate | Near-duplicate of sample 86720 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nconst exec = require('child_process').exec;\nconst inspect = require('util').inspect;\nconst fs = require('fs');\nconst path = require('path');\nconst del = require('del');\nconst mkdirp = require('mkdirp');\n\nconst command = 'node';\n... | javascript | edit | 0 | 3 | mit | ad21ee818aa0c44317ca472c6d9e027cdde1e946 | sttk/testrun | lib/scriptrun.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n'use strict';\n\nmodule.exports = {\n\tplugins: [\n\t\t'jest',\n\t],\n\tenv: {\n\t\t'jest/globals': true,\n\t},\n\textends: [\n\t\t'./index',\n\t\t'./rules/plugin-jest',\n\t].map(require.resolve),\n};\n\n```\n\nApply this change: Apply ... | javascript | edit | 0 | 0 | isc | 394e49f268ff920b307bfee589f6e4afa18cb4b1 | CoursePark/eslint-config-bluedrop,CoursePark/eslint-config-bluedrop | jest.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n;(function () {\n 'use strict';\n\n if ('relList' in document.createElement('a')) {\n return;\n }\n\n var i;\n var elements = [HTMLAnchorElement, HTMLAreaElement, HTMLLinkElement];\n var getter = function () {\n... | javascript | edit | 0 | 3 | mit | 89dde9dc27f16239de4ccc3add29fcf49cfb0ef8 | jwilsson/domtokenlist,jwilsson/domtokenlist | src/relList.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nmodule.exports = function(config) {\n var mongoose = require('mongoose');\n\n var db = mongoose.connection;\n var schemas = {};\n\n var eventSchema = new mongoose.Schema({\n 'category': String,\n 'coordinates': {\n 'latit... | javascript | edit | 0 | 2 | mit | 9a1da20065104aa4dae087c1589b413db4f84ec0 | volontario/volontario-server | server/app/mongoose-connection.js | rejected_duplicate | Near-duplicate of sample 95652 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n/*jshint node:true*/\n/* global require, module */\nvar EmberAddon = require('ember-cli/lib/broccoli/ember-addon');\n\nmodule.exports = function(defaults) {\n var app = new EmberAddon(defaults, {\n // Add options here\n });\n\n /*... | javascript | edit | 0 | 2 | mit | c88bd7ead48d63ddc18bc232af80ee38a5630470 | thoov/ember-websockets,thoov/ember-websockets | ember-cli-build.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n$(document).on(\"page:change\", function(){\n $(\"select.multi-select\").multiselect({\n buttonWidth: '200px',\n buttonText: function(options) {\n if (options.length) {\n return \"Pick a strategy (\" + options.length ... | javascript | edit | 0 | 2 | mit | 803a4a2d5b965bf2d96edba6879104439093d331 | quintel/etmoses,quintel/etmoses,quintel/etmoses,quintel/etmoses,quintel/etmoses | app/assets/javascripts/multi_select.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n/**\n * Module dependencies\n */\n\nvar Zeditor = require('zeditor');\nvar ZeditorPaste = require('zeditor-paste');\n\n/**\n * Get DOM nodes\n */\n\nvar editorNode = document.getElementById('editor');\n\n/**\n * Instantiate editor\n */\... | javascript | edit | 0 | 1 | mit | d1e537a39deff3fe6d37a80f1d8e3f5f523ced2d | bmcmahen/zeditor,Automattic/zeditor,Automattic/zeditor,bmcmahen/zeditor,bmcmahen/zeditor,Automattic/zeditor,bmcmahen/zeditor,Automattic/zeditor | example/app.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nconst {app, BrowserWindow, globalShortcut} = require('electron')\nconst { resolve } = require('path')\n\nlet win = null\n\napp.on('window-all-closed', function () {\n if (process.platform !== 'darwin') {\n app.quit()\n }\n})\n\napp... | javascript | edit | 0 | 2 | isc | 598be47bf009eb5152dad93a3e19fd6f75d47415 | niklasi/halland-proxy,niklasi/halland-proxy | app/index.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nimport React, {Component} from 'react'\nimport { Link } from 'react-router-dom';\nimport PropTypes from 'prop-types'\nimport escapeRegExp from 'escape-string-regexp'\nimport sortBy from 'sort-by'\nimport Book from './Book'\n\nclass Book... | javascript | edit | 0 | 1 | mit | 8deb21a9fe7e50a9b20557d485656470188f30d4 | miquelarranz/my-books,miquelarranz/my-books | src/components/BooksList.js | accepted | null | true |
[
{
"role": "user",
"content": "Write javascript code for the following: Add the admin waiting requests controller"
},
{
"role": "assistant",
"content": "'use strict';\n\nvar ctrlFactory = require('restitute').controller;\n\n\n\nfunction listController() {\n ctrlFactory.list.call(this, '/rest/a... | javascript | new_file | 0 | 1 | mit | a6919e1c6eb39b10b165ce75ad9f63a2b48bb746 | gadael/gadael,gadael/gadael | rest/admin/waitingrequests.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nconst hibp = require('hibp');\n\n/**\n * Fetches all breached sites in the system.\n *\n * @param {string} domain a domain by which to filter the results (default: all\n * domains)\n * @returns {array} an array of breach objects (an emp... | javascript | edit | 0 | 1 | mit | a86f49fb6d0f2dcb7b33aabc18f26205763a2e53 | wKovacs64/hibp-stdlib | functions/breaches/__main__.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nimport mapKeys from 'lodash/mapKeys';\nimport mapValues from 'lodash/mapValues';\nimport camelCase from 'lodash/camelCase';\nimport snakeCase from 'lodash/snakeCase';\n\nfunction ensureTypeSnakeCase(value) {\n if (typeof value === 'str... | javascript | edit | 0 | 5 | mit | 373343c27c280e2e13e78a083779278c419cb49e | lyw07/kolibri,learningequality/kolibri,DXCanas/kolibri,mrpau/kolibri,indirectlylit/kolibri,learningequality/kolibri,learningequality/kolibri,DXCanas/kolibri,lyw07/kolibri,DXCanas/kolibri,indirectlylit/kolibri,DXCanas/kolibri,lyw07/kolibri,mrpau/kolibri,indirectlylit/kolibri,lyw07/kolibri,mrpau/kolibri,mrpau/kolibri,lea... | kolibri/core/assets/src/state/mappers.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nStorage.prototype.setObject = function (key, value) {\n this.setItem(key, JSON.stringify(value));\n};\n\nStorage.prototype.getObject = function (key) {\n var value = this.getItem(key);\n if (value) {\n return JSON.parse(... | javascript | edit | 0 | 2 | mit | 22e0ceeabba815d2cf0ea743e7d0f441f2f68fa0 | endemic/shikaku-madness-arcadia,endemic/shikaku-madness-arcadia,endemic/shikaku-madness-arcadia,endemic/shikaku-madness-arcadia,endemic/shikaku-madness-arcadia,endemic/shikaku-madness-arcadia,endemic/shikaku-madness-arcadia,endemic/shikaku-madness-arcadia | src/lib/storage-extensions.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nclass BrowseController {\n constructor($scope, $uibModalInstance, ImageFactory, text) {\n 'ngInject';\n\n var imageCount = 60;\n\n $scope.text = text;\n $scope.photos = [];\n $scope.canShowPhotos = false;\n\n var getI... | javascript | edit | 0 | 2 | mit | eb858442b557900d9b1a50d6ad787e8c0d1240e8 | hendryl/Famous-Places-CMS,hendryl/Famous-Places-CMS | src/app/places/browse/browse.controller.js | rejected_duplicate | Near-duplicate of sample 84092 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n(function () {\n 'use strict';\n\n module.exports = function (gulp, plugins, config) {\n return function () {\n return plugins.vinylFs.src(config.patternsPath + '/**/*.icons.svg')\n .pipe(plugins.plumber({ errorHandler:... | javascript | edit | 0 | 1 | mit | b9b98aba71d37a737661824b4e9e8599a6123713 | chanceaclark/rocketbelt,chanceaclark/rocketbelt,chanceaclark/rocketbelt,jkeddy/rocketbelt,jkeddy/rocketbelt,Pier1/rocketbelt,jkeddy/rocketbelt,Pier1/rocketbelt | gulp-tasks/link-svg.js | rejected_duplicate | Near-duplicate of sample 89370 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n/* eslint-env browser */\n\n'use strict';\n\nmodule.exports = {\n preload() {\n\n },\n\n init() {\n this.state.load('main');\n },\n};\n\n```\n\nApply this change: Use the correct funciton call..."
},
{
"role": "assistant"... | javascript | edit | 0 | 1 | mit | f9a07a6b338329fd9881541ea63bdc77ec15756e | to-the-end/to-the-end,to-the-end/to-the-end | states/load.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n// Written in jquery\n\n// Makes the \"Refresh\" button print a new aphorism\n\n// Prints an aphorism as soon as the page is started\n\n$(function(){\n $(\"#output\").text(\"Testing testing\");\n\n // Prints new aphorism when Refresh ... | javascript | edit | 0 | 1 | mit | 034088a889f414b12de32b8cd6cf1c096457a80b | marbiru/kafka,marbiru/kafka | main.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n// dev only: async fetch bundle\n\nconst arrowURLs = [ 'https://github.com' ];\n\nchrome.tabs.onUpdated.addListener(function(tabId, changeInfo, tab) {\n if (changeInfo.status !== 'loading') return;\n const matched = arrowURLs.every(ur... | javascript | edit | 0 | 3 | mit | df2db9ee11f2d197c4329b2c8a6e197da1edffd4 | zalmoxisus/browser-redux,jordanco/drafter-frontend,zalmoxisus/crossbuilder,zalmoxisus/browser-redux,jordanco/drafter-frontend,zalmoxisus/crossbuilder,zalmoxisus/crossbuilder,jordanco/drafter-frontend,zalmoxisus/browser-redux | src/browser/extension/background/inject.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nmodule.exports = function (req) {\n\tfunction getParam(paramName) {\n\t\tif (req.query && typeof req.query[paramName] !== 'undefined')\n\t\t\treturn req.query[paramName];\n\t\telse if (req.body && typeof req.body[paramName] !== 'undefin... | javascript | edit | 0 | 7 | mit | 7eaddddd6549107cd87f9ac6332c6fb88bf9d8f0 | MauriceButler/simple-oauth-server,geek/OAuth | authServer/context.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nimport gulpLoadPlugins from 'gulp-load-plugins';\nimport pkg from './package.json';\nconst $ = gulpLoadPlugins();\n\nexport default {\n 'js': () => [\n $.sourcemaps.init(),\n // Exclude files in `app/nobabel`\n $.if(file => !/... | javascript | edit | 0 | 0 | mit | 1053e0faf38d8d5ac691655424cf21b39669890f | surma/surma.github.io,surma/surma.github.io | gulppipelines.babel.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n(function() {\n var Color;\n\nchromato = function(x, y, z, m) {\n return new Color(x, y, z, m);\n};\n\n\nchromato.color = function(x, y, z, m) {\n return new Color(x, y, z, m);\n};\n\n chromato.color = function(x, y, z, m) {\n re... | javascript | edit | 0 | 4 | mit | 701ecaee76273075296bc1b9a5f46e24320b1f3d | WeAreVisualizers/chromatography | chromatography.js | rejected_duplicate | Near-duplicate of sample 97106 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nvar fs = require('fs');\nvar q = require('q');\nvar sysu = require('util');\n\nvar resolve = require('./resolve');\n\nfunction loadCredentials(credentials) {\n\n\t// Prepare PKCS#12 data if available\n\tvar pfxPromise = resolve(cre... | javascript | edit | 0 | 8 | mit | 88c5656f5f542a1b1fa6850f70db5972c1be0b50 | F4-Group/node-apn,telerik/node-apn,madshell/node-apn,guoyu07/node-apn,hilllinux/node-apn,tempbottle/node-apn,argon/node-apn,node-apn/node-apn,guytuboul/node-apn,maximeloizeau/node-apn,lopper/node-apn | lib/credentials/load.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n// Includes\nvar setRank = require('../setRank.js').func;\nvar getRoles = require('./getRoles.js').func;\nvar getRankNameInGroup = require('./getRankNameInGroup.js').func;\n\n// Args\nexports.required = ['group', 'target', 'change'];\ne... | javascript | edit | 0 | 4 | mit | d40ebb1e43ba8338db40dc4f8d4e8a8768bf53df | OnlyTwentyCharacters/roblox-js,sentanos/roblox-js,FroastJ/roblox-js | lib/util/changeRank.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nvar path = require('path')\n, http = require('http')\nexports = function(port){\n http.createServer(require.main.exports.get).listen(port)\n}\n\n```\n\nApply this change: Watch current application's entry point directory"
},
{
... | javascript | edit | 0 | 1 | mit | 11212d00fdd99ad178024506e6752b190c5de0a7 | arpith/fsjs | fsjs.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n(function () {\n\n var express = require('express')\n , namespace = require('express-namespace')\n , Multiplexer = require('./lib/Multiplexer')\n , _ = require('lodash')\n , debug = require('... | javascript | edit | 0 | 2 | apache-2.0 | dde35a6843115c89a57988014796a817892004aa | sbender9/signalk-server-node,sbender9/signalk-server-node,jaittola/signalk-server-node,lsoltero/signalk-server-node,mauroc/signalk-oauth-node,jaittola/signalk-server-node,SignalK/signalk-server-node,lsoltero/signalk-server-node,webmasterkai/signalk-server-node,mauroc/signalk-oauth-node,webmasterkai/signalk-server-node,... | lib/index.js | accepted | null | true |
[
{
"role": "user",
"content": "Write javascript code for the following: Clear Drupal caches is sort of working, but need to figure out if $PATH is available in the environment"
},
{
"role": "assistant",
"content": "// Clear Drupal Caches.\nHooks.addMenuItem(\"Actions/Drupal/Clear Drupal caches\",... | javascript | new_file | 0 | 3 | mit | 8080fc0a3db3a7a276a74a59dbf7925d8eb5a9de | shrop/drupal.chocmixin | init.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nimport React from 'react'\nimport SimpleMDE from 'react-simplemde-editor'\n\nconst PoemEditor = (props) => {\n const extraKeys = {\n // 'Ctrl-Enter': () => { props.handleEditorSubmit() },\n 'Cmd-Enter': () => { props.handleEditor... | javascript | edit | 0 | 1 | mit | de3f66469f6cb68bf742f8a1f96d0cc7deb0a0aa | tanaka0325/manday_web,tanaka0325/manday_web | src/js/components/PoemEditor.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nimport React from 'react';\nimport PropTypes from 'prop-types';\nimport { Bar } from 'react-chartjs-2';\n\nimport { round } from '../utils/format';\n\nexport default function BarChart({ data, yAxisLabel, xAxisLabels }) {\n const series... | javascript | edit | 0 | 1 | bsd-3-clause | 898a49ef9f184ce94f084f1dd060ae65b6685691 | openaq/openaq.org,openaq/openaq.org,openaq/openaq.org | app/assets/scripts/components/bar-chart.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n/*\n * This class represents actors in the game\n */\n'use strict';\nimport Ball from 'Ball.js';\n\nconst actorsDefinitions = {\n ball: {\n xVelocity: 0,\n yVelocity: 0,\n radius: 10\n }\n};\n\nexport default class {\n const... | javascript | edit | 0 | 1 | mit | 6697a07cf628d048203328829b14f8249f3c29c0 | BAJ-/robot-breakout,BAJ-/robot-breakout | js/Actors.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\njQuery.entwine(\"editlock\", function($) {\n\n\t$('.cms-edit-form').entwine({\n\t\tRecordID: null,\n\t\tRecordClass: null,\n\t\tLockURL: null,\n\t\tonmatch: function() {\n\t\t\tif(this.hasClass('edit-locked')){\n\t\t\t\tthis.showLockMes... | javascript | edit | 0 | 4 | bsd-3-clause | 3def618a5cf5607a9bbe95cb1d349de83224565c | sheadawson/silverstripe-editlock,sheadawson/silverstripe-editlock | javascript/editlock.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nimport gulp from 'gulp';\nimport append from 'gulp-add-src';\nimport babel from 'gulp-babel';\nimport mocha from 'gulp-mocha';\nimport del from 'del';\nimport runSequence from 'run-sequence';\n\nvar config = {\n paths: {\n js: {\n ... | javascript | edit | 0 | 1 | mit | 8556cc0c4efbbaef3bed161e02091fc3b8311ca9 | classy-org/classy-node | gulpfile.babel.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nimport makeOrganism from '../../../src'\nimport * as loadItemsState from '../state/placeholderAPI'\nimport Items from '../components/Items'\n\n// export default makeOrganism(Items, loadItemsState)\n\nconst baseURL = 'https://jsonplaceho... | javascript | edit | 0 | 3 | mit | 7df5fc20ce6cb8d7c7b27d8ecb723ef6ce7c02c4 | RoyalIcing/react-organism | demo/src/organisms/Items.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nmodule.exports = {\n \"extends\": \"./\",\n\n \"parser\": \"babel-eslint\",\n\n \"env\": {\n \"es6\": true\n },\n\n \"rules\": {\n\n // Override to warn about unnecessary Use Strict Directives\n \"strict\": [1, \"never\"],... | javascript | edit | 0 | 0 | mit | e08ebf35824281c6362107bf597acf06c1043421 | Springworks/eslint-config-springworks | babel.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n'use babel'\n\nimport RandomTipPanel from '../lib/random-tip-panel'\n\ndescribe('RandomTipPanel', () => {\n let panel = null\n beforeEach(() => {\n panel = new RandomTipPanel('user-support-helper-test')\n\n panel.add('foo', 'bar... | javascript | edit | 0 | 2 | mit | 2463c4353cd46f12d4caaf44840d009779834dd0 | HiroakiMikami/atom-user-support-helper | spec/random-tip-panel-spec.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nimport Expo from 'expo';\nimport React from 'react';\nimport PropTypes from 'prop-types';\nimport { View } from 'react-native';\n\n// we don't want this to require transformation\nclass AwakeInDevApp extends React.Component {\n static ... | javascript | edit | 0 | 4 | mit | 5d85c4b3198ecadbdaa5ae1941de34b771463e2a | sysgears/apollo-universal-starter-kit,sysgears/apollo-universal-starter-kit,sysgears/apollo-fullstack-starter-kit,sysgears/apollo-universal-starter-kit,sysgears/apollo-universal-starter-kit | src/mobile/AwakeInDevApp.js | rejected_duplicate | Near-duplicate of sample 70836 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n/* jshint node: true */\n\nmodule.exports = function(environment) {\n var ENV = {\n modulePrefix: 'smallprint',\n environment: environment,\n baseURL: '/',\n locationType: 'auto',\n EmberENV: {\n FEATURES: {\n ... | javascript | edit | 0 | 4 | mit | 79477e68eff4eff0bf1924ba9a586df58fde935d | OPCNZ/priv-o-matic,Br3nda/priv-o-matic,Br3nda/priv-o-matic,OPCNZ/priv-o-matic | config/environment.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n\n// TypeDoc Configuration\nmodule.exports = {\n out: '../../docs/dist/api/rev-models',\n\n readme: './DOCINDEX.md',\n includes: './src',\n theme: '../../docs/typedoc/theme/',\n \n mode: 'file',\n excludeExternals: ... | javascript | edit | 0 | 0 | mit | 580f65f87d7ae075d325332149185c43cfdb5141 | RevFramework/rev-framework,RevFramework/rev-framework | packages/rev-models/typedoc.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n/**\n * @license Angulartics v0.17.0\n * (c) 2013 Luis Farzati http://luisfarzati.github.io/angulartics\n * License: MIT\n */\n(function(angular) {\n'use strict';\n\n/**\n * @ngdoc overview\n * @name angulartics.segment.io\n * Enables a... | javascript | edit | 0 | 3 | mit | e312227fb99e871b0e6fc5a847e1d57a28ab0b6a | mushkab/angulartics,TallyFox/angulartics,WoodWing/angulartics,dy2288/angulartics,iamakimmer/angulartics,cwill747/angulartics,angulartics/angulartics,jung01080/angulartics,indiegogo/angulartics,geordie--/angulartics,marcin-wosinek/angulartics,martijndejongh/angulartics,aheuermann/angulartics,abhilashsajeev/angulartics,I... | src/angulartics-segmentio.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nimport { Link as GatsbyLink } from \"gatsby\"\nimport React from \"react\"\n\nconst styles = {\n borderRadius: \"0.3em\",\n code: {\n textShadow: \"none\",\n },\n}\n\nconst Link = props => {\n if (props.hasOwnProperty(\"to\")) {\... | javascript | edit | 0 | 4 | mit | 4adfb1a39013feb66bf6d1d8fca75caac7241c37 | jbhannah/jbhannah.net,jbhannah/jbhannah.net | src/components/Link/index.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nimport React, { Component } from 'react';\n\nclass SearchBar extends Component {\n render() {\n return <input />;\n }\n};\n\nexport default SearchBar;\n\n```\n\nApply this change: Add constructormethod and set state on input value ... | javascript | edit | 0 | 1 | mit | 49456960a85dfb9f380abe1f1a429564ac2130fd | izabelka/redux-simple-starter,izabelka/redux-simple-starter | src/components/search_bar.js | rejected_duplicate | Near-duplicate of sample 78503 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nimport Promise from 'bluebird';\n\n//\n// getLastTimetamp will get the last indexing timestamp from Firebase\n//\nconst getLastTimestamp = ({ CONFIG, dataset, fb }) => {\n\n if (!CONFIG.timestampField || !CONFIG.firebase.uid || !data... | javascript | edit | 0 | 4 | mit | ecf8ce910360d232f1c729ad488d8047d23a9f53 | webstylestory/figolia,webstylestory/algolia-firebase-indexer | src/get-last-timestamp.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nfunction yyid() {\n /* eslint-disable arrow-body-style, no-plusplus */\n if (!window.crypto) {\n return 'xx-x-x-x-xxx'.replace(/x/g, () => {\n return Math.floor((1 + Math.random()) * 0x10000).toString(16).substring(1)\n })\... | javascript | edit | 0 | 2 | mit | 18b22a8cc0c8de565a9b14b2eb24a4109fc511a1 | janlelis/yyid.js | yyid.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n#! /usr/local/bin/node\n\nconst fs = require('fs')\nconst add = require('./commands/add')\nconst list = require('./commands/list')\nconst done = require('./commands/done')\n\nconst command = process.argv[2]\nconst argument = process.arg... | javascript | edit | 0 | 0 | mit | a0b1d9966a30859d004ee6feb2b9623a05fa5965 | breyana/Command-Line-Todo-List | task.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nconst test = require('blue-tape')\nconst Dexie = require('dexie')\nconst DexieBatch = require('./dexie-batch')\n\nconst batchSize = 10\nconst testEntries = Array(42).fill().map((_, i) => i)\n\ntestWithTable('basic operation', (t, table)... | javascript | edit | 0 | 2 | mit | 9710aeb0ef670c41f5ac18709c199f12dda94139 | raphinesse/dexie-batch | spec.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nexports.name = 'adapter-base-express';\n\nexports.attach = function(/* options */){\n var self = this;\n\n /**\n * This plugin requires that a template engine plugin has already\n * been loaded:\n */\n\n if (!self.engine){\n ... | javascript | edit | 0 | 4 | mit | ecc99fcf52d07c8eb89060e3544b9f3f97b62656 | markbirbeck/adapter-template | lib/express.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nimport * as types from './actionTypes'\n\nexport function changeDate (date) {\n return {\n type: types.CHANGE_DATE,\n date,\n }\n}\n\n```\n\nApply this change: Save buffer when changing date, and load the new date's buffer\n\nSt... | javascript | edit | 0 | 1 | mit | b7196b5b93ccb19a23aa3e21c3c8cd3708941e8e | yurivyatkin/zhurnik-webapp,yurivyatkin/zhurnik-webapp | src/store/calendar/actions.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nconst PropTypes = require('prop-types');\nconst React = require('react');\nconst Button = require('./Button');\nconst SimpleSelect = require('./SimpleSelect');\n\nclass HeaderMenu extends React.Component {\n static propTypes = {\n b... | javascript | edit | 0 | 2 | mit | abc5eda09a114faca128a18ecb045dcc1e1522ae | mxenabled/mx-react-components | src/components/HeaderMenu.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\ngoogle.charts.load('current', {'packages':['corechart']});\n\nfunction drawChart() {\n // Instead of the following, get the visits and days array from localStorage\n var visits = [5, 10, 7,20,10];\n\n var data=[];\n\n var Header= ['... | javascript | edit | 0 | 2 | apache-2.0 | 3fdd8e937840660ab52be3e73e655c9af2d31009 | googleinterns/step87-2020,googleinterns/step87-2020,googleinterns/step87-2020,googleinterns/step87-2020 | src/main/webapp/dashboard.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nclass persist {\n static get SESSION_TOKEN_KEY () { return 'sessionToken' }\n static willGetSessionToken() {\n return new Promise(resolve => {\n try {\n resolve(localStorage && localStorage.getItem(persist.SESSION_TOKEN... | javascript | edit | 0 | 2 | mit | 1bc7f6a7b12e4050277bb375b393731032008077 | digithun/jamplay-nap,digithun/jamplay-nap,digithun/nap,digithun/jamplay-nap,rabbotio/nap,digithun/nap,rabbotio/nap,digithun/nap | lib/persist.js | accepted | null | true |
[
{
"role": "user",
"content": "Write javascript code for the following: Set up models for DB"
},
{
"role": "assistant",
"content": "const mongoose = require('mongoose');\n\nconst noteSchema = mongoose.Schema({\n user_id: String,\n // not sure what notes should be\n notes: Array,\n // this sho... | javascript | new_file | 0 | 0 | mit | 61dbd38378d85260e7af27608ada77a2eca52105 | enchanted-spotlight/Plato,enchanted-spotlight/Plato | db/models/note.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n\nvar moment = require('moment');\n\n// note that month indices are zero-based\n\nmodule.exports.DATA_START_YEAR = 2012;\nmodule.exports.DATA_START_MONTH = 0;\n\nmodule.exports.DATA_END_YEAR = 2015;\nmodule.exports.DATA_END_MONTH = 9;\n... | javascript | edit | 0 | 0 | mit | bda2cf353e87d132bc946a8af69c586e74c5068f | lucified/lucify-refugees,lucified/lucify-refugees,lucified/lucify-refugees,lucified/lucify-refugees | src/js/model/refugee-constants.js | rejected_duplicate | Near-duplicate of sample 96505 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n'use strict';\n\nconst chai = require('chai');\nconst {expect} = chai;\nconst {sandbox} = require('sinon');\nchai.use(require('sinon-chai'));\n\ndescribe('TalkAction', () => {\n let TalkAction, TalkStore;\n\n before(() => {\n sandb... | javascript | edit | 0 | 1 | mit | 677114100cbb3dc4547c3223ec6a58bcceeb4db0 | MaxMEllon/comelon,MaxMEllon/comelon | test/actions/TalkAction_spec.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nconst {bindActionCreators} = require('redux')\nconst store = require('../store')\nconst globals = require('./globals')\nconst captures = require('./captures')\n\nconst unboundActions = Object.assign({}, globals, captures)\nconst actions... | javascript | edit | 0 | 0 | mit | f47e265c5bffc2871bd1f4cb90c73531de292280 | onfido/onfido-sdk-core | src/store/actions/actions.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n'use strict';\n\n/* global CartUtility */\nmodule.exports = function ($scope, $location, $window) {\n CartUtility.log('CartBlogListCtrl');\n};\n```\n\nApply this change: Add new blog post redirect function button."
},
{
"role... | javascript | edit | 0 | 1 | mit | 2f7516bfc7024d25ff424e4619ad7e3ca6eee5b0 | agreatfool/Cart,agreatfool/Cart,agreatfool/Cart,agreatfool/Cart,agreatfool/Cart,agreatfool/Cart,agreatfool/Cart,agreatfool/Cart,agreatfool/Cart,agreatfool/Cart,agreatfool/Cart,agreatfool/Cart,agreatfool/Cart,agreatfool/Cart,agreatfool/Cart,agreatfool/Cart,agreatfool/Cart,agreatfool/Cart | web/src/scripts/controller/CartBlogListCtrl.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n'use strict'\n\nconst electron = require('electron')\nconst app = electron.app // Module to control application life.\nconst BrowserWindow = electron.BrowserWindow // Module to create native browser window.\n\n// Keep a global reference... | javascript | edit | 0 | 2 | mit | ce97c63a930708391e0637bdac00f4a27064dd20 | romaklimenko/core,romaklimenko/core | main.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n'use strict';\n\nmodule.exports = function(client, data){\n client.shaking = true;\n let socket = client.socket;\n socket.write('Nice');\n};\n\n```\n\nApply this change: Add key reading and response key hashing and encoding"
},
{... | javascript | edit | 0 | 4 | mit | e7d7ecfd5e7c24ac59a5fb12ba077c1f3ea4f222 | jamen/rela | lib/server/handshake.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nexports.conf = {\n type: \"get\",\n method: \"usableCommands\",\n appliesTo: [\"Message\"],\n};\n\n// eslint-disable-next-line func-names\nexports.extend = function () {\n this.client.commands.filter(command => !this.client.commandI... | javascript | edit | 0 | 3 | mit | 3202c19fd0531b19da283f236eb9ccb2e3be654e | dirigeants/komada,dirigeants/komada,eslachance/komada | src/extendables/get_usableCommands.js | accepted | null | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.