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\nimport { expect } from 'chai'\nimport { join } from 'path'\nimport { HotModuleReplacementPlugin, optimize } from 'webpack'\n\nimport plugin from './base'\n\nconst saguiPath = join(__dirname, '../../../../')\nconst projectPath = join(sag... | javascript | edit | 0 | 1 | mit | 8a6ea948d8a19856d7633650dc5d57d5b17f6397 | saguijs/sagui,saguijs/sagui | src/webpack/plugins/base.spec.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nvar ejs = require('elastic.js'),\n nc = require('elastic.js/elastic-node-client');\n\n// default elasticsearch port is 9200\nejs.client = nc.NodeClient('localhost', '9200');\n\nexports.getResults = function (req, res) {\n var term... | javascript | edit | 0 | 2 | mit | 00d9945fe2b26f5835fd705cc361cd8f25fa467a | FronterAS/retrospectacular,FronterAS/retrospectacular,FronterAS/retrospectacular,FronterAS/retrospectacular,MrFjellstad/retrospectacular,plumpNation/retrospective,MrFjellstad/retrospectacular,plumpNation/retrospective,MrFjellstad/retrospectacular,plumpNation/retrospective | service/handlers.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n/** @babel */\n\nfunction wrap (manager, callbacks) {\n let klass = new SnippetHistoryProvider(manager);\n return new Proxy(manager, {\n get (target, name) {\n if (name in callbacks) {\n callbacks[name]();\n }\n ... | javascript | edit | 0 | 3 | mit | 887db8cb3b05fa725b9e44e635c4dd3f92867646 | atom/snippets | lib/snippet-history-provider.js | accepted | null | true |
[
{
"role": "user",
"content": "Write javascript code for the following: Print electron version on boot"
},
{
"role": "assistant",
"content": "\nimport mklog from '../util/log'\nexport const logger = new mklog.Logger()\nexport default logger\n\nconst log = mklog('itch')\nconst opts = {logger}\nlog... | javascript | new_file | 0 | 0 | mit | 710a4452230d74b14d1a76b65794844e80b6164c | itchio/itch,itchio/itch,itchio/itch,itchio/itchio-app,itchio/itch,leafo/itchio-app,itchio/itchio-app,itchio/itch,leafo/itchio-app,leafo/itchio-app,itchio/itch,itchio/itchio-app | appsrc/logger/index.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n// our packages\nimport * as ActionTypes from '../actionTypes';\n\nconst initialState = () => ({\n token: localStorage.getItem('user.token'),\n user: JSON.parse(localStorage.getItem('user.data')),\n});\n\nexport const auth = (state = ... | javascript | edit | 0 | 7 | mit | 97881a571fe60033810cc7864126b041bd82f3d1 | DAWZayas/Klayas,DAWZayas/Klayas | client/src/store/reducers/auth.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n#!/usr/bin/env node\n\nvar fs = require( 'fs' );\nvar IndentChecker = require( '../lib/indent-checker' );\n\nvar args = process.argv.slice( 2 );\nvar files = args.filter( function( arg ) {\n\treturn arg.substr( 0, 2 ) !== '--';\n} );\n\... | javascript | edit | 0 | 3 | mit | de67cae52aca9ecf2b91f0b5a9204642a123834c | sirbrillig/mixedindentlint | bin/mixedindentlint.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nconst files = {}\nconst watchers = {}\n\nmodule.exports = {\n writeFileSync (file, data) {\n files[file] = data\n if (watchers[file]) {\n watchers[file]('change', file)\n }\n },\n watch (file, listener) {\n watchers[... | javascript | edit | 0 | 2 | unlicense | 41bf4767e55460ebf1c2ad0e4b7532040984f4af | pfertyk/mauve,pfertyk/mauve | spec/mockfs.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nimport React from \"react\";\nimport { connect } from \"react-redux\";\nimport { previous, play, pause, stop, next } from \"../../actionCreators\";\n\nconst ActionButtons = props => (\n <div className=\"actions\">\n <div id=\"previo... | javascript | edit | 0 | 1 | mit | b083a94e5d9a86027fd4e2216fbbe91d055ee034 | captbaritone/winamp2-js,captbaritone/winamp2-js,captbaritone/winamp2-js | js/components/MainWindow/ActionButtons.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nrequire('./../dom-mock').default('<html><body></body></html>');\n\nimport jsdom from 'mocha-jsdom';\nimport assert from 'assert';\nimport React from 'react';\nimport TestUtils from 'react-addons-test-utils';\n\nimport Picture from './..... | javascript | edit | 0 | 1 | mit | 2f91a957e367205f3114341074816f2bcb0f317e | m0g/ansel,m0g/ansel,m0g/ansel,m0g/ansel | tests/components/picture.spec.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n(function ($) {\n $.fn.clone_form_template = function () {\n return $(this).map(function () {\n return update($(this).clone())[0];\n });\n };\n\n // updates a template clone according to conventions\n function update($clo... | javascript | edit | 0 | 4 | mit | 5169c7ef378cbfe0b2577b632888deaf1512b3ba | samuelcole/jquery-livesearch,samuelcole/jquery-livesearch | src/jquery.clone_form_template.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n// Licensed under the Apache License, Version 2.0 (the “License”); you may not\n// use this file except in compliance with the License. You may obtain a copy of\n// the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n... | javascript | edit | 0 | 6 | apache-2.0 | b07185fa92d7c5705e7a50f49b29444994db6baa | ctrine/webpack-settings,ctrine/webpack-settings | src/configs/babel-preset/index.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nimport { murmurHash1 } from '../util/murmur';\n\nclass PartitionDecider {\n constructor(config) {\n this.config = config;\n }\n\n getPartitionForChannel(channel) {\n const partitionMap = this.config.getPartitionMa... | javascript | edit | 0 | 2 | mit | 2a2ed7ce1c3b574d50b0c0fbb15d05d420a8fa65 | 6IRCNet/sync,aykl/sync,6IRCNet/sync,6IRCNet/sync,aykl/sync | src/partition/partitiondecider.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n#!/usr/bin/env node\r\n\r\nconst fs = require('fs-extra');\r\nconst nunjucks = require('nunjucks');\r\nconst packageJson = require('../package.json');\r\n\r\nlet results = nunjucks.render('chocolatey/rename-cli.nuspec.html', packageJson... | javascript | edit | 0 | 0 | mit | 6eb801c55d83b1cd04e3c9e3d648c0521fd78f60 | jhotmann/node-rename-cli,jhotmann/node-rename-cli | chocolatey/packager.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n/**\n * mSupply Mobile\n * Sustainable Solutions (NZ) Ltd. 2019\n */\n\nimport { PRESCRIBER_ACTIONS } from '../actions/PrescriberActions';\n\nconst prescriberInitialState = () => ({\n currentPrescriber: null,\n isEditingPrescriber: fa... | javascript | edit | 0 | 5 | mit | 8dc8276d0598e68f2b08fd17c958c4b627180806 | sussol/mobile,sussol/mobile,sussol/mobile,sussol/mobile | src/reducers/PrescriberReducer.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nconst serverRouter = require('server-router')\nconst browserify = require('browserify')\nconst bankai = require('bankai')\nconst http = require('http')\n\nconst PORT = 8080\n\nconst server = http.createServer(createRouter())\nserver.lis... | javascript | edit | 0 | 1 | mit | 51a9c4488e79aee8a43cd91ca64cb144760c845b | antiBaconMachine/choo,antiBaconMachine/choo,yoshuawuyts/choo | examples/mailbox/server.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nmodule.exports = {\n title: 'Andrey Prokopyuk',\n summary: [\n \"Hello! My name is Andrey. I'm a developer in\",\n '<a href=\"https://yandex.com\" target=\"_blank\">Yandex</a>,',\n 'working on Search Engine Re... | javascript | edit | 0 | 0 | mit | fd79d1bacd8be1bdb9497105563f477c38618757 | Andre-487/andre.life,andre487/andre.life,Andre-487/andre.life,andre487/andre.life,andre487/andre.life | src/context.js | accepted | null | 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: 'dummy',\n environment: environment,\n rootURL: '/',\n locationType: 'auto',\n EmberENV: {\n FEATURES: {\n // ... | javascript | edit | 0 | 4 | mit | 568877c587a9243eecc90d4cd07d55928af54c73 | IvyApp/ivy-tabs,IvyApp/ivy-tabs | tests/dummy/config/environment.js | rejected_duplicate | Near-duplicate of sample 80006 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nconst path = require('path');\nconst AbstractDataSource = require(path.resolve(__dirname, 'abstract-data-source.js'));\nconst Twit = require('twit');\n\nclass Twitter extends AbstractDataSource {\n constructor(config) {\n super(conf... | javascript | edit | 0 | 1 | mit | 8618dfcaf593783af5155094ed81ed8493d1ca11 | jorgeborges/tablero | lib/data-source/twitter.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nQUnit.test( \"getOptions default\", function( assert ) {\n\n var options = $.fn.inputFileText.getOptions();\n\n assert.equal(options.text, \n 'Choose File', \n 'Should return default text option when no text option i... | javascript | edit | 0 | 1 | mit | 512add7bd9a592d25fcf0fee5c2a37acf540ea74 | datchung/jquery.inputFileText,datchung/jquery.inputFileText | tests/tests.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nimport expect from 'expect'\nimport React, { Component } from 'react'\nimport { render, unmountComponentAtNode } from 'react-dom'\nimport createHistory from '../createMemoryHistory'\nimport Route from '../Route'\nimport Router from '../... | javascript | edit | 0 | 1 | mit | 74f93d6412811054017fe7ecd51bbb306667b955 | tylermcginnis/react-router,DelvarWorld/react-router,goblortikus/react-router,asaf/react-router,OpenGov/react-router,djkirby/react-router,d-oliveros/react-router,goblortikus/react-router,rackt/react-router,OpenGov/react-router,ReactTraining/react-router,asaf/react-router,stshort/react-router,goblortikus/react-router,rea... | modules/__tests__/withRouter-test.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n/**\n * Created by BK on 21/06/16.\n *\n * @flow\n */\n\n 'use strict';\n\n import React, { Component } from 'react';\n import {\n Text,\n View,\n TouchableHighlight,\n StyleSheet\n } from 'react-native';\n\n type Props ... | javascript | edit | null | null | mit | 1b86b835373ac19d831742419cfc66e4b07d26dd | bkrem/educhain,bkrem/educhain,bkrem/educhain,bkrem/educhain | EduChainApp/js/tabs/tasks/TasksListRow.js | rejected_syntax | Syntax error detected by tree-sitter | false |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nvar TopLevelView = require('ui/common/components/TopLevelView');\nvar NetworkHelper = require('helpers/NetworkHelper');\n\nfunction LoginView() {\n\n var loginUrl = Ti.App.Properties.getString('server_url') + '/api/login';\n\n var sel... | javascript | edit | 0 | 1 | mit | 492a5ee25c1a815cdc71266f50e66ea89f3913a9 | nilenso/ashoka-survey-mobile,nilenso/ashoka-survey-mobile | Resources/ui/common/LoginView.js | rejected_duplicate | Near-duplicate of sample 75229 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nimport Ember from 'ember';\nimport DS from 'ember-data';\n\nexport default DS.JSONAPISerializer.extend({\n _normalizeAttributes(attributes) {\n var normalized = {};\n Object.keys(attributes).forEach(function(key) {\n ... | javascript | edit | 0 | 1 | apache-2.0 | e90a702327053d612567c77211fef1f413e071ff | samchrisinger/ember-osf,binoculars/ember-osf,binoculars/ember-osf,samchrisinger/ember-osf,crcresearch/ember-osf,jamescdavis/ember-osf,baylee-d/ember-osf,cwilli34/ember-osf,chrisseto/ember-osf,jamescdavis/ember-osf,cwilli34/ember-osf,crcresearch/ember-osf,hmoco/ember-osf,hmoco/ember-osf,CenterForOpenScience/ember-osf,pa... | addon/serializers/application.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n$(function () {\n \n $(\".boundBoxSize\").on(\"click\", function () {\n var currentValue = $(this).val();\n var grnsightContainerClass = \"grnsight-container \" + currentValue;\n if (!$(\".grnsight-container\").hasClass(curre... | javascript | edit | 0 | 2 | bsd-3-clause | 0c18cf9cece16bbc8069394c711f4c45e85aea08 | dondi/GRNsight,dondi/GRNsight | web-client/public/js/container.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nvar hammer = require ('hammerjs')\n , canvas = document.getElementById('canvas')\n , ctx = canvas.getContext('2d')\n , img = new Image() // Create new img element\n , i = 0\n , starship = function() {}\n , star = new starship()\... | javascript | edit | 0 | 2 | bsd-2-clause | ae413df2b5d1f29681d64ae42bb945d726443334 | dkolba/cosmoswarm | main.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nimport React from 'react';\nimport ReactDOM from 'react-dom';\n\nvar BOARD_STATE = [\n [true, true, null],\n [null, false, false],\n [true, false, true],\n];\n\nclass Cell extends React.Component {\n render() {\n let ... | javascript | edit | 0 | 3 | mit | 41e7919b028e82b054160a9bfbedfe5379daac19 | jrouviere/tic-tac-toe,jrouviere/tic-tac-toe | main.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n'use strict';\n\n/**\n * @ngdoc filter\n * @name SubSnoopApp.filter:isImage\n * @function\n * @description\n * # isContent\n * Filter in the SubSnoopApp.\n */\nangular.module('SubSnoopApp')\n .filter('isContent', function () {\n\n /... | javascript | edit | 0 | 5 | mit | 17432b378ffec82eb2f01b5847585b9360e711ee | sharibarboza/SubSnoop,sharibarboza/SubSnoop | app/scripts/filters/iscontent.js | rejected_duplicate | Near-duplicate of sample 78936 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nMigrations.add({\n version: 1,\n name: \"Extract items to a separate collection from the nested field\",\n up: function () {\n Flights.find({items: {$exists: true}}).forEach(function (flight) {\n flight.items.forEach(function... | javascript | edit | 0 | 1 | mit | 0cefa447edb49f3225d84a1431a766a9df47bdda | sungwoncho/airstrip,sungwoncho/airstrip,sungwoncho/airstrip,moretti/airstrip,moretti/airstrip,moretti/airstrip | server/migrations.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n// The root folder for this documentation category is `pages/vmware`\n//\n// - A string refers to the name of a file\n// - A \"category\" value refers to the name of a directory\n// - All directories must have an \"index.mdx\" file to s... | javascript | edit | 0 | 0 | mit | 30a27b6deb536bb170b7dae93983855924a7b59c | chrisroberts/vagrant,sni/vagrant,chrisroberts/vagrant,sni/vagrant,chrisroberts/vagrant,sni/vagrant,sni/vagrant,mitchellh/vagrant,mitchellh/vagrant,chrisroberts/vagrant,mitchellh/vagrant,mitchellh/vagrant | website/data/intro-navigation.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n/*\n jquery.popline.justify.js 0.1.0-dev\n\n Version: 0.1.0-dev\n Updated: Aug 11th, 2014\n\n (c) 2014 by kenshin54\n*/\n;(function($) {\n $.popline.addButton({\n justify: {\n iconClass: \"fa fa-align-justify\",\n mode... | javascript | edit | 0 | 4 | mit | 72a7d96f6141b98cfae3c72551ff35659ff27607 | ztx1491/popline,ztx1491/popline,kenshin54/popline,roryok/popline,kenshin54/popline,roryok/popline | scripts/plugins/jquery.popline.justify.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nDiscourse.AdminApi = Discourse.Model.extend({\n VALID_KEY_LENGTH: 64,\n\n keyExists: function(){\n var key = this.get('key') || '';\n return key && key.length === this.VALID_KEY_LENGTH;\n }.property('key'),\n\n generateKey: fu... | javascript | edit | 0 | 3 | mit | f58dd7a6fb72cf606405e251bada258c3e329344 | tadp/learnswift,tadp/learnswift,natefinch/discourse,natefinch/discourse,tadp/learnswift | app/assets/javascripts/admin/models/admin_api.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n'use strict';\n\nconst mongoose = require('mongoose');\n\nconst Schema = mongoose.Schema;\n\nconst userSchema = new Schema({\n email: {\n type: String,\n lowercase: true,\n minlength: [3, 'Text less than 3 char'],\n require... | javascript | edit | 0 | 1 | mit | cd634b452ad9b3fc5d697743345b5f250d6ef746 | aarongoa/psl-lending,aarongoa/psl-lending,aarongoa/psl-lending | users/model.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nconst ComponentConverter = require('../component/ComponentConverter')\nconst pandoc = require('../helpers/pandoc')\n\nclass DocumentMarkdownConverter extends ComponentConverter {\n\n load (document, content, format, options) {\n opt... | javascript | edit | 0 | 4 | apache-2.0 | d97b71794b0646d2eb11e95dcb89591b85e6f778 | stencila/node,stencila/node | src/document/DocumentMarkdownConverter.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nimport React from 'react';\nimport Anchor from 'grommet/components/Anchor';\nimport Box from 'grommet/components/Box';\nimport Header from 'grommet/components/Header';\nimport Heading from 'grommet/components/Heading';\nimport Menu from... | javascript | edit | 0 | 1 | apache-2.0 | ac85d713e258ac0946297dbf2fc448415ab1c96f | grommet/grommet-cms-boilerplate,grommet/grommet-cms-boilerplate | src/js/components/Dashboard/Nav.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\npc.extend(pc.fw, function () {\r\n /**\r\n * @name pc.fw.AppData\r\n * @class AppData contains global data about the application that is loaded from Entity or Exported data\r\n * For Exported applications it comes from pc... | javascript | edit | 0 | 1 | mit | 3a48309c03e64ada9b8408c93ace8e5df82937cd | nizihabi/engine,3DGEOM/engine,shinate/engine,sereepap2029/playcanvas,sanyaade-teachings/engine,MicroWorldwide/PlayCanvas,3DGEOM/engine,maxwellalive/engine,playcanvas/engine,nizihabi/engine,horryq/engine-1,RainsSoft/engine,aidinabedi/playcanvas-engine,shinate/engine,sereepap2029/playcanvas,SuperStarPL/engine,sereepap202... | src/framework/framework_appdata.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n/*\n * This file is part of the Sylius package.\n *\n * (c) Paweł Jędrzejewski\n *\n * For the full copyright and license information, please view the LICENSE\n * file that was distributed with this source code.\n */\n\nimport 'semantic... | javascript | edit | 0 | 1 | mit | f20d73392debf7d3b6c58235ba1b55b96a501af6 | foobarflies/Sylius,kayue/Sylius,Zales0123/Sylius,Sylius/Sylius,lchrusciel/Sylius,diimpp/Sylius,venyii/Sylius,venyii/Sylius,loic425/Sylius,loic425/Sylius,pjedrzejewski/Sylius,lchrusciel/Sylius,pamil/Sylius,foobarflies/Sylius,ezecosystem/Sylius,diimpp/Sylius,mbabker/Sylius,Sylius/Sylius,itinance/Sylius,kayue/Sylius,bitba... | src/Sylius/Bundle/AdminBundle/Resources/private/js/sylius-move-taxon.js | rejected_duplicate | Near-duplicate of sample 70221 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nvar casper = require('casper').create();\n\ncasper.start('http://localhost:9292/', function() {\n this.echo(this.getTitle());\n});\n\ncasper.run();\n\n```\n\nApply this change: Save some changes to Casper file"
},
{
"role": "... | javascript | edit | 0 | 1 | mit | 3854a235ab0cbe3a43a7af710d83809e54b33a3c | troyswanson/troyswanson.github.io,troyswanson/troyswanson.github.io,tintoanto/tintoanto.github.io,tintoanto/tintoanto.github.io | _tests/test.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nangular.module('ocWebGui.navbar', ['ui.router', 'ocWebGui.login', 'FBAngular'])\n .controller('NavbarController', function ($scope, $http, User, Fullscreen) {\n var vm = this;\n\n vm.isAuthenticated = User.isAuthenticated;\n U... | javascript | edit | 0 | 2 | mit | c31af0836cd996e9ccfbb34e6a8c45fec9d96c65 | UniversityofHelsinki/OC-webgui,UniversityofHelsinki/OC-webgui,UniversityofHelsinki/OC-webgui,UniversityofHelsinki/OC-webgui | app/assets/javascripts/navbar/navbarController.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n'use strict';\n\nvar angular = require('angular'),\n //apiKey = 'f8dc9e2b6acd93f0a57b4abf0e86ecad',\n lund = 'http://api.openweathermap.org/data/2.5/weather?q=Lund,se';\n\nangular.module('app').controller('CurrentWeatherCtrl', fun... | javascript | edit | 0 | 1 | mit | 6c89ef923c378df180951dce88326fa9aa56745c | mtingberg/weather-for-location,mtingberg/weather-for-location | app/current-weather/current-weather-controller.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nimport fetch from 'isomorphic-fetch'\n\n/* Add a SL public transit stop\nexport const ADD_STOP = 'ADD_STOP'\nfunction addStop(stop) {\n return {\n type: ADD_STOP,\n stop\n }\n}\n*/\n\nexport const START_UPDATING_STOP = 'START_UP... | javascript | edit | 0 | 1 | apache-2.0 | 7307a533174b103f8400624076aa65f72a0c4baa | Ozzee/sl-departures,Ozzee/sl-departures | src/actions/index.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n/*\n\nBuilds a source package, starting from src/js/main.js\n\n*/\n\nvar r = require(\"requirejs\");\nvar shell = require(\"shelljs\");\n\nmodule.exports = function(grunt) {\n\n grunt.registerTask(\"amd\", \"Compile AMD modules to buil... | javascript | edit | 0 | 2 | mit | 0c8609863c4cfaaad6b6b7d41bdbdd4c3616a24a | seattletimes/newsapp-template,seattletimes/newsapp-template | root/tasks/require.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nExt.define(\"DMPlanner.view.PlanList\", {\n extend : 'Ext.grid.Panel',\n alias : 'widget.planlist',\n\n requires : ['Ext.Button', 'Ext.util.*'],\n\n title : 'Plans',\n columnLines : true,\n store : 'Plans',\n cls : ... | javascript | edit | 0 | 0 | unlicense | 58b2ef2774f9d663ec097ff015fcee01db641b5c | arcticlcc/dmplanner,arcticlcc/dmplanner,arcticlcc/dmplanner | app/view/PlanList.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nvar Twitter = require('twitter');\n\nvar client,\n\tshareUrl;\n\n\nmodule.exports = {\n\n\tinit: function(config) {\n\n\t\tif (config.enabled) {\n\n\t\t\tshareUrl = config.shareUrl;\n\n\t\t\tclient = new Twitter({\n\t\t\t\tconsumer_key:... | javascript | edit | 0 | 6 | mit | f08b15204a5b54fd20965aa3ffb530fd395cd919 | risq/dihh,risq/dihh | app/twitter.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n/**\n * Internal dependencies\n */\nimport Data from 'googlesitekit-data';\nimport { STORE_NAME as CORE_MODULES } from '../../googlesitekit/modules/datastore/constants';\nimport classnames from 'classnames';\nimport ErrorIcon from '../.... | javascript | edit | 0 | 2 | apache-2.0 | cdf260a823eb63f95f82a4da98748fd035b0d60e | google/site-kit-wp,google/site-kit-wp,google/site-kit-wp,google/site-kit-wp | assets/js/components/notifications/module-settings-warning.js | rejected_duplicate | Near-duplicate of sample 87644 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n/* Global variables to cache the user and tweet data. */\nvar user;\nvar tweet_data;\n\nfunction submit_username() {\n var val = $('#usernamefield').val();\n\n /* We can use the cache and return. */\n if (user == val) {\n ... | javascript | edit | 0 | 2 | bsd-3-clause | ed1880ce37811c92d29c3460ce6e769a8939acfc | jaspervdj/tweetov | static/tweetov.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n/**\n * Created by stefas on 19/05/15.\n */\nangular.module('myApp.controllers')\n .controller('ParameterButtonCtrl', ['$sce', '$scope', '$http',\n 'defaults', '$controller', 'Session',\n function ($sce, $scope, $http, ... | javascript | edit | 0 | 1 | mit | 28367f6eee06758707d16dcec9cacb60a889de49 | ghostsphinx/web-evidence,ghostsphinx/web-evidence | app/js/controllers/parameterButtonCtrl.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n// Licensed under the Apache License, Version 2.0 (the “License”); you may not\n// use this file except in compliance with the License. You may obtain a copy of\n// the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n... | javascript | edit | 0 | 1 | apache-2.0 | 6694877cc32bb6e2c83cac27f6279fb5b2cef9b8 | ctrine/webpack-settings,ctrine/webpack-settings | entries/react/main.development.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n$(function() {\n var riverbendStart = moment('2016-06-10T17:00:00-04:00');\n var riverbendEnd = moment('2016-06-18T23:30:00-04:00');\n var futureEventStart = moment('2016-06-10T17:00:00-04:00');\n\n function formatDateDiff(s... | javascript | edit | 0 | 5 | mit | 4cced06be1a2749b4b439b50e2edbfe5ec468e43 | robbettis/isriverbendoveryet.com,robbettis/isriverbendoveryet.com | assets/main.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n'use strict';\n\n(function() {\n angular.module('ncsaas')\n .service('resourcesService', ['baseServiceClass', resourcesService]);\n\n function resourcesService(baseServiceClass) {\n var ServiceClass = baseServiceClass.extend({\n... | javascript | edit | 0 | 3 | mit | 9b987a61da92b596364920d95d26a23e75be03e6 | opennode/waldur-homeport,opennode/waldur-homeport,opennode/waldur-homeport,opennode/waldur-homeport | app/scripts/services/resources-service.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n// Replaces one or more format items in a specified string\n// with the string representation of a specified object.\n// Returns formatted string.\nif (!String.prototype.format) {\n String.prototype.format = function() {\n var args ... | javascript | edit | 0 | 3 | bsd-3-clause | 9fb0abfe508ba24d0681dfdac75718d5b97713e6 | uzumaxy/pyspectator_tornado,uzumaxy/pyspectator_tornado | pyspectator_tornado/static/js/lib.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n/**\n * Returns decoding info for a given media configuration.\n *\n * @param {MediaDecodingConfiguration} configuration Media configuration.\n * @returns {Promise<MediaCapabilitiesInfo>} Media decoding information.\n */\nexport default... | javascript | edit | 0 | 4 | apache-2.0 | 132805fa9d9491464a82851f30350d82c05216dc | GoogleChrome/kino,GoogleChrome/kino,GoogleChrome/kino | src/js/utils/getDecodingInfo.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n;(function() {\n var $ = $ || django.jQuery;\n $(function() {\n initialiseCKEditor();\n initialiseCKEditorInInlinedForms();\n\n function initialiseCKEditorInInlinedForms() {\n try {\n $(document).on(\"click\", \".... | javascript | edit | 0 | 5 | bsd-3-clause | 7b67aba2318aae0f9934a9ce3a548f25f57cf03a | BlastPy/django-ckeditor,gushedaoren/django-ckeditor,zatarus/django-ckeditor,Josephpaik/django-ckeditor,williamdev/django-ckeditor,uhuramedia/django-ckeditor,luzfcb/django-ckeditor,uhuramedia/django-ckeditor,stkrp/django-ckeditor,Josephpaik/django-ckeditor,williamdev/django-ckeditor,williamdev/django-ckeditor,williamdev... | ckeditor/static/ckeditor/ckeditor-init.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nimport path from 'path';\nimport webpack from 'webpack';\nimport config from '../webpack.config';\n\njest.setTimeout(10000); // 10 second timeout\n\ndescribe('example', () => {\n it('combines loader results into one object', () =>\n ... | javascript | edit | 0 | 3 | mit | 59c542912cc722445a3b4378e2310ed882922d60 | elliottsj/combine-loader | example/__tests__/example-test.js | rejected_duplicate | Near-duplicate of sample 80989 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nconst requests = require('./requestFactory')\nconst data = require('../../persistence')\n\nmodule.exports = function(req, res) {\n const project = req.body\n\n requests\n .createTree(req, project)\n .then(tree => {\n return... | javascript | edit | 0 | 3 | mit | c40abc1eab66b8c63da5a804fe9c2e7a3aadc106 | Literasee/literasee,Literasee/literasee | routes/api/save-project.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nimport _ from 'lodash'\n\nimport cocos from '../cocos'\nimport leaves from '../leaves'\n\nexport class Palm {\n\n constructor (params) {\n this.cocos = cocos\n this.leaf = params.talk\n\n if (this.leaf === 'talegram') {\n ... | javascript | edit | 0 | 3 | mit | b97c90fa6662185ad193ddcdfd55a48c5c8562bf | frenchbread/palm | src/core/index.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n/**\n * @fileoverview Interface for a logger used to log user interaction via\n * jsactions.\n */\ngoog.provide('jsaction.ActionLogger');\n\n\ngoog.scope(function() {\n\n\n\n/**\n * Creates a no-op ActionLogger.\n *\n * @constructor\n *... | javascript | edit | 0 | 1 | apache-2.0 | 00907f34f2de7958d80e928abf4123ec18da2750 | google/jsaction,google/jsaction | actionlogger.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n// home.js\n\n\"use strict\";\n\nimport { welcome } from \"./welcome\";\n\nif (NODE_ENV == \"development\") {\n welcome(\"home\");\n}\n\nexport { welcome };\n\n```\n\nApply this change: Use DEV_ENV. Add console.log for testing UglifyJS... | javascript | edit | 0 | 0 | mit | 29cb4650c3b1b41b793531404af02d7cbec40d9f | var-bin/webpack-training,var-bin/webpack-training,var-bin/webpack-training,var-bin/webpack-training | home.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n// chrome.storage.sync.clear();\n\nfile.load('sites/config.json', function (err, body) {\n var config = JSON.parse(body)\n chrome.storage.sync.set(config)\n})\n\n// events\n\nchrome.extension.onMessage.addListener(function (req, sende... | javascript | edit | 0 | 2 | mit | f7d790dcb777edf6a8e411961ad9c0a629c51ac0 | simov/styler | background/background.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n// @flow\nimport {TypedConnector} from '../util/typed-connect'\nimport PurgeMessage from './purge-message.desktop'\nimport * as Constants from '../constants/pgp'\n\nimport type {Props} from './purge-message.desktop'\n\nconst connector: ... | javascript | edit | null | null | bsd-3-clause | 37ffe0c29a24092a9313b724591095ab4df7415e | keybase/client,keybase/client,keybase/client,keybase/client,keybase/client,keybase/client,keybase/client,keybase/client,keybase/client,keybase/client,keybase/client,keybase/client | shared/pgp/container.desktop.js | rejected_syntax | Syntax error detected by tree-sitter | false |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nimport boundingBox from \"./bounding-box\"\nimport clean from \"./clean\"\nimport combine from \"./combine\"\nimport isEqual from \"./is-equal\"\nimport join from \"./join\"\nimport reverse from \"./reverse\"\nimport simplify from \"./s... | javascript | edit | 0 | 0 | mit | 5d69afb8d31bdbb3e254725caa1e924bcd704f3f | anthonydugois/polynomic | src/path/index.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n'use strict'\n\nimport keytar from 'keytar'\n\nconst SERVICE = 'gh-notifications-snoozer'\nconst ACCOUNT = 'github'\n\nclass GitHubAuth {\n static isAuthenticated() {\n return this.getToken() !== null\n }\n\n static setToken(token... | javascript | edit | 0 | 2 | mit | 19ea5e2c51e966f18ec4eae1d2e359a5a6d208ae | cheshire137/gh-notifications-snoozer,cheshire137/gh-notifications-snoozer | src/models/GitHubAuth.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n//= require phaser.min\n//= require_tree ./rubyrpg\n\n//= depend_on_asset \"logo.png\"\n//= depend_on_asset \"uipack.png\"\n//= depend_on_asset \"uipack.json\"\n```\n\nApply this change: Update for moved static assets"
},
{
"rol... | javascript | edit | 0 | 0 | mit | 2ffe9e8cd9b79f65d41f1f14f16ba9400d8e20b9 | yunixon/RubyRPG,yunixon/RubyRPG,PDaily/RubyRPG,yunixon/RubyRPG,PDaily/RubyRPG,PDaily/RubyRPG | app/assets/javascripts/rubyrpg.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n(function () {\n \"use strict\";\n\n var root = this,\n $ = root.jQuery;\n\n if(typeof root.GOVUK === 'undefined') { root.GOVUK = {}; }\n\n root.GOVUK.signin = {\n init: function () {\n },\n attach: function () {\n ... | javascript | edit | 0 | 2 | mit | 550b9c282c863124d5d4c081cc26ac354152e646 | alphagov/verify-frontend,alphagov/verify-frontend,alphagov/verify-frontend,alphagov/verify-frontend | app/assets/javascripts/sign_in.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nvar path = require('path');\nvar cwd = process.cwd();\nvar filter = require('../../api/hooks/pluginloader/pluginhelper').filter;\n\nmodule.exports = function(grunt) {\n grunt.registerTask('pluginassets', 'Links assets from plugins in... | javascript | edit | 0 | 1 | mit | bdf4d4f6386c27893b4e1b6cd4fa665764a165bb | kumpelblase2/modlab,kumpelblase2/modlab | tasks/register/linkPluginAssets.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nimport 'babel-polyfill';\nimport React from 'react';\nimport PropTypes from 'prop-types';\nimport Helmet from 'react-helmet';\n\nimport Header from '../components/Header';\nimport Footer from '../components/Footer';\nimport content from... | javascript | edit | 0 | 1 | mit | 2bab05e47df8434dea94b357a52bba4049048bc2 | sioked/ecomchicago | src/layouts/index.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nimport React, { PropTypes, Component } from 'react'\nimport classes from './PostItem.scss'\nimport { ListItem } from 'material-ui/List'\nimport Delete from 'material-ui/svg-icons/action/delete'\nimport {Card, CardActions, CardHeader, Ca... | javascript | edit | 0 | 1 | mit | 206da1d35d2de56e92f57ce1106bfe591f8e4854 | stephanefbouchard/6garonne,stephanefbouchard/6garonne,stephanefbouchard/6garonne | src/routes/Blog/components/PostItem/PostItem.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n'use strict';\n\nmodule.exports = {\n open(context) {\n this.storageManager = context.storageManager;\n },\n processMessage(message) {\n switch (message.type) {\n // in the future we can get trace logs from WebPageTest\n ... | javascript | edit | 0 | 3 | mit | 40ccfa5a0b259532c74807c892ae162201331ddb | JeroenVdb/sitespeed.io,sitespeedio/sitespeed.io,beenanner/sitespeed.io,JeroenVdb/sitespeed.io,sitespeedio/sitespeed.io,beenanner/sitespeed.io,sitespeedio/sitespeed.io,beenanner/sitespeed.io,JeroenVdb/sitespeed.io,sitespeedio/sitespeed.io | lib/plugins/tracestorer/index.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n// does recursion\nvar recursiveFunction = function recursiveFunction () {\n if (typeof theFunctionToCall !== 'function') {\n if (window.confirm('Unable to locate function. Click OK to call a recursive function.')) {\n ... | javascript | edit | 0 | 3 | mit | 7e9c76d73f1543626bdf30d46ac8da22ef8cfcaf | vekat/anything.js,Sha-Grisha/anything.js,Sha-Grisha/anything.js,Sha-Grisha/anything.js,vekat/anything.js,Rabrennie/anything.js,vekat/anything.js,Rabrennie/anything.js,Sha-Grisha/anything.js,Rabrennie/anything.js,vekat/anything.js,Rabrennie/anything.js | src/recursiveFunction.js | accepted | null | true |
[
{
"role": "user",
"content": "Write javascript code for the following: Check if the two strings are the same length"
},
{
"role": "assistant",
"content": "var stringRotation = function (a, b) {\n if (a.length != b.length)\n return false;\n return (a + a).indexOf(b) > -1;\n};\n"
}
] | javascript | new_file | 0 | 2 | mit | 41cc69c136d8cdffa11aee6222c4d7dccdd68b3c | faruzzy/code-problems,cjjavellana/code-problems,cjjavellana/code-problems,sisirkoppaka/code-problems,nickell-andrew/code-problems,AndrewKishino/code-problems,patrickford/code-problems,marcoviappiani/code-problems,dwatson3/code-problems,marcoviappiani/code-problems,cjjavellana/code-problems,marcoviappiani/code-problems,... | string-rotation/index.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nvar AppView = require('./views/app_view');\nvar AppModel = require('./models/app_model');\nvar template = window.template = require('../templates/app_view.mustache');\n\nmodule.exports = window.view = new AppView({\n el: '#appwrapper',... | javascript | edit | 0 | 0 | apache-2.0 | e06fafc5e15705b03cb3f242d1b129b427ac6f96 | wayfair/tungstenjs,wayfair/tungstenjs | examples/web-components/js/app.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nimport Controller from '@ember/controller';\nimport {inject as service} from '@ember/service';\n\nexport default class UploadThemeController extends Controller {\n @service config;\n\n get isAllowed() {\n return !this.confi... | javascript | edit | 0 | 3 | mit | f65c5a7f8b74fa3af000dec19f69d082a684fa30 | TryGhost/Ghost,TryGhost/Ghost,TryGhost/Ghost | ghost/admin/app/controllers/settings/theme/uploadtheme.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n'use strict';\n\nif (!waitlist) {\n\tvar waitlist = {};\n}\n\nwaitlist.base = (function(){\n\tfunction getMetaData (name) {\n\t\treturn $('meta[name=\"'+name+'\"]').attr('content');\n\t}\n\t\n\tfunction displayMessage(message, type) {\n... | javascript | edit | 0 | 2 | mit | 65dd6526f7d13438fb05f713f871dd28f1c16876 | SpeedProg/eve-inc-waitlist,SpeedProg/eve-inc-waitlist,SpeedProg/eve-inc-waitlist,SpeedProg/eve-inc-waitlist | static/js/base.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n(function (window) {\n 'use strict';\n\n function sendError(e) {\n var userData = {\n username: '',\n fullname: '',\n email: ''\n };\n\n if (\n typeof TrelloHelper !== 'undefined' &&\n typeof Trel... | javascript | edit | 0 | 2 | apache-2.0 | 9855b083c5d46a27ddfb6f6754aed8936bfa05c7 | handsomecode/handsome-trello,handsomecode/trello-parent-child | vendor/chrome/errors-handler.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nimport { h, Component } from 'preact';\nimport style from './style';\n\nfunction debounce(fn, delay) {\n let timer = null;\n return function () {\n const context = this;\n const args = arguments;\n clearTimeout(timer);\n t... | javascript | edit | null | null | mit | ba45d0427deff46ca2611237df0f6b0ddba918c3 | zaccolley/songkick.pink,zaccolley/songkick.pink | src/components/Settings/index.js | rejected_syntax | Syntax error detected by tree-sitter | false |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nconst BabiliPlugin = require('babili-webpack-plugin');\nvar path = require('path');\n\nmodule.exports = {\n entry: './src/civ5save.js',\n output: {\n filename: 'civ5save.min.js',\n path: path.resolve(__dirname, 'dist')\n },\n ... | javascript | edit | 0 | 0 | mit | fe0656a63a0fdcaf5cfc2a7328d4f92875c7bd71 | bmaupin/js-civ5save | webpack.config.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nimport { getRandomNumber, generatePassword } from '../../src/helpers/password';\n\nconst R = require('ramda');\n\n// Get rid of this and refactor\nconst repeat = (fn, arg1, arg2, count) => {\n const arr = [];\n\n for (let i = 0; i < c... | javascript | edit | null | null | mit | ec38728f7919e8b43a9575e0ba952eca1b1b6c42 | tricinel/react-diceware,tricinel/react-diceware | __tests__/helpers/password-test.js | rejected_syntax | Syntax error detected by tree-sitter | false |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n/**\n * Copyright (c) 2015-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n ... | javascript | edit | null | null | mit | 83ed9d170b8fd750a345fc608ec69db2fe3ca9b2 | pandiaraj44/react-native,facebook/react-native,jevakallio/react-native,pandiaraj44/react-native,hammerandchisel/react-native,hoangpham95/react-native,myntra/react-native,facebook/react-native,janicduplessis/react-native,hammerandchisel/react-native,exponentjs/react-native,jevakallio/react-native,hoastoolshop/react-nati... | Libraries/Types/CoreEventTypes.js | rejected_syntax | Syntax error detected by tree-sitter | false |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nconst path = require('path')\n\nmodule.exports = {\n context: __dirname,\n entry: './src/index.js',\n devtool: 'source-map',\n\n output: {\n libraryTarget: 'umd',\n path: path.resolve('dist'),\n filename: 'es2015-starter.js... | javascript | edit | 0 | 0 | mit | 185040c2a297f54db939997c4c5456074a5af5a0 | kroogs/scanty,kroogs/yaemit | webpack.config.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nconst path = require('path');\nconst webpack = require('webpack');\nconst HtmlWebpackPlugin = require('html-webpack-plugin');\nconst FaviconsWebpackPlugin = require('favicons-webpack-plugin');\n\nmodule.exports = {\n entry: ['./client/... | javascript | edit | 0 | 2 | mit | cc7651e61f10fe3bb476126a4e6767d5e722d787 | dotkom/super-duper-fiesta,dotkom/super-duper-fiesta,dotkom/super-duper-fiesta | webpack.config.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nconst webpackMerge = require('webpack-merge');\nconst commons = require('./buildtools/webpack.commons');\n\nlet config = commons.config;\n\nconst nodeEnv = process.env['NODE_ENV'] || 'dev';\nswitch (nodeEnv) {\n case 'dev':\n config... | javascript | edit | 0 | 0 | mit | e422745cf49378491db2622f5871718064a8bc5c | camptocamp/ngeo,camptocamp/ngeo,camptocamp/ngeo,camptocamp/ngeo,camptocamp/ngeo | webpack.config.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n'use strict';\n\n\n/*\n We calculate the similarity between an experimental spectrum and a specific XY\n */\n\n\nvar Similarity = require('peaks-similarity');\n\nfunction SimilarityProcessor(experimental, options) {\n // we will cop... | javascript | edit | 0 | 5 | mit | d8b39af86690352be9e6e93c1025c510d8694de4 | cheminfo-js/chemcalc-extended | src/SimilarityProcessor.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n// Karma configuration file, see link for more information\n// https://karma-runner.github.io/1.0/config/configuration-file.html\n\nmodule.exports = function (config) {\n var configuration = {\n basePath: '',\n frameworks: ['jasm... | javascript | edit | 0 | 2 | mit | dabb380484da931978c3fed627ed7a9765dcd66b | UMM-CSci-3601/3601-lab4_mongo,UMM-CSci-3601-F17/interation-1-drop-table-teams,UMM-CSci-3601/3601-lab4_mongo,UMM-CSci-3601-F17/interation-1-drop-table-teams,UMM-CSci-3601-F17/interation-1-drop-table-teams,UMM-CSci-3601/3601-lab4_mongo,UMM-CSci-3601/3601-lab4_mongo,UMM-CSci-3601-F17/interation-1-drop-table-teams,UMM-CSci... | client/karma.conf.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nvar Pokeio = require('./poke.io')\n\nvar location = 'Stockflethsvej 39';\n\nvar username = 'Arm4x';\nvar password = 'OHSHITWADDUP';\n\nPokeio.SetLocation(location, function(err, loc) {\n if (err) throw err;\n\n console.log('[i] Cu... | javascript | edit | 0 | 3 | mit | bbb90ea5f4fe3156106a564e8d4ed00a020fad24 | Tolia/Pokemon-GO-node-api,Armax/Pokemon-GO-node-api,dddicillo/IBM-Dublin-PokeTracker | example.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n//Write a function, deepEqual, that takes two values and returns true only if they are the same value or are objects with the same properties whose values are also equal when compared with a recursive call to deepEqual.\n\nfunction deep... | javascript | edit | 0 | 4 | mit | 0ed1954b285fde49851ded6ff893c58dd76c46b5 | OperationCode/eloquent-js | 04/jjhampton-ch4-deep-comparison.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nHB.StoryShowRoute = Ember.Route.extend({\n controllerName: \"story\",\n\n model: function(params) {\n return this.store.find('story', params.id);\n }\n});\n\n```\n\nApply this change: Expand replies by default on story permalink p... | javascript | edit | 0 | 1 | apache-2.0 | b44b22462b8343947b0b6be46fc519e57e327450 | NuckChorris/hummingbird,vevix/hummingbird,saintsantos/hummingbird,NuckChorris/hummingbird,sidaga/hummingbird,NuckChorris/hummingbird,synthtech/hummingbird,hummingbird-me/hummingbird,paladique/hummingbird,sidaga/hummingbird,xhocquet/hummingbird,wlads/hummingbird,Snitzle/hummingbird,qgustavor/hummingbird,synthtech/hummin... | app/assets/javascripts/routes/story_show_route.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nimport algolia from 'algoliasearch';\nimport icons from '../dist/icons.json';\nimport tags from '../src/tags.json';\n\nconst ALGOLIA_APP_ID = '5EEOG744D0';\n\nif (\n process.env.TRAVIS_PULL_REQUEST === 'false' &&\n process.env.TRAVIS_... | javascript | edit | 0 | 2 | mit | 90133ea33e4fc0ac52bcd4d24e8f78a1ab96cea2 | colebemis/feather,colebemis/feather | bin/sync-algolia.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nmodule.exports = function (api) {\n api.cache.forever()\n\n const presets = ['@babel/preset-env']\n const plugins = [\n ['@babel/plugin-proposal-decorators', { decoratorsBeforeExport: true }],\n '@babel/plugin-transform-runtime... | javascript | edit | 0 | 1 | mit | fbda3afff935c10b0b12b9cf237160286fd777c3 | Goldinteractive/Sackmesser,Goldinteractive/Sackmesser,Goldinteractive/Sackmesser,Goldinteractive/Sackmesser | babel.config.js | accepted | null | true |
[
{
"role": "user",
"content": "Write javascript code for the following: Resolve problem 04. Third Digit"
},
{
"role": "assistant",
"content": "function solve(argument) {\n\tvar n = argument[0];\n\n\tvar digitStr = n[n.length - 3];\n\n\tif (digitStr === \"7\") {\n\t\treturn \"true\";\n\t} else {\n... | javascript | new_file | 0 | 3 | mit | 96c4b9ac73c6642a7d400553488356827f1b0385 | Gyokay/Telerik-Academy-Homeworks,Gyokay/Telerik-Homeworks,Gyokay/Telerik-Academy-Homeworks,Gyokay/Telerik-Academy-Homeworks,Gyokay/Telerik-Homeworks | JS-Fundamentals-Homeworks/Operators-and-Expressions/04.Third-Digit.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n\"use strict\";\n\n// Load env with dotenv from .env file\nvar dotenv = require('dotenv');\ndotenv.load();\n\n// node_env can either be \"development\", \"production\" or \"test\"\nvar nodeEnv = process.env.NODE_ENV || \"development\";\... | javascript | edit | 0 | 0 | mit | f6230ca2e2947814c514a0fd39edd79e4fcee95f | saveman71/epitech-international,saveman71/epitech-international | config/index.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nvar User = require('../models/user'),\n utils = require('../utils');\n\nmodule.exports = (function() {\n\tfunction index(req, res) {\n\t\tUser.all().success(function(users) {\n\t\t\tres.send(users);\n\t\t});\n\t}\n\n function create... | javascript | edit | 0 | 3 | isc | 44eaa73f95ff971d004d71a618ab8c206026f66c | Parkjeahwan/awegeeks,xdv/gatewayd,whotooktwarden/gatewayd,xdv/gatewayd,zealord/gatewayd,crazyquark/gatewayd,zealord/gatewayd,crazyquark/gatewayd,whotooktwarden/gatewayd,Parkjeahwan/awegeeks | controllers/users.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n#!env node\n\"use strict\";\n\nvar pkg = require('../package.json');\nvar migrate = require('./migrate.json');\n\nif (pkg.name === migrate.old) {\n var warning = 'WARNING! this npm package \"' + migrate.old + '\" has moved to \"' + mig... | javascript | edit | 0 | 0 | mit | dad26af778e06fbdfd8588e928e2ba51450506d6 | ui-router/angular,wawyed/ng2,ui-router/angular,wawyed/ng2,wawyed/ng2,ui-router/ng2,ui-router/ng2,ui-router/angular,ui-router/angular | migrate/migratewarn.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nimport React from 'react'\nimport {combineReducers, createStore, applyMiddleware} from 'redux'\nimport thunk from 'redux-thunk'\nimport { Provider } from 'react-redux'\nimport { render } from 'react-dom'\nimport createHistory from 'hist... | javascript | edit | 0 | 1 | mit | 429ab5882d0d4748154a66e024a6fc5cdbf579b1 | jho406/Relax,jho406/Breezy,jho406/Relax,jho406/Breezy,jho406/Breezy,jho406/Relax | breezy_rails/lib/install/templates/web/application.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n(function(env) {\n env.ddg_spice_meta_cpan = function(api_result) {\n \"use strict\";\n\n if (!(api_result && api_result.author && api_result.version)) {\n return Spice.failed('meta_cpan');\n }\n\n ... | javascript | edit | 0 | 7 | apache-2.0 | b3da12a65880e83e7752886ad53e476dae376d0c | xaviervalarino/zeroclickinfo-spice,sagarhani/zeroclickinfo-spice,mayo/zeroclickinfo-spice,tagawa/zeroclickinfo-spice,iambibhas/zeroclickinfo-spice,bigcurl/zeroclickinfo-spice,rubinovitz/zeroclickinfo-spice,bdjnk/zeroclickinfo-spice,echosa/zeroclickinfo-spice,Kr1tya3/zeroclickinfo-spice,Kr1tya3/zeroclickinfo-spice,evejw... | share/spice/meta_cpan/meta_cpan.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nvar test = require('tap').test,\n ws = require('ws'),\n wsProxy = require('../');\n\ntest(\"ws-proxy\", function (t) {\n var server = new ws.Server({ port: 8000 }),\n proxy = wsProxy.createServer('ws://localhost:8000');\n\n ... | javascript | edit | 0 | 1 | mit | 188989aabe5f45c23b7ee0aad9be2cc657773eee | mmalecki/node-ws-proxy | test/ws-proxy-test.js | accepted | null | true |
[
{
"role": "user",
"content": "Write javascript code for the following: Add export for ES Modules"
},
{
"role": "assistant",
"content": "<% if ( !esModules ) { %>'use strict';\n\nmodule.exports = function () {};<% } else { %>export default function () {};<% } %>\n"
}
] | javascript | new_file | null | null | mit | e637612ec1a03fb8aac823a62bbd14dcb2201ee4 | niksy/generator-paleta,niksy/generator-paleta | generators/app/templates/index.js | rejected_syntax | Syntax error detected by tree-sitter | false |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n'use strict'\n\nvar IS_BROWSER = require('is-browser');\nif (!IS_BROWSER) {\n var wtfnode = require('wtfnode');\n}\nvar Suite = require('./lib/suite');\nvar defaultSuite = new Suite();\ndefaultSuite.addLogging();\ndefaultSuite.addExit(... | javascript | edit | 0 | 2 | mit | c8c5d752152979328eb938306735aedeb004b96f | ForbesLindesay/testit | index.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nimport {ScrollView, TextView, contentView, app} from 'tabris';\n\napp.registerFont('pacifico', 'resources/pacifico.ttf#Pacifico');\n\nconst scrollView = new ScrollView({\n left: 0, top: 0, right: 0, bottom: 0\n}).appendTo(contentView);... | javascript | edit | 0 | 0 | bsd-3-clause | cb6320ae43a5376713fb9b47e9d98a210b112545 | eclipsesource/tabris-js,eclipsesource/tabris-js,eclipsesource/tabris-js | snippets/textview-font-external.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n'use strict';\n\nexports.JID = require('xmpp-jid').JID;\nexports.Client = require('./lib/client');\n\n\nexports.createClient = function (opts) {\n var client = new exports.Client(opts);\n client.use(require('./lib/plugins'));\n\n ... | javascript | edit | 0 | 1 | mit | 4e1a42811095b9eb8ab9cb399ea28b70b493f567 | flavionegrao/stanza.io,firdausramlan/stanza.io,rogervaas/stanza.io,glpenghui/stanza.io,soapdog/stanza.io,glpenghui/stanza.io,Palid/stanza.io,legastero/stanza.io,legastero/stanza.io,rogervaas/stanza.io,spunkydunker/stanza.io,otalk/stanza.io,otalk/stanza.io,firdausramlan/stanza.io,soapdog/stanza.io,Palid/stanza.io,flavio... | index.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n#! /usr/bin/env node\n\nvar cube = require('dot').process({ path: './templates' });\n\nvar result = cube.solid({ a: '1.000000e+00' });\n\nconsole.log(result);\n\n```\n\nApply this change: Convert a number to scientific notation"
},
... | javascript | edit | 0 | 2 | mit | 53cb06a7388e18274dd5a33ae9e3e4ad759d0156 | dvberkel/parametric-cube-stl | index.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n$('#dripbot-title').css({\n\t\"display\": \"inline-block\",\n\t\"margin-right\": \"20px\"\n});\n\n$('#dripbot').css({\n \"text-align\": \"left\"\n});\n\n$('#dripbot-toggle.stop').css({\n \"background-color\": \"#e9656d\",\n \"c... | javascript | edit | 0 | 0 | mit | c4b5624531c11d135e246b21850b5427f9e704f6 | apottere/DripBot,apottere/DripBot,kyotie/bot,catofclysm/testing,catofclysm/testing,kyotie/bot | dripBot-css.js | accepted | null | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.