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": "Write javascript code for the following: Create resource handler script for CNTL"
},
{
"role": "assistant",
"content": "define(['mac/roman'], function(macintoshRoman) {\n\n 'use strict';\n \n return function(resource) {\n var dv = new DataView(resource.data.bu... | javascript | new_file | null | null | mit | aef0e4d16ec31cdfa503d2d4e5e5637e6fd709e0 | radishengine/drowsy,radishengine/drowsy | mac/resources/open_CNTL.js | rejected_syntax | Syntax error detected by tree-sitter | false |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nfunction BabelCompiler() {}\n\nvar BCp = BabelCompiler.prototype;\n\nBCp.processFilesForTarget = function (inputFiles) {\n inputFiles.forEach(function (inputFile) {\n var source = inputFile.getContentsAsString();\n var inputFileP... | javascript | edit | 0 | 4 | mit | 6031df4b525b59c05a2ff5506c07db4b461d925b | deanius/meteor,IveWong/meteor,cbonami/meteor,Prithvi-A/meteor,yiliaofan/meteor,jenalgit/meteor,joannekoong/meteor,lpinto93/meteor,mubassirhayat/meteor,hristaki/meteor,Prithvi-A/meteor,sitexa/meteor,kengchau/meteor,dfischer/meteor,AlexR1712/meteor,DAB0mB/meteor,cherbst/meteor,meonkeys/meteor,deanius/meteor,ashwathgovind... | packages/ecmascript/plugin.js | accepted | null | true |
[
{
"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 | 0 | 1 | bsd-3-clause | c15a6b620243d019c38d82e8be5ab3571f153791 | rickbeerendonk/react-native,cpunion/react-native,lprhodes/react-native,formatlos/react-native,hammerandchisel/react-native,ndejesus1227/react-native,exponentjs/react-native,hoastoolshop/react-native,ptmt/react-native-macos,hammerandchisel/react-native,negativetwelve/react-native,jasonnoahchoi/react-native,hoastoolshop/... | packager/babelRegisterOnly.js | accepted | null | true |
[
{
"role": "user",
"content": "Write javascript code for the following: Add data object for cars."
},
{
"role": "assistant",
"content": "'use strict';\n\nvar mongoose = require('mongoose'),\n Car = mongoose.model('Car'),\n BBPromise = require('bluebird');\n\nmodule.exports = {\n getCarBy... | javascript | new_file | 0 | 3 | mit | a1e21c5a536d5b771a1c3574081cc574f1d1c61e | TA-2016-NodeJs-Team2/Telerik-Racer,TA-2016-NodeJs-Team2/Telerik-Racer | server/data/data-cars.js | accepted | null | true |
[
{
"role": "user",
"content": "Write javascript code for the following: Move pathway functions to new file"
},
{
"role": "assistant",
"content": "import uniqBy from 'lodash/uniqBy';\n\nexport function getPathwaysModelOptions(query, filtersMeta, filter) {\n if (!query || !query.locations) return ... | javascript | new_file | 0 | 5 | mit | 9dfa9e430a77f4985b659a3207fee3c7b9b2f6f6 | Vizzuality/climate-watch,Vizzuality/climate-watch,Vizzuality/climate-watch,Vizzuality/climate-watch | app/javascript/app/components/data-explorer-content/pathway-selector-utils/pathway-selector-utils.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n(function(root,undefined) {\n\n var _ = root._;\n\n var langopts = root.DC_LANGUAGE_CODES ? _.clone(root.DC_LANGUAGE_CODES) : { language: 'eng', fallback: 'eng' };\n langopts.namespace = 'WS';\n\n var i18n = new root.I18n( langopts ... | javascript | edit | 0 | 2 | mit | 6d566d24d788baaf48afc591bd937724047e4f5d | Teino1978-Corp/Teino1978-Corp-documentcloud,monofox/documentcloud,roberttdev/dactyl4,gunjanmodi/documentcloud,roberttdev/dactyl,dannguyen/documentcloud,moodpo/documentcloud,dannguyen/documentcloud,roberttdev/dactyl4,monofox/documentcloud,monofox/documentcloud,documentcloud/documentcloud,moodpo/documentcloud,roberttdev/... | public/javascripts/lib/i18n_configure.js | accepted | null | true |
[
{
"role": "user",
"content": "Write javascript code for the following: Solve 272 Closest Binary Search Tree Value II"
},
{
"role": "assistant",
"content": "'use strict';\n/**\n * Definition for a binary tree node.\n * function TreeNode(val) {\n * this.val = val;\n * this.left = this.righ... | javascript | new_file | 0 | 12 | apache-2.0 | 7dd1dc4473afe806e1b474db80fb40b54c2dec99 | HappyCompanions/LeetCode,HappyCompanions/LeetCode,HappyCompanions/LeetCode,HappyCompanions/LeetCode,HappyCompanions/LeetCode,HappyCompanions/LeetCode,HappyCompanions/LeetCode | 272-Closest_Binary_Search_Tree_Value_II.js | rejected_complexity | Cyclomatic complexity too high: 12 | true |
[
{
"role": "user",
"content": "Write javascript code for the following: Add script for sending s3 events to slack"
},
{
"role": "assistant",
"content": "const aws = require('aws-sdk');\nconst s3 = new aws.S3({ apiVersion: '2006-03-01' });\n\nconst https = require('https');\nconst url = require('u... | javascript | new_file | 0 | 2 | mit | 0e5a113f7c92dd27c549b13887be4915562923d4 | voidabhi/node-scripts,voidabhi/node-scripts,voidabhi/node-scripts | s3-slack.js | accepted | null | true |
[
{
"role": "user",
"content": "Write javascript code for the following: Add Task Circle unit test"
},
{
"role": "assistant",
"content": "/* eslint-env mocha, jest */\n\nimport React from 'react';\nimport { shallow } from 'enzyme';\n\nimport Circle from '../Circle';\n\nit('should render', () => {\... | javascript | new_file | 0 | 1 | mit | db0578b310425bcf14d706d869f1d2ca0c75c5f0 | mkermani144/wanna,mkermani144/wanna | desktop/src/Task/__tests__/Circle.spec.js | accepted | null | true |
[
{
"role": "user",
"content": "Write javascript code for the following: Add test for Player model"
},
{
"role": "assistant",
"content": "'use strict';\n\nvar expect = require('chai').expect;\nvar Player = require('../app/scripts/player');\n\ndescribe('player', function () {\n\n it('should initia... | javascript | new_file | 0 | 1 | mit | e57be479c0c493a8a793c202953e1e18cf943dd7 | caleb531/connect-four | test/player.spec.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nconst ProvinceCard = require('../../provincecard.js');\n\nclass EndlessPlains extends ProvinceCard {\n setupCardAbilities(ability) {\n this.reaction({\n when: {\n onConflictDeclared: event => event.co... | javascript | edit | 0 | 2 | mit | b69e2d77b1f20283cc19f84ef79a2125f221bfd1 | gryffon/ringteki,jeremylarner/ringteki,gryffon/ringteki,jeremylarner/ringteki,gryffon/ringteki,jeremylarner/ringteki | server/game/cards/01-Core/EndlessPlains.js | accepted | null | true |
[
{
"role": "user",
"content": "Write javascript code for the following: Add boilerplate function to handle the request"
},
{
"role": "assistant",
"content": "const Report = require('./report');\nconst Hipchat = require('./Hipchat');\n\nfunction Reporter( request, reply ) {\n console.log(request.... | javascript | new_file | 0 | 1 | mit | 0f1a6676b4cbea177e6c40241a5866a42ce1e1d9 | wearenolte/lighthouse-reporter | src/Reporter.js | accepted | null | true |
[
{
"role": "user",
"content": "Write javascript code for the following: Create resource handler script for MENU"
},
{
"role": "assistant",
"content": "define(['mac/roman'], function(macintoshRoman) {\n\n 'use strict';\n \n return function(resource) {\n var dv = new DataView(resource.data.bu... | javascript | new_file | 0 | 4 | mit | 5c6fe35e914945a41c27151c5b0de19f8671f657 | radishengine/drowsy,radishengine/drowsy | mac/resources/open_MENU.js | accepted | null | true |
[
{
"role": "user",
"content": "Write javascript code for the following: Add Task DueDate unit test"
},
{
"role": "assistant",
"content": "/* eslint-env mocha, jest */\n\nimport React from 'react';\nimport { shallow } from 'enzyme';\n\nimport DueDate from '../DueDate';\n\nit('should render', () =>... | javascript | new_file | 0 | 1 | mit | 5ac02b2c5bdfe0f7435d062b65f154188fa7bb60 | mkermani144/wanna,mkermani144/wanna | desktop/src/Task/__tests__/DueDate.spec.js | accepted | null | true |
[
{
"role": "user",
"content": "Write javascript code for the following: Initialize express and its routes"
},
{
"role": "assistant",
"content": "'use strict'\n\nvar express = require('express');\n\nvar app = express();\n\napp.get('/', function(req, res) {\n res.send('<a href=\"/authenticate\">Lo... | javascript | new_file | 0 | 1 | mit | f8ae151d836a63e3af4a96401225981cd7a4ae68 | tolgaek/thinkful-auth-151027 | index.js | accepted | null | true |
[
{
"role": "user",
"content": "Write javascript code for the following: Add unit tests for multi-model, needs documentation."
},
{
"role": "assistant",
"content": "import {\n moduleForComponent,\n test\n } from 'ember-qunit';\nimport Ember from 'ember';\n\nmoduleForComponent('em-form', 'em-for... | javascript | new_file | null | null | apache-2.0 | 7d3c48a32f6987d148565b742939b6f05349c89b | josefguenther/ember-rapid-forms,slannigan/computed_input_errors,nobesnickr/ember-rapid-forms,piceaTech/ember-rapid-forms,piceaTech/ember-rapid-forms,josefguenther/ember-rapid-forms,nobesnickr/ember-rapid-forms,pedrokiefer/ember-forms,slannigan/computed_input_errors,pedrokiefer/ember-forms | tests/unit/components/em-form-multi-models-test.js | rejected_code_smell | Internal duplication: ~21% of the file is inside repeated 12+ line blocks | null |
[
{
"role": "user",
"content": "Write javascript code for the following: Add checkbox value form field tests"
},
{
"role": "assistant",
"content": "describe('GGRC.Components.checkboxValueFormField', function () {\n 'use strict';\n var viewModel;\n\n beforeEach(function () {\n viewModel = GGR... | javascript | new_file | 0 | 1 | apache-2.0 | 70c4f96b7e0ba9c4f8a822bb37095c829c1f1641 | AleksNeStu/ggrc-core,AleksNeStu/ggrc-core,AleksNeStu/ggrc-core,AleksNeStu/ggrc-core | src/ggrc/assets/javascripts/components/auto-save-form/fields/tests/checkbox-value-form-field_spec.js | accepted | null | true |
[
{
"role": "user",
"content": "Write javascript code for the following: Configure on create account notification util"
},
{
"role": "assistant",
"content": "// Sends account creation notification (as an input it takes data as submitted with form)\n\n'use strict';\n\nvar ensureCallable = require('... | javascript | new_file | 0 | 1 | mit | c211cb0299772f297c43f4bb237063adf2ec9dc4 | egovernment/eregistrations,egovernment/eregistrations,egovernment/eregistrations | server/email-notifications/create-account.js | accepted | null | true |
[
{
"role": "user",
"content": "Write javascript code for the following: Use Redux selectors to store minimal possible state"
},
{
"role": "assistant",
"content": "import { createSelector } from 'reselect'\nimport events from '../../core/events'\n\nconst documentCaptures = state => state.documentC... | javascript | new_file | 0 | 1 | mit | b73a4faa1411c815703af876870722f6af4f7ac8 | onfido/onfido-sdk-core | src/store/selectors/index.js | accepted | null | true |
[
{
"role": "user",
"content": "Write javascript code for the following: Add js to resize portfolio grid captions based on max height"
},
{
"role": "assistant",
"content": "$(document).ready(function(){\n var heights = $(\".portfolio-caption\").map(function() {\n return $(this).height();\n })... | javascript | new_file | 0 | 1 | apache-2.0 | 74dcb56ee494177f78ecf5b368d9d5e0fc4411dc | jjparseghian/jjparseghian.github.io,jjparseghian/jjparseghian.github.io,jjparseghian/jjparseghian.github.io,jjparseghian/jjparseghian.github.io | js/resize-portfolio-captions.js | accepted | null | true |
[
{
"role": "user",
"content": "Write javascript code for the following: Add migration about song datas."
},
{
"role": "assistant",
"content": "exports.shorthands = undefined;\n\nexports.up = (pgm) => {\n pgm.addColumns('laundry_songs', {\n japan_only: { type: 'boolean', notNull: true, default... | javascript | new_file | 0 | 1 | mit | 9862957b1d1b29c5a1f19684164e8e207f8e8759 | semiquaver-moe/server,semiquaver-moe/server | migrations/1531584159824_modify-song-fields-again.js | accepted | null | true |
[
{
"role": "user",
"content": "Write javascript code for the following: Add hasRole function to user model"
},
{
"role": "assistant",
"content": "import { Meteor } from 'meteor/meteor';\n\n// Add Transform to user's Collection\nMeteor.users._transform = function(user) {\n user.hasRole = function... | javascript | new_file | 0 | 1 | mit | b1fbcd97a2d1b2b4227c37034b64d4221b431711 | kyle-rader/greatpuzzlehunt,kyle-rader/greatpuzzlehunt,kyle-rader/greatpuzzlehunt | lib/main.js | accepted | null | true |
[
{
"role": "user",
"content": "Write javascript code for the following: Add supported browser versions list"
},
{
"role": "assistant",
"content": "TC.Cfg.acceptedBrowserVersions = [\n {\n \"name\": \"Chrome\",\n \"version\": 63\n },\n {\n \"name\": \"Firefox\",\n \"version\": 57\n... | javascript | new_file | 0 | 0 | bsd-2-clause | 52cfe18e86b4c8283310cc42c2efb8e22f3c8518 | sitna/api-sitna,sitna/api-sitna | TC/config/browser-versions.js | accepted | null | true |
[
{
"role": "user",
"content": "Write javascript code for the following: Add console-shim for crippled browsers"
},
{
"role": "assistant",
"content": "/*\n console-shim 1.0.0\n https://github.com/kayahr/console-shim\n Copyright (C) 2011 Klaus Reimer <<EMAIL>>\n Licensed under the MIT license\n (Se... | javascript | new_file | 0 | 8 | apache-2.0 | bd85ecda4744fcd02720d36eb4c7fd059b51dd37 | radare/radare.tv,radare/radare.tv,SunDi3yansyah/asciinema.org,SunDi3yansyah/asciinema.org,SunDi3yansyah/asciinema.org,asciinema/asciinema.org,SunDi3yansyah/asciinema.org,SunDi3yansyah/asciinema.org,radare/radare.tv,asciinema/asciinema-server,asciinema/asciinema.org,asciinema/asciinema-server,asciinema/asciinema.org,asc... | app/assets/javascripts/vendor/console-shim-min.js | accepted | null | true |
[
{
"role": "user",
"content": "Write javascript code for the following: Add an untested controller for the PKCS7 validator app"
},
{
"role": "assistant",
"content": "'use strict';\n\nconst CP = require('child_process');\nconst Path = require('path');\n\nclass Server {\n constructor(port, path, o... | javascript | new_file | 0 | 5 | mit | 6e558bef658dd8b9e6682cd8f0fd3e5e4fc86335 | rapid7/warden,rapid7/warden,rapid7/warden | lib/control/v1/signature.js | accepted | null | true |
[
{
"role": "user",
"content": "Write javascript code for the following: Add theme storage for saving and retrieving the current theme"
},
{
"role": "assistant",
"content": "window.ThemeStorage = {\n\n defaultTheme: 'vibrantink',\n\n save: function(themeName) {\n localStorage.setItem('github_... | javascript | new_file | 0 | 2 | mit | 0c0fe673ef0e499591a5f8524021d328c705d7ea | craigerm/dark-octo-themes,craigerm/dark-octo-themes | themeStorage.js | accepted | null | true |
[
{
"role": "user",
"content": "Write javascript code for the following: Test for all available methods"
},
{
"role": "assistant",
"content": "var expect = require('chai').expect;\n\nvar Api = require('./../src/Api');\n\n\ndescribe('Create new instance for API', function() {\n\tit('should have met... | javascript | new_file | 0 | 1 | apache-2.0 | 6334ac2d0215d00b843f41a0ba502061df86cd4d | kishmiryan-karlen/workfront-api,Workfront/workfront-api,Workfront/workfront-api | test/ApiSpec.js | accepted | null | true |
[
{
"role": "user",
"content": "Write javascript code for the following: Add directive for rendering latex equations."
},
{
"role": "assistant",
"content": "Application.Directives.directive(\"mathjaxBind\", mathjaxBindDirective);\n\nfunction mathjaxBindDirective() {\n return {\n restrict... | javascript | new_file | 0 | 2 | mit | 26badb74d93045eac40a5d554c8663a32e3524b6 | materials-commons/materialscommons.org,materials-commons/materialscommons.org,materials-commons/materialscommons.org,materials-commons/materialscommons.org,materials-commons/materialscommons.org | website/app/application/directives/mathjax-bind.js | accepted | null | true |
[
{
"role": "user",
"content": "Write javascript code for the following: Add main source js file"
},
{
"role": "assistant",
"content": "#!/usr/bin/env node\n\nvar https = require('https');\nvar fs = require('fs');\nvar argv = require('argv');\n\nargv.option([\n {\n\tname: 'apikey',\n\tshort: 'a... | javascript | new_file | 0 | 1 | mit | 20a6d2e5b7d232249b49383ed22737ba44b829ee | cafedeaqua/docomo-tts-api-cli | bin/docomo-tts.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n$(document).ready(function() {\r\n // make sidebar sticky when it hits the top of the viewport\r\n var $sidebar = $(\"#sidebar\");\r\n $sidebar.affix({\r\n offset: {\r\n top: $sidebar.offset().top - 20,\r\n ... | javascript | edit | 0 | 3 | apache-2.0 | 7bbcae5a86daeeb1bc382e6fcc73921e13a57119 | cescoffier/web-site,kevinbayes/vertx-web-site,karianna/vertx-web-site,vietj/vertx,cazacugmihai/vertx-web-site,cazacugmihai/vertx-web-site,cescoffier/web-site,karianna/vertx-web-site,michel-kraemer/web-site,cazacugmihai/vertx-web-site,michel-kraemer/web-site,michel-kraemer/web-site,woorea/vertx-web-site,vert-x3/vertx-we... | src/site/javascripts/docs.js | accepted | null | true |
[
{
"role": "user",
"content": "Write javascript code for the following: Test suite for util module"
},
{
"role": "assistant",
"content": "\nvar util = require('util');\n\nexports.test = {\n\t\n\ttestToStringWithArray : function(){\n\t\tassert.deepEquals(['1', '2', '3'], util.toStringWithArray([1,... | javascript | new_file | 0 | 1 | mit | 7b7e1474c4244672000e40c180af384c4b41b0f3 | suhaibkhan/finitejs,suhaibkhan/finitejs,suhaibkhan/finitejs | src/test/js/core/utilTest.js | accepted | null | true |
[
{
"role": "user",
"content": "Write javascript code for the following: Set up AJAX script to update preview"
},
{
"role": "assistant",
"content": "/**\n * The AJAX setup for the Markdown Preview meta box.\n */\n\n(function($, d, w){\n\n $.fn.getParsedContent = function(){\n return this.each(... | javascript | new_file | 0 | 1 | mit | 49e6b7c1f3dfe7fe5144336c3e47d4af2269bd40 | friartuck6000/wp-parsedown,friartuck6000/wp-parsedown | assets/js/src/preview-ajax.js | accepted | null | true |
[
{
"role": "user",
"content": "Write javascript code for the following: Add test case for SparseJoin misbehavior with getters\n\nBUG=v8:3621\nLOG=N\nR=<EMAIL>\n\nReview URL: https://codereview.chromium.org/645703003\n\ngit-svn-id: f98b9d40cb02301bc76fa9e1b46ee668158567fd@24535 ce2b1a6d-e550-0410-aec6-3dcde31... | javascript | new_file | 0 | 1 | mit | 9595c6104e0072c5a019cd1da28b084ac12b7d36 | UniversalFuture/moosh,UniversalFuture/moosh,UniversalFuture/moosh,UniversalFuture/moosh | test/mjsunit/bugs/bug-3621.js | accepted | null | true |
[
{
"role": "user",
"content": "Write javascript code for the following: Add a benchmark for loading a db"
},
{
"role": "assistant",
"content": "'use strict'\n\nconst IPFS = require('ipfs')\nconst IPFSRepo = require('ipfs-repo')\nconst DatastoreLevel = require('datastore-level')\nconst OrbitDB = r... | javascript | new_file | 0 | 3 | mit | 781ca786aa3249fb63b216dc5d82d6f5ec32afd0 | orbitdb/orbit-db,haadcode/orbit-db,orbitdb/orbit-db,haadcode/orbit-db | benchmarks/benchmark-load.js | accepted | null | true |
[
{
"role": "user",
"content": "Write javascript code for the following: Add fail test for query"
},
{
"role": "assistant",
"content": "import '../../src/';\nimport Avatar from '../samples/components/avatar';\nimport List from '../samples/components/list';\n\ndescribe('query', () => {\n const b... | javascript | new_file | 0 | 1 | mit | a2d3d72e1a5a0d401c92f7d02ebcd0ba4f563ae8 | baza-fe/knockout.register | test/specs/util_query_spec.js | accepted | null | true |
[
{
"role": "user",
"content": "Write javascript code for the following: Add solution for \"You're a square\""
},
{
"role": "assistant",
"content": "// https://www.codewars.com/kata/youre-a-square\n\nconst isSquare = n => (\n n >= 0 ?\n Math.pow(Math.round(Math.sqrt(n)), 2) === n :\n false\... | javascript | new_file | 0 | 2 | mit | e7be3770bd6d8f46b29fb2f87d5c087511aa8366 | jonathanweiss/codewars | youre-a-square.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nvar express = require('express');\nvar router = express.Router();\nvar windspeed = require('../middleware/windspeed')\n\nrouter.use(windspeed)\n\n\nvar statusValues = {\n\t1: {\n\t\thuman: \"Safe(ish)\",\n\t\tmachine: \"safe\"\n\t},\n\n... | javascript | edit | 0 | 1 | mit | b8b7ef924c45f611b1430931973dfb9b64c8cf1c | renemarcelo/kcbx-petcoke,chihacknight/kcbx-petcoke,benwilhelm/kcbx-petcoke,justinmanley/kcbx-petcoke,chihacknight/kcbx-petcoke,manleyjster/kcbx-petcoke,open-city/kcbx-petcoke,open-city/kcbx-petcoke,manleyjster/kcbx-petcoke,chihacknight/kcbx-petcoke,benwilhelm/kcbx-petcoke,benwilhelm/kcbx-petcoke,open-city/kcbx-petcoke,... | routes/index.js | accepted | null | true |
[
{
"role": "user",
"content": "Write javascript code for the following: Add unit tests for setting then getting skin size"
},
{
"role": "assistant",
"content": "/* global render, ImageData */\nconst {chromium} = require('playwright-chromium');\nconst test = require('tap').test;\nconst path = requ... | javascript | new_file | 0 | 1 | bsd-3-clause | cacb1156965408787c18a12c721400f0d62c1cd8 | LLK/scratch-render,LLK/scratch-render | test/integration/skin-size-tests.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n'use strict';\n\n/* global Connector */\n\nconst DEFAULT_TRACK_ART = 'nocover.png';\n\nConnector.playerSelector = '#player';\n\nConnector.artistSelector = '#trackartist';\n\nConnector.trackSelector = '#tracktitle';\n\nConnector.playButt... | javascript | edit | 0 | 0 | mit | 6c03a2af0d8b2c32cccd9bbbdd338a257858c32e | alexesprit/web-scrobbler,inverse/web-scrobbler,carpet-berlin/web-scrobbler,Paszt/web-scrobbler,fakelbst/Chrome-Last.fm-Scrobbler,usdivad/web-scrobbler,alexesprit/web-scrobbler,galeksandrp/web-scrobbler,Paszt/web-scrobbler,david-sabata/web-scrobbler,david-sabata/web-scrobbler,fakelbst/Chrome-Last.fm-Scrobbler,carpet-ber... | connectors/ambientsleepingpill.js | accepted | null | true |
[
{
"role": "user",
"content": "Write javascript code for the following: Add login authentication and unit testing"
},
{
"role": "assistant",
"content": "// Karma configuration\n// Generated on Sat Feb 20 2016 09:40:08 GMT+0800 (Malay Peninsula Standard Time)\n\nmodule.exports = function(config) {... | javascript | new_file | 0 | 1 | mit | 3fc3eaf71f55e8a9b5fa54b5611330339dfa18e0 | HarveyLeo/cms-frontend,HarveyLeo/cms-frontend | test/karma.conf.js | accepted | null | true |
[
{
"role": "user",
"content": "Write javascript code for the following: Rename presentational into presentation folder."
},
{
"role": "assistant",
"content": "import React, {PropTypes} from 'react';\n\n\nclass HelpForm extends React.Component{\n\n constructor(props, context) {\n super(props, ... | javascript | new_file | 0 | 1 | mit | e7842e76bafc42c9cc18df4951805e089847610e | prdx/kasih.in,prdx/kasih.in,prdx/kasih.in | kasih.in/app/assets/frontend/components/common/help/presentation/HelpForm.js | accepted | null | true |
[
{
"role": "user",
"content": "Write javascript code for the following: Introduce health checks row scheme"
},
{
"role": "assistant",
"content": "var HealthCheckProtocols = require(\"../constants/HealthCheckProtocols\");\n\nconst healthChecksRowScheme = {\n protocol: HealthCheckProtocols.COMMAND... | javascript | new_file | 0 | 0 | apache-2.0 | e29bb5fe786316c4d3fbc139fba4b775ae5c5f8e | cribalik/marathon-ui,mesosphere/marathon-ui,cribalik/marathon-ui,mesosphere/marathon-ui | src/js/stores/healthChecksRowScheme.js | accepted | null | true |
[
{
"role": "user",
"content": "Write javascript code for the following: Create and insert the canvas on page load"
},
{
"role": "assistant",
"content": "$(document).ready(function() {\n initCanvas($(window).width(), $(window).height());\n});\n\nvar initCanvas = function(width, height) {\n /... | javascript | new_file | 0 | 1 | mit | 14e013a35b61089706aa560e1bcf664d087b875d | Tactique/jswars | src/js/App.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nvar metas = document.getElementsByTagName('meta');\nvar i;\nif (navigator.userAgent.match(/iPhone/i)) {\n for (i=0; i<metas.length; i++) {\n if (metas[i].name == \"viewport\") {\n metas[i].content = \"width=device-width, minimu... | javascript | edit | 0 | 3 | cc0-1.0 | 8c42c4ea189e7a8095af2f051780354a0b08b553 | fducau/fducau.github.io,yuasabe/yuasabe.github.io,MRECoelho/MRECoelho.github.io,AzriRosehaizat/azrirosehaizat.github.io,rodalton/blog,dudok/dudok.github.io,soutoner/minimal-resume,mike-u/ivis-jminimal,fducau/fducau.github.io,initialneil/initialneil.github.io,bosung/bosung.github.io,n-tos/samplePages,mike-u/ivis-jminima... | assets/js/scale.fix.js | accepted | null | true |
[
{
"role": "user",
"content": "Write javascript code for the following: Write tests for stats table"
},
{
"role": "assistant",
"content": "var index = require('../../../index.js')();\nvar expect = require('chai').expect;\n\nvar React = require('react');\nvar ReactDOM = require('react-dom');\nvar ... | javascript | new_file | 0 | 1 | mit | b80b4643178f439e45622f67cbe0ea4a9eee6a9b | marcusbuffett/agnition,Agnition/agnition,marcusbuffett/agnition,Agnition/agnition | specs/clientspecs/analyzeexperiments/measurenumeric/optionlist/statstable.spec.js | accepted | null | true |
[
{
"role": "user",
"content": "Write javascript code for the following: Add ServiceTemplate object without associations"
},
{
"role": "assistant",
"content": "const { DataTypes, Model } = require('sequelize');\n\n/**\n * This class represents a template for a list of services for a week.\n */\ncl... | javascript | new_file | 0 | 1 | apache-2.0 | 98d08e515debe9ce6300f7f4f57309e34e2e0e84 | K-Fet/K-App,K-Fet/K-App,K-Fet/K-App,K-Fet/K-App | server/app/models/service-template.js | accepted | null | true |
[
{
"role": "user",
"content": "Write javascript code for the following: Add a minimal fixed size queue."
},
{
"role": "assistant",
"content": "/* Fixed size queue implemented as a circular array */\n\nfunction Ring(size) {\n this.length = size;\n this.maxIndex = this.length - 1;\n this.start... | javascript | new_file | 0 | 2 | mit | 63e1d11e97af7ec805b491501f0c8498a10bc90a | archblob/amit | src/js/circularbuffer.js | accepted | null | true |
[
{
"role": "user",
"content": "Write javascript code for the following: Add script to change URLs\n\nRef #31"
},
{
"role": "assistant",
"content": "document.addEventListener('DOMContentLoaded',function() {\n document.querySelector('select[name=\"selectUrl\"]').onchange=changeEventHandler;\n},f... | javascript | new_file | 0 | 2 | mit | 66ada9d7c7d183f69860c11a463a796a38d6c5d6 | budparr/thenewdynamic,thenewdynamic-org/thenewdynamic.org,thenewdynamic-org/thenewdynamic.org,budparr/thenewdynamic,budparr/thenewdynamic | src/js/select-url.js | accepted | null | true |
[
{
"role": "user",
"content": "Write javascript code for the following: Add utility for working with document fragments and single nodes using a single function."
},
{
"role": "assistant",
"content": "// Does something for a single node or a DocumentFragment. This is useful when\n// working with ... | javascript | new_file | 0 | 3 | mit | 3b4214f0b176b6df45f9d09ef347efc8dcf6b943 | skatejs/named-slots | src/util/each.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nimport React from 'react';\nimport _Story from './components/Story';\nexport const Story = _Story;\n\nconst defaultOptions = {\n inline: false,\n header: true,\n source: true,\n};\n\nexport default {\n addWithInfo(storyName, _info, ... | javascript | edit | 0 | 3 | mit | a513e8454a5d2a0cf6e59e8c78ef33f3bdfd5d70 | storybooks/storybook,storybooks/react-storybook,nfl/react-storybook,nfl/react-storybook,rhalff/storybook,Hacker0x01/react-storybook-addon-info,rhalff/storybook,shilman/storybook,shilman/storybook,shilman/storybook,storybooks/storybook,kadirahq/react-storybook,enjoylife/storybook,storybooks/storybook,storybooks/storyboo... | src/index.js | accepted | null | true |
[
{
"role": "user",
"content": "Write javascript code for the following: Implement an update server spec file"
},
{
"role": "assistant",
"content": "import chai from 'chai';\nimport fetch from 'node-fetch';\nimport https from 'https';\n\nchai.should();\n\ndescribe('Update Server', () => {\n it('s... | javascript | new_file | 0 | 2 | mit | 235a357e7adae4d19746d9abe4eaa271bb4ffe43 | n4k1/Google-Play-Music-Desktop-Player-UNOFFICIAL-,MCManuelLP/Google-Play-Music-Desktop-Player-UNOFFICIAL-,petuhovskiy/Google-Play-Music-Desktop-Player-UNOFFICIAL-,MCManuelLP/Google-Play-Music-Desktop-Player-UNOFFICIAL-,MarshallOfSound/Google-Play-Music-Desktop-Player-UNOFFICIAL-,MCManuelLP/Google-Play-Music-Desktop-Pla... | test/updateServer_spec.js | rejected_duplicate | Near-duplicate of sample 96136 | true |
[
{
"role": "user",
"content": "Write javascript code for the following: Add Testcase for Showing Logs JSON"
},
{
"role": "assistant",
"content": "'use strict'\nvar request = require('request')\nvar fs = require('fs')\nvar os = require('os')\nvar should = require('should')\nvar utility = require('... | javascript | new_file | 0 | 3 | mit | aaf89722894478e2d27aec6f2b81511c69ad754c | Flieral/Logger-Service | test/monitorModelTest.js | accepted | null | true |
[
{
"role": "user",
"content": "Write javascript code for the following: Add test for N^2 behavior."
},
{
"role": "assistant",
"content": "/**\n * @license\n * Copyright (c) 2017 Google Inc. All rights reserved.\n * This code may only be used under the BSD style license found at\n * http://polymer... | javascript | new_file | 0 | 1 | bsd-3-clause | 3e028e4308ec518fdaf5fae02a4f78a5fa8f9fcd | PolymerLabs/arcs,PolymerLabs/arcs,PolymerLabs/arcs,PolymerLabs/arcs,PolymerLabs/arcs,PolymerLabs/arcs,PolymerLabs/arcs,PolymerLabs/arcs | particles/Multiplexer/multiplexer-test.js | accepted | null | true |
[
{
"role": "user",
"content": "Write javascript code for the following: Add division by zero testcase\n\nUseful for manually exercising -fsanitize=undefined."
},
{
"role": "assistant",
"content": "/*\n * Floating point division by zero is undefined behavior (in C99+)\n * so the internal impleme... | javascript | new_file | 0 | 0 | mit | 89886ad9e2dca38a13ce918c3cc528578b025b4f | svaarala/duktape,svaarala/duktape,svaarala/duktape,svaarala/duktape,svaarala/duktape,svaarala/duktape,svaarala/duktape,svaarala/duktape,svaarala/duktape | tests/ecmascript/test-dev-div-by-zero.js | accepted | null | true |
[
{
"role": "user",
"content": "Write javascript code for the following: Add boilerplate to simplify starting challenges"
},
{
"role": "assistant",
"content": "// Node 11.2.0\n\nfs = require('fs');\n\n\nconst input = fs.readFileSync('input.txt', 'utf-8').trim().split('\\n');\n\nconst start = proce... | javascript | new_file | 0 | 0 | mit | 8d4f5470e2a2bcbb6f8eda6ec7d24a82d9feb3b0 | foxscotch/advent-of-code,foxscotch/advent-of-code | bp/bp.js | accepted | null | true |
[
{
"role": "user",
"content": "Write javascript code for the following: Set up controller for createNewRecipe to submit form when we get endpoint."
},
{
"role": "assistant",
"content": ";(function(){//IFEE\n\nangular.module('brewKeeper')\n .controller('createNewRecipe', function($scope, $http)... | javascript | new_file | 0 | 1 | mit | b7194056cb7ccc5e4987f48d9f56e4d116ddb0c3 | Brew-Keeper/brew-keeper-gui,ahartz1/brew-keeper-gui,ahartz1/brew-keeper-gui,Brew-Keeper/brew-keeper-gui,ahartz1/brew-keeper-gui,Brew-Keeper/brew-keeper-gui | src/js/new-recipe.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nPackage.describe({\n summary: \"Dictionary data structure: a wrapper for a raw object\",\n internal: true\n});\n\nPackage.on_use(function (api) {\n api.export('IdMap');\n api.use(['underscore', 'json', 'ejson']);\n api.add_files([ ... | javascript | edit | 0 | 1 | mit | db28492e6bd99aa138e0c7d4a1ce15fe4661f13b | udhayam/meteor,sdeveloper/meteor,benjamn/meteor,Ken-Liu/meteor,AnjirHossain/meteor,chiefninew/meteor,jg3526/meteor,SeanOceanHu/meteor,yyx990803/meteor,dfischer/meteor,steedos/meteor,williambr/meteor,D1no/meteor,udhayam/meteor,colinligertwood/meteor,stevenliuit/meteor,nuvipannu/meteor,kencheung/meteor,Theviajerock/meteo... | packages/id-map/package.js | accepted | null | true |
[
{
"role": "user",
"content": "Write javascript code for the following: Add helper for adding classes/styles to elements"
},
{
"role": "assistant",
"content": "let CLASSES = {\n hidden: \"hidden\",\n};\n\nclass Styler {\n addClass(elem, klass) {\n elem.classList.add(klass);\n }\n\n get cla... | javascript | new_file | 0 | 1 | mit | a79dd613fb12841df94c4645740f11e4256ebdaf | tdg5/js4pm,tdg5/front-end-skills-for-pms,tdg5/front-end-skills-for-pms,tdg5/js4pm | src/js/framework/styler.js | accepted | null | true |
[
{
"role": "user",
"content": "Write javascript code for the following: Move loadScript into separate file\n\nNot sure if I'll be needing this"
},
{
"role": "assistant",
"content": "// Load a javascript file from the given url, and call the given callback when\n// it's done loading.\nfunction loa... | javascript | new_file | 0 | 3 | mit | f2912ffe4d2e659ea1042b9d8699c0d44d9de918 | wapcaplet/pasta,wapcaplet/pasta | static/js/load_script.js | accepted | null | true |
[
{
"role": "user",
"content": "Write javascript code for the following: Add a with database higher order component"
},
{
"role": "assistant",
"content": "import { lifecycle } from 'recompose'\n\nimport database from '../database'\n\nexport const withDatabaseSubscribe = (trigger, getRefPath, getOn... | javascript | new_file | 0 | 1 | mit | c2aaf644d32990b9873e79976b2aa54de9052c7b | mg4tv/mg4tv-web,mg4tv/mg4tv-web | src/components/hocs.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n/*global define*/\ndefine(['jquery', 'underscore', 'backbone'\n ], function ($, _, Backbone) {\n 'use strict';\n\n /**\n * @export oroemail/js/email/template/view\n * @class oroemail.email.template.View\n * @exte... | javascript | edit | 0 | 2 | mit | 67fe84f08d7ef03767d90e3f283799984cd26b5b | Djamy/platform,trustify/oroplatform,ramunasd/platform,morontt/platform,Djamy/platform,2ndkauboy/platform,northdakota/platform,geoffroycochard/platform,trustify/oroplatform,hugeval/platform,northdakota/platform,morontt/platform,hugeval/platform,morontt/platform,2ndkauboy/platform,orocrm/platform,trustify/oroplatform,ram... | src/Oro/Bundle/EmailBundle/Resources/public/js/email/template/view.js | accepted | null | true |
[
{
"role": "user",
"content": "Write javascript code for the following: Add test cases for GOFManager class"
},
{
"role": "assistant",
"content": "/**\n * @author adoankim <<EMAIL>>\n * @copyright 2014 adoankim\n * @license {@link https://github.com/adoankim/PhaserGoF/blob/master/LI... | javascript | new_file | 0 | 1 | mit | e29e2bb50e5df929abfe595572de27d84ddebca3 | adoankim/PhaserGoF,adoankim/PhaserGoF | test/testGOFManager.js | accepted | null | true |
[
{
"role": "user",
"content": "Write javascript code for the following: Add solution to question 215"
},
{
"role": "assistant",
"content": "/**\n * @param {number[]} nums\n * @param {number} k\n * @return {number}\n */\nvar findKthLargest = function(nums, k) {\n var sorted = nums.sort(function... | javascript | new_file | 0 | 1 | mit | 68037d58a71ece4cab9d388f928be74f28eded7f | Rhadow/leetcode,Rhadow/leetcode,Rhadow/leetcode,Rhadow/leetcode | Medium/215_Kth_Largest_Element_in_an_Array.js | accepted | null | true |
[
{
"role": "user",
"content": "Write javascript code for the following: Fix deselected row in grid after insert in bound form\n\nwhen creating record with uuid idGenerator we can set the internalId to the id\nwhich it will get after saving"
},
{
"role": "assistant",
"content": "Ext4.define('Densa... | javascript | new_file | 0 | 3 | bsd-2-clause | 341269db9076621480f43d43de87116959175ca1 | Ben-Ho/densajs,koala-framework/densajs | src/overrides/DataModel.js | accepted | null | true |
[
{
"role": "user",
"content": "Write javascript code for the following: Add solution for stream-adventure: \"Lines\""
},
{
"role": "assistant",
"content": "var os = require('os');\nvar tmap = require('through2-map');\nvar split = require('split');\n\n// Convert even-numbered lines to uppercase, o... | javascript | new_file | 0 | 2 | mit | 572b517dc47204ef4f63356bd121e729ff53779e | davidcgl/nodeschool | stream-adventure/lines.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nvar path = require('path'),\n assert = require('yeoman-generator').assert,\n helpers = require('yeoman-generator').test,\n os = require('os');\n\ndescribe('sails-rest-api:app', function () {\n before(function (done) {\n ... | javascript | edit | 0 | 1 | mit | 88b14abcdd56309ea1c3f5daa82a09c5dd937ea0 | IncoCode/generator-sails-rest-api,tnunes/generator-trails,italoag/generator-sails-rest-api,ghaiklor/generator-sails-rest-api,mhipo1364/generator-sails-rest-api,eithewliter5518/generator-sails-rest-api,italoag/generator-sails-rest-api,ghaiklor/generator-sails-rest-api,konstantinzolotarev/generator-trails,jaumard/generat... | test/app.js | rejected_duplicate | Near-duplicate of sample 83601 | true |
[
{
"role": "user",
"content": "Write javascript code for the following: Add first test theme to widget app"
},
{
"role": "assistant",
"content": "qx.Class.define(\"widgets.Theme\", {\n extend: unify.ui.widget.styling.Theme,\n \n construct : function() {\n var styles = {\n test : {\n ... | javascript | new_file | 0 | 1 | mit | ecaa6445fe32bcf606121631e79b02a634eb4bcd | unify/unify,unify/unify,unify/unify,unify/unify,unify/unify,unify/unify | application/widgets/source/class/widgets/Theme.js | accepted | null | true |
[
{
"role": "user",
"content": "Write javascript code for the following: Make the schema available to store user records in the database."
},
{
"role": "assistant",
"content": "module.exports = {\n up: (queryInterface, Sequelize) => {\n queryInterface.createTable('Users', {\n id: {\n ... | javascript | new_file | 0 | 1 | mit | 733de75270864987805cec324560784bc0355dcc | ekundayo-ab/hello-books,ekundayo-ab/hello-books | server/migrations/20170802145339-create-user.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n/**\n * Exports object that contains names of options as a key and their configuration objects as a value\n *\n * @example\n * export default {\n * optionName: {\n * desc: 'Description for the option',\n * alias: 'Short name f... | javascript | edit | 0 | 0 | mit | 3e888128240a5e5b37293149eba044a4739dcf56 | italoag/generator-sails-rest-api,jaumard/generator-trails,tnunes/generator-trails,konstantinzolotarev/generator-trails,ghaiklor/generator-sails-rest-api,ghaiklor/generator-sails-rest-api,IncoCode/generator-sails-rest-api,italoag/generator-sails-rest-api | src/model/options/index.js | accepted | null | true |
[
{
"role": "user",
"content": "Write javascript code for the following: Add story for QuoteBanner component"
},
{
"role": "assistant",
"content": "import React from 'react';\nimport { storiesOf } from '@storybook/react';\n\nimport QuoteBanner from 'shared/components/quoteBanner/quoteBanner';\n\ns... | javascript | new_file | 0 | 1 | mit | 952c8d15408ab24b6c3a056834abef5a763cf9e8 | OperationCode/operationcode_frontend,sethbergman/operationcode_frontend,tal87/operationcode_frontend,tal87/operationcode_frontend,NestorSegura/operationcode_frontend,tskuse/operationcode_frontend,hollomancer/operationcode_frontend,NestorSegura/operationcode_frontend,miaket/operationcode_frontend,sethbergman/operationco... | stories/components/quoteBanner/index.js | accepted | null | true |
[
{
"role": "user",
"content": "Write javascript code for the following: Add tests for queryManager macro + decorator"
},
{
"role": "assistant",
"content": "import EmberObject from '@ember/object';\nimport { queryManager, QueryManager } from 'ember-apollo-client';\nimport { module, test } from 'qu... | javascript | new_file | 0 | 1 | mit | 36a358a9460ec54648b154bba443f471654c084d | bgentry/ember-apollo-client,bgentry/ember-apollo-client | tests/unit/-private/query-manager-macro-decorator-test.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nvar fs = require('fs');\nvar http = require('http');\nvar https = require('https');\nvar cgi = require('cgi');\n\n// The HTTPS SSL options\nvar options = {\n key: fs.readFileSync(__dirname + '/ssl.key'),\n cert: fs.readFileSync(__dirn... | javascript | edit | 0 | 0 | mit | d3727d4f73f7facddd4ba93569b192f9b27b6bc5 | celsoprieto/ISISCGI,TooTallNate/node-cgi,celsoprieto/ISISCGI,TooTallNate/node-cgi,celsoprieto/ISISCGI,TooTallNate/node-cgi | test/proxy.js | accepted | null | true |
[
{
"role": "user",
"content": "Write javascript code for the following: Add simple test case for organismDetails helper"
},
{
"role": "assistant",
"content": "// chai is an assertion library\nlet chai = require('chai');\n\n// @see http://chaijs.com/api/assert/\nlet assert = chai.assert;\n\n// reg... | javascript | new_file | 0 | 1 | mit | c52c13d4a83b59496a964cc08a8dc4c25a1d4403 | molbiodiv/fennec,molbiodiv/fennec,molbiodiv/fennec,molbiodiv/fennec,molbiodiv/fennec | tests/jsx/helpers/organismDetailsSpec.js | accepted | null | true |
[
{
"role": "user",
"content": "Write javascript code for the following: Add grunt file containing a lint task."
},
{
"role": "assistant",
"content": "'use strict';\n\nmodule.exports = function (grunt) {\n\n // Load external grunt task config.\n grunt.loadTasks('./grunt');\n\n grunt.loadN... | javascript | new_file | 0 | 1 | mit | 1e2d200c76f51dc6963dde639f91af31887c62c9 | incuna/djangular-rest-framework,incuna/djangular-rest-framework | Gruntfile.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n\n;(function(riot, evt) {\n\n // browsers only\n if (!this.top) return\n\n var loc = location,\n fns = riot.observable(),\n win = window,\n current\n\n function hash() {\n return loc.hash.slice(1)\n }\n\n functio... | javascript | edit | 0 | 3 | mit | 5e7ee92ba760f0a014852b44ca603de0cf33103b | laomu1988/riot,davidmarkclements/riot,davidmarkclements/riot,dschnare/riot,marcioj/riot,xieyu33333/riot,xieyu33333/riot,GerHobbelt/riotjs,marciojcoelho/riotjs,ListnPlay/riotjs,scalabl3/riot,ListnPlay/riotjs,dp-lewis/riot,xtity/riot,tao-zeng/riot,scalabl3/riot,duongphuhiep/riot,rsbondi/riotjs,muut/riotjs,ttamminen/riotj... | lib/router.js | accepted | null | true |
[
{
"role": "user",
"content": "Write javascript code for the following: Update project layzr.js to 1.2.2"
},
{
"role": "assistant",
"content": "!function(t,i){\"function\"==typeof define&&define.amd?define([],i):\"object\"==typeof exports?module.exports=i():t.Layzr=i()}(this,function(){\"use stri... | javascript | new_file | 0 | 9 | mit | 9461bc93ba7eca6c26fefd155372217a27628fb3 | RoberMac/jsdelivr,justincy/jsdelivr,alexmojaki/jsdelivr,cake654326/jsdelivr,ndamofli/jsdelivr,ajibolam/jsdelivr,ajibolam/jsdelivr,afghanistanyn/jsdelivr,CTres/jsdelivr,justincy/jsdelivr,Metrakit/jsdelivr,wallin/jsdelivr,markcarver/jsdelivr,dpellier/jsdelivr,Swatinem/jsdelivr,Sneezry/jsdelivr,cognitom/jsdelivr,megawac/j... | files/layzr.js/1.2.2/layzr.min.js | accepted | null | true |
[
{
"role": "user",
"content": "Write javascript code for the following: Create script to automatically create the list for Recommended Family Constellations."
},
{
"role": "assistant",
"content": "exports.create = {\n\t'Recommended Family Constellation': [{\n\t\tfamilyConstellation: '2-parent (ma... | javascript | new_file | 0 | 0 | mit | de57019a64d2ced61f3bdb9dd21a973adf8f0a21 | autoboxer/MARE,autoboxer/MARE | updates/0.0.1-list_recommended-family-constellations.js | accepted | null | true |
[
{
"role": "user",
"content": "Write javascript code for the following: Add a maintenance script for counting the total number of entries"
},
{
"role": "assistant",
"content": "/*jslint node: true */\n\n/*\n * Count all of the entries. Each Response object holds an array of one or more entries.\n... | javascript | new_file | 0 | 2 | bsd-3-clause | cf09b56f56f31b57b572156da7e7e43a7c6f4905 | LocalData/localdata-api,LocalData/localdata-api,LocalData/localdata-api | maintenance/count-entries.js | accepted | null | true |
[
{
"role": "user",
"content": "Write javascript code for the following: Add Queue, and rename files"
},
{
"role": "assistant",
"content": "function Queue() {\n this._oldestIndex = 1;\n this._newestIndex = 1;\n this._storage = {};\n}\n\nQueue.prototype.size = function() {\n return this._newest... | javascript | new_file | 0 | 2 | mit | 9120504c07a69506831f3264dd3b244411fd2ebd | jazlalli/data-structure-playground | Queue/index.js | accepted | null | true |
[
{
"role": "user",
"content": "Write javascript code for the following: Add example that prints the error from a child process"
},
{
"role": "assistant",
"content": "/*\n\nIf the child process fails, print the error.\n\n*/\n\nconst {exec} = require('child_process')\n\nproc = exec('python count.py... | javascript | new_file | 0 | 2 | apache-2.0 | 5826f84bf22d136fa4eede515b7511f4e566fd4a | feihong/node-examples,feihong/node-examples | child_process/handle_error.js | accepted | null | true |
[
{
"role": "user",
"content": "Write javascript code for the following: Add variables objects solution to match test code"
},
{
"role": "assistant",
"content": "// JavaScript Variables and Objects\n\n// I paired [by myself] on this challenge.\n\n// __________________________________________\n// W... | javascript | new_file | 0 | 2 | mit | 3245e5defcce51139b0d30cc4956b5520708d068 | michaelzwang/phase-0,michaelzwang/phase-0,michaelzwang/phase-0 | week-7/variables-objects.js | accepted | null | true |
[
{
"role": "user",
"content": "Write javascript code for the following: Add file watcher that spawns a new process.\n\nAdd a file watcher process that spawns an operating system process,\ncaptures its output and pipes that output to the standard output of the\nnode process running the file watcher script."
... | javascript | new_file | 0 | 1 | mit | 7613c87332c207db7cfd0809c1695ed991a89fc5 | mrwizard82d1/node-js-the-right-way | file-system/watcher-spawn.js | accepted | null | true |
[
{
"role": "user",
"content": "Write javascript code for the following: Set up initial bibtex misc style formatter"
},
{
"role": "assistant",
"content": "'use strict';\nrequire('../../../utils/array');\n\n/**\n * @module bibTex Misc Entry Formatter\n * Module for formatting source data into a bib... | javascript | new_file | null | null | mit | eb2454acd11b656a16813a1bdbc7e6257d5d486f | nokeeo/software-citation-tools,faokryn/software-citation-tools | core/model/formats/bibtexmisc.js | rejected_syntax | Syntax error detected by tree-sitter | false |
[
{
"role": "user",
"content": "Write javascript code for the following: Add tests for SpreadSheet eval"
},
{
"role": "assistant",
"content": "import { SpreadSheet } from './SpreadSheet';\nimport { Row, Cell } from './models';\nimport { parseCommand } from './models';\n\ndescribe('SpreadSheet', ()... | javascript | new_file | 0 | 1 | mit | 7041c7958b3b8a8354300b76ef1e5716d67de2d4 | schultyy/spreadsheet,schultyy/spreadsheet | src/lib/SpreadSheet.spec.js | accepted | null | true |
[
{
"role": "user",
"content": "Write javascript code for the following: Create utility helper for camel casing text with hyphens\n\nThis helper will be used when converting CSS styles to JS objects.\nThen the `style` object will be consistent in the React props."
},
{
"role": "assistant",
"conten... | javascript | new_file | 0 | 4 | mit | a66bd438086607e141616769368eae3c799d70a5 | remarkablemark/html-react-parser,remarkablemark/html-react-parser,remarkablemark/html-react-parser | lib/utilities.js | accepted | null | true |
[
{
"role": "user",
"content": "Write javascript code for the following: Add simple module for concatting code."
},
{
"role": "assistant",
"content": "var FileType = require('../file').type;\r\n\r\n/**\r\n * @param {Array<Object>} files\r\n * @param {string} fileType\r\n */\r\nfunction concat(file... | javascript | new_file | 0 | 3 | bsd-3-clause | 70fc48b39ea70654f230899629da2339c63606d4 | ZocDoc/Bundler,ZocDoc/Bundler | src/concat/index.js | accepted | null | true |
[
{
"role": "user",
"content": "Write javascript code for the following: Add test file for stack trace functions."
},
{
"role": "assistant",
"content": "/*globals suite, test, setup, teardown */\n\nvar sutil = require('sake/util');\n\nsuite('sake.util', function () {\n \n test('fileFromStack... | javascript | new_file | 0 | 1 | mit | 25c32481177b8055a7c746b38d094efd5ab8e3a7 | jhamlet/node-sake | test/test-util.js | accepted | null | true |
[
{
"role": "user",
"content": "Write javascript code for the following: Create a dist file with browserify"
},
{
"role": "assistant",
"content": "(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require==\"function\"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=ne... | javascript | new_file | 0 | 7 | mit | 3c6bec39f84dd8aa6424483a2d819420d0e2e785 | jollyra/tiles,jollyra/tiles | bundle.js | accepted | null | true |
[
{
"role": "user",
"content": "Write javascript code for the following: Add random team select script\n\nThis script will randomly select a team from the current season's,\nweek's set of matches.\n\nNot sure if the XML will get updated as the\nseason goes along. Will update if changes are needed."
},
{
... | javascript | new_file | 0 | 2 | mit | 71b4aecaabd67943c58a2fa62f03f10b21bc9b63 | yuleugim/nfld16 | index.js | accepted | null | true |
[
{
"role": "user",
"content": "Write javascript code for the following: Read tap output from stdin, to test parsing"
},
{
"role": "assistant",
"content": "#!/usr/bin/env node\n\n// read a tap stream from stdin.\n\nvar TapConsumer = require(\"../lib/tap-consumer\")\n , TapStream = require(\"../li... | javascript | new_file | 0 | 2 | isc | 429fa904d86ee4c6963a331b6a73ca70d15c4605 | iarna/node-tap,tapjs/node-tap,isaacs/node-tap,myndzi/node-tap,evanlucas/node-tap,myndzi/node-tap,jkrems/node-tap,Raynos/node-tap,Dignifiedquire/node-tap-core,evanlucas/node-tap,strongloop-forks/node-tap,iarna/node-tap,jondlm/node-tap,isaacs/node-tap,tapjs/node-tap,strongloop-forks/node-tap,jinivo/marhert,jondlm/node-ta... | bin/tap-reader.js | accepted | null | true |
[
{
"role": "user",
"content": "Write javascript code for the following: Add stability test for iOS keyboard"
},
{
"role": "assistant",
"content": "\"use strict\";\n\nvar setup = require(\"../../common/setup-base\")\n , desired = require('./desired')\n , _ = require('underscore');\n\n\ndescribe(... | javascript | new_file | 0 | 2 | apache-2.0 | 5ce37602b361f4ed79d4354b998f0ae1d99a18bf | appium/appium,appium/appium,appium/appium,appium/appium,appium/appium,Sw0rdstream/appium,appium/appium | test/functional/ios/testapp/keyboard-specs.js | accepted | null | true |
[
{
"role": "user",
"content": "Write javascript code for the following: Resolve import for modules in ‘scripts’ directory"
},
{
"role": "assistant",
"content": "const path = require('path');\n\nmodule.exports = {\n\tresolve: {\n\t\tmodules: [\n\t\t\t__dirname + '/scripts',\n\t\t\tpath.resolve(__d... | javascript | new_file | 0 | 0 | apache-2.0 | a1f23b243a855a9cae37edaaa5ed2a2c62c50072 | weepower/wee-core | webpack.config.js | accepted | null | true |
[
{
"role": "user",
"content": "Write javascript code for the following: Add tests around the new updated editor actions"
},
{
"role": "assistant",
"content": "import { expect, isFSA, isFSAName } from '../spec_helper'\nimport * as subject from '../../src/actions/editor'\n\ndescribe('editor actions... | javascript | new_file | 0 | 1 | mit | 8adde8004e6986a919fc26e1df2c72bddc55077b | ello/webapp,ello/webapp,ello/webapp | test/actions/editor_test.js | accepted | null | true |
[
{
"role": "user",
"content": "Write javascript code for the following: Add missing properties module (required by Hook and PubHook)"
},
{
"role": "assistant",
"content": "/**\n * @license\n * Copyright 2016 Google Inc. All Rights Reserved.\n *\n * Licensed under the Apache License, Version 2.0 (... | javascript | new_file | 0 | 0 | apache-2.0 | 5dbd7c1c09c05fa122d53ca3060b565af75b54d7 | mdittmer/smw,mdittmer/smw,mdittmer/smw | lib/properties.es6.js | accepted | null | true |
[
{
"role": "user",
"content": "Write javascript code for the following: Add simple test for gravatar directive"
},
{
"role": "assistant",
"content": "var chai = require('chai');\nvar sinon = require('sinon');\nvar sinonChai = require(\"sinon-chai\");\n\nvar ngGravatar = require('../../src/ngGrava... | javascript | new_file | 0 | 1 | mit | a19c5e3daf7cc6b81f410c5780b9eff24df70b00 | Spidy88/ngGravatar | test/unit/ngGravatarTest.js | accepted | null | true |
[
{
"role": "user",
"content": "Write javascript code for the following: Add IO monad from monet.js\n\nbut make it more es6-like"
},
{
"role": "assistant",
"content": "/* IO monad taken from monet.js */\n/*\nThe MIT License (MIT)\n\nCopyright (c) 2016 Chris Myers\n\nPermission is hereby granted, f... | javascript | new_file | 0 | 2 | mit | fb969ac6c3ebd2dd62897c3cbb34222a08e09655 | memee/reactive-charts | src/io.js | accepted | null | true |
[
{
"role": "user",
"content": "Write javascript code for the following: Add document helper file for document controller"
},
{
"role": "assistant",
"content": "const docHelper = {\n checkDocDetails: (req, res) => {\n let document = req.body;\n if (!(document.title && document.content && do... | javascript | new_file | 0 | 4 | mit | d0d1827193fbcb37d9315adddf3000f4d0037a75 | andela-oolutola/document-management-system-api | controllers/helpers/docHelper.js | accepted | null | true |
[
{
"role": "user",
"content": "Write javascript code for the following: Add Object Compare Check and Element Change Position in Array"
},
{
"role": "assistant",
"content": "module.exports = {\n move: function(arr, old_index, new_index)\n {\n while (old_index < 0)\n old_index += arr.length... | javascript | new_file | 0 | 12 | mit | 25955ef55a3086c37c8e6fa6590abb4b3bd80da6 | MrWooJ/WJChipDesign,MrWooJ/WJChipDesign | Workspace/Project/utility.js | rejected_complexity | Cyclomatic complexity too high: 12 | true |
[
{
"role": "user",
"content": "Write javascript code for the following: Update project bootstrap-hover-dropdown to v2.1.3"
},
{
"role": "assistant",
"content": "/**\n * @preserve\n * Project: Bootstrap Hover Dropdown\n * Author: Cameron Spear\n * Version: v2.1.3\n * Contributors: Mattia Larentis\... | javascript | new_file | 0 | 6 | mit | c99512ea8181d4020de2d1adc45612a70ddce91d | anilanar/jsdelivr,MenZil/jsdelivr,dnbard/jsdelivr,siscia/jsdelivr,tunnckoCore/jsdelivr,Swatinem/jsdelivr,photonstorm/jsdelivr,cognitom/jsdelivr,anilanar/jsdelivr,yyx990803/jsdelivr,vousk/jsdelivr,garrypolley/jsdelivr,labsvisual/jsdelivr,dpellier/jsdelivr,siscia/jsdelivr,anilanar/jsdelivr,Sneezry/jsdelivr,ajibolam/jsdel... | files/bootstrap.hover-dropdown/2.1.3/bootstrap-hover-dropdown.min.js | accepted | null | true |
[
{
"role": "user",
"content": "Write javascript code for the following: Add monkey patch for _dedupe."
},
{
"role": "assistant",
"content": "var through = require(\"through2\");\n\nexports.patch = function (Browserify) {\n Browserify.prototype._dedupe = function () {\n return through.ob... | javascript | new_file | 0 | 9 | mit | 7d5d37e7477c4a41e264d583158d759ad851b201 | YuzuJS/browserify-dedupe-patch | patchDedupe.js | accepted | null | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.