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: Add Reference list model for Genders."
},
{
"role": "assistant",
"content": "var keystone = require('keystone'),\n\tTypes = keystone.Field.Types;\n\n// Create model. Additional options allow menu name to be used what auto-gen... | javascript | new_file | 0 | 0 | mit | 917becac84b4fc486d05efe5e0845210fb36a139 | autoboxer/MARE,autoboxer/MARE | models/List_Gender.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n// We need to prime vertx since jasmine tests don't run in the vert.x container.\nif ((typeof nodyn) !== 'object') {\n load('./node.js');\n}\n\n// jasmine's fake clock thinks it's using milliseconds,\n// but in fact it's using seconds.... | javascript | edit | 0 | 2 | apache-2.0 | 6a6494f7fe7fbfd64cc6493f464603c51b6d2b93 | nodyn/nodyn,dherges/nodyn,tony--/nodyn,nodyn/nodyn,tony--/nodyn,dherges/nodyn,nodyn/nodyn,dherges/nodyn,tony--/nodyn | src/test/javascript/specRunner.js | accepted | null | true |
[
{
"role": "user",
"content": "Write javascript code for the following: Add script to add properties to processes that don't have any template properties."
},
{
"role": "assistant",
"content": "#!/usr/bin/env node\n\n\"use strict\";\n\nvar ropts = {\n db: process.env.MCDB || 'materialscommons'... | javascript | new_file | 0 | 3 | mit | 1ec6d8f49940e603778e006617dd5823fee8b23c | materials-commons/materialscommons.org,materials-commons/materialscommons.org,materials-commons/materialscommons.org,materials-commons/materialscommons.org,materials-commons/materialscommons.org | backend/scripts/conversion/fixproperties.js | accepted | null | true |
[
{
"role": "user",
"content": "Write javascript code for the following: Update project jQuery.leanModal2 to 2.3"
},
{
"role": "assistant",
"content": "// jQuery.leanModal2.min.js v2.3 - MIT Licensed by eustasy http://eustasy.org\n(function($){function leanModal_Close(modal_id){$('.js-target-jquer... | javascript | new_file | 0 | 4 | mit | 8a3599bf87bcb5dbf621f669f27d7c498cb37f2e | vvo/jsdelivr,vvo/jsdelivr,vvo/jsdelivr,vvo/jsdelivr,vvo/jsdelivr | files/jquery.leanmodal2/2.3/jQuery.leanModal2.min.js | accepted | null | true |
[
{
"role": "user",
"content": "Write javascript code for the following: Add a unit test for notYankedOrIsOwner (authored by @efx)."
},
{
"role": "assistant",
"content": "import { module, test } from 'qunit';\nimport { setupTest } from 'ember-qunit';\nimport { A } from '@ember/array';\nimport Serv... | javascript | new_file | 0 | 1 | apache-2.0 | 234a9ac5c3e2e76a38991523eeac2a6eb425df76 | rust-lang/crates.io,rust-lang/crates.io,rust-lang/crates.io,rust-lang/crates.io | tests/unit/controllers/crate/version-test.js | accepted | null | true |
[
{
"role": "user",
"content": "Write javascript code for the following: Add helper to check if platform is windows"
},
{
"role": "assistant",
"content": "/**\n * Created by JiaHao on 5/10/15.\n */\n\nvar os = require('os');\n\nfunction platformIsWindows() {\n var platform = os.platform();\n ... | javascript | new_file | 0 | 1 | mit | 0dd064b77199e2c8125d50017450b30acc888084 | jiahaog/Revenant | lib/helpers/helpers.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nimport Ember from 'ember';\nimport EmberUploader from 'ember-uploader';\n\nconst { FileField, Uploader } = EmberUploader;\n\nexport default FileField.extend({\n url: '',\n\n filesDidChange(files) {\n const uploadUrl = this.get('url... | javascript | edit | 0 | 2 | mit | ee9bafc127c84dad9b11f3f97d5c6f13a7f76732 | jrjohnson/frontend,stopfstedt/frontend,stopfstedt/frontend,gboushey/frontend,thecoolestguy/frontend,djvoa12/frontend,gabycampagna/frontend,gabycampagna/frontend,thecoolestguy/frontend,dartajax/frontend,jrjohnson/frontend,dartajax/frontend,ilios/frontend,gboushey/frontend,ilios/frontend,djvoa12/frontend | app/components/file-upload.js | accepted | null | true |
[
{
"role": "user",
"content": "Write javascript code for the following: Move parseFields function to its own module"
},
{
"role": "assistant",
"content": "function parseFields (payload) {\n if (Array.isArray(payload)) {\n payload.forEach(parseFields);\n return;\n }\n\n if (typeof payload... | javascript | new_file | 0 | 4 | mit | 706e7e4c22a6a1c94170588ec4370dfc9fe91ed3 | darvelo/wishlist,darvelo/wishlist | app/scripts/app/utils/parse-fields-metadata.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nvar tap = require(\"tap\")\nvar normalize = require(\"../lib/normalize\")\nvar path = require(\"path\")\nvar fs = require(\"fs\")\nvar _ = require(\"underscore\")\nvar async = require(\"async\")\n\nvar data, clonedData\n\ntap.test(\"con... | javascript | edit | 0 | 2 | bsd-2-clause | c5b009d7122e448fd9e726ea5c1fe1bb1617920a | kemitchell/normalize-package-data,sindresorhus/normalize-package-data | test/consistency.js | accepted | null | true |
[
{
"role": "user",
"content": "Write javascript code for the following: Make a generic trivago api call function"
},
{
"role": "assistant",
"content": "'use strict'\n\nconst crypto = require('crypto')\nconst config = require('../config')\nconst rp = require('request-promise')\nconst Q = require('... | javascript | new_file | 0 | 3 | mit | 7757d2986ae9890091dcb8b5f984ac30f12f9e3a | TrvgoHack/Propsl | lib/ctrls/trivagoCall.js | accepted | null | true |
[
{
"role": "user",
"content": "Write javascript code for the following: Add the example to use postgres to insert data into db."
},
{
"role": "assistant",
"content": "var pg = require('pg');\nvar uri = 'postgres://fred:12345678@localhost/mydb';\n\npg.connect(uri, function(err, client, done) {\n ... | javascript | new_file | 0 | 2 | mit | 0f32d2e5fbf71d859dc2dcafe3d94955ca455a19 | nicebook/Node.js-Reference,nicebook/Node.js-Reference,nicebook/Node.js-Reference | 6/postgressql-insert.js | accepted | null | true |
[
{
"role": "user",
"content": "Write javascript code for the following: Add benchmark comparison for trianglepath construction with rounded corners."
},
{
"role": "assistant",
"content": "var suite = new PerfSuite({\n name: 'RedRaphael Compare Trianglepath Construction With and Without Rounded... | javascript | new_file | 0 | 0 | mit | 062ab472fd083b2ecbb2c022aa4dc4d7a24b4a9e | fusioncharts/redraphael,AyanGhatak/redraphael,AyanGhatak/redraphael,fusioncharts/redraphael,AyanGhatak/redraphael,fusioncharts/redraphael | tests/benchmark/compare-trianglepath-construction-with-rounded-corners.js | accepted | null | true |
[
{
"role": "user",
"content": "Write javascript code for the following: tests: Add tests for \"open-editor\" utility"
},
{
"role": "assistant",
"content": "'use strict';\n\nvar openEditor = require('../../../lib/utilities/open-editor');\n\nvar expect = require('chai').expect;\nvar td = require('t... | javascript | new_file | 0 | 1 | mit | cd2ea8efaaf7805df173c625d3938744273d5d9c | pzuraq/ember-cli,ef4/ember-cli,seawatts/ember-cli,patocallaghan/ember-cli,sivakumar-kailasam/ember-cli,jasonmit/ember-cli,fpauser/ember-cli,fpauser/ember-cli,Turbo87/ember-cli,mike-north/ember-cli,williamsbdev/ember-cli,rtablada/ember-cli,xtian/ember-cli,johanneswuerbach/ember-cli,lazybensch/ember-cli,givanse/ember-cli... | tests/unit/utilities/open-editor-test.js | accepted | null | true |
[
{
"role": "user",
"content": "Write javascript code for the following: Add untyped acl test resource"
},
{
"role": "assistant",
"content": "module.exports = `@prefix acl: <http://www.w3.org/ns/auth/acl#>.\n@prefix foaf: <http://xmlns.com/foaf/0.1/> .\n\n<#authorization>\n # Not present: a acl... | javascript | new_file | 0 | 0 | mit | 99172fb251dd0dc052f7056e44751fe0851ecd15 | solid/solid-permissions | test/resources/untyped-acl-ttl.js | accepted | null | true |
[
{
"role": "user",
"content": "Write javascript code for the following: Add first version of code.\n\nUntil this point, development of this javascript was handled through codepen. However, this side project has reached a level of ambition that requires the power of real version control."
},
{
"role":... | javascript | new_file | 0 | 10 | mit | 7b8f2bebfaef9da1d59fd9cf25e93cebce4e9f19 | whereswaldon/backfeed,whereswaldon/bill | backfeed.js | accepted | null | true |
[
{
"role": "user",
"content": "Write javascript code for the following: Add Zillow link Answer Generator"
},
{
"role": "assistant",
"content": "/*jslint continue: true, devel: true, evil: true, indent: 2, plusplus: true, rhino: true, unparam: true, vars: true, white: true */\nfunction isNonBlankS... | javascript | new_file | 0 | 13 | apache-2.0 | 66864cbe083386e1f8b748f59938f8fd6b055199 | jtsay362/solveforall-example-plugins,jtsay362/solveforall-example-plugins | src/answer_generators/zillow/zillow_link.js | rejected_complexity | Cyclomatic complexity too high: 13 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nimport React, {PropTypes} from 'react';\n\nconst SourceIndicator = React.createClass({\n propTypes: {\n source: PropTypes.shape({}).isRequired,\n },\n\n render() {\n const {source} = this.props;\n return (\n <div classN... | javascript | edit | 0 | 2 | mit | fe94556ea4dd84965662dabbba7e4c32f2402968 | influxdata/influxdb,influxdata/influxdb,influxdb/influxdb,mark-rushakoff/influxdb,mark-rushakoff/influxdb,li-ang/influxdb,nooproblem/influxdb,nooproblem/influxdb,influxdb/influxdb,nooproblem/influxdb,influxdb/influxdb,influxdb/influxdb,mark-rushakoff/influxdb,influxdb/influxdb,influxdb/influxdb,mark-rushakoff/influxdb,... | ui/src/shared/components/SourceIndicator.js | accepted | null | true |
[
{
"role": "user",
"content": "Write javascript code for the following: Add first version of Ceylon language file"
},
{
"role": "assistant",
"content": "/*\nLanguage: Ceylon\nAuthor: Lucas Werkmeister <<EMAIL>>\n*/\nfunction(hljs) {\n // 2.3. Identifiers and keywords\n var KEYWORDS =\n 'asse... | javascript | new_file | 0 | 1 | bsd-3-clause | 893eb08b44602119f0839f04a74703de033ae2d7 | liang42hao/highlight.js,highlightjs/highlight.js,adjohnson916/highlight.js,daimor/highlight.js,highlightjs/highlight.js,robconery/highlight.js,abhishekgahlot/highlight.js,weiyibin/highlight.js,delebash/highlight.js,sourrust/highlight.js,STRML/highlight.js,0x7fffffff/highlight.js,brennced/highlight.js,daimor/highlight.j... | src/languages/ceylon.js | accepted | null | true |
[
{
"role": "user",
"content": "Write javascript code for the following: Fix service worker (sw path and scope were messed up)"
},
{
"role": "assistant",
"content": "var CACHE_NAME = 'v1'\n\nvar CAHCED_DEFAULTS = [\n '/',\n\n '/styles/main.css',\n '/styles/normalize.css',\n\n '/scripts... | javascript | new_file | 0 | 4 | unlicense | d894cec86eee44dfd07d3e906e80d4de145fafc8 | ghzmdr/showtell,ghzmdr/showtell | static/service-worker.js | accepted | null | true |
[
{
"role": "user",
"content": "Write javascript code for the following: Install bower deps on addon install"
},
{
"role": "assistant",
"content": "/*jshint node:true*/\nmodule.exports = {\n name: 'ember-purify',\n\n afterinstall: function(options) {\n this.addBowerPackageToProject('DOMPurify... | javascript | new_file | 0 | 1 | mit | f4c84d9c9b2cf7a15b947a6a1cb8d86e485431df | sivakumar-kailasam/ember-purify,sivakumar-kailasam/ember-purify | blueprints/ember-purify/index.js | accepted | null | true |
[
{
"role": "user",
"content": "Write javascript code for the following: Add test challenge list test"
},
{
"role": "assistant",
"content": "/* eslint-disable no-undef */\nconst controllers = require('../controllers');\n// const db = require('../utils').db;\nconst fixtures = require('../spec/fixtu... | javascript | new_file | 0 | 3 | mit | 361b0aad5ce1fb53ebc1558540f5076f5ec8dbb0 | osumb/challenges,osumb/challenges,osumb/challenges,osumb/challenges | spec/confirm-challenge-list-spec.js | accepted | null | true |
[
{
"role": "user",
"content": "Write javascript code for the following: Document workspace API completable arguments"
},
{
"role": "assistant",
"content": "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2019 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\"... | javascript | new_file | 0 | 0 | apache-2.0 | ce177a9a20ddbe09072d0780069c8a49bc836cb0 | stdlib-js/stdlib,stdlib-js/stdlib,stdlib-js/stdlib,stdlib-js/stdlib,stdlib-js/stdlib,stdlib-js/stdlib,stdlib-js/stdlib,stdlib-js/stdlib | lib/node_modules/@stdlib/repl/ctor/lib/workspace_aliases.js | accepted | null | true |
[
{
"role": "user",
"content": "Write javascript code for the following: Add tests for moving a file"
},
{
"role": "assistant",
"content": "const r = require('@lib/r');\nconst files = require('@dal/files')(r);\nconst tutil = require('@lib/test-utils')(r);\nconst dirUtils = require('@dal/dir-utils'... | javascript | new_file | 0 | 1 | mit | 4be233251a810e6a74c3ffa271378e91e0148dca | materials-commons/materialscommons.org,materials-commons/materialscommons.org,materials-commons/materialscommons.org,materials-commons/materialscommons.org,materials-commons/materialscommons.org | backend/servers/mcapid/lib/dal/__tests__/files-tests.js | accepted | null | true |
[
{
"role": "user",
"content": "Write javascript code for the following: Create a spec for TimePaneCtrler"
},
{
"role": "assistant",
"content": "describe('tab-panes TimePaneCtrler', function() {\n\tvar $rootScope;\n\tvar $controller;\n\tbeforeEach(module('popupApp'));\n\tbeforeEach(inject(function... | javascript | new_file | 0 | 2 | apache-2.0 | eb24559fd611dbfa6b125938809a7c016a37f46a | shioyang/IDontDisturbMe,shioyang/IDontDisturbMe | ut/tabPanes_TimePaneSpec.js | accepted | null | true |
[
{
"role": "user",
"content": "Write javascript code for the following: Make color information available to iwindow\n\nNo user-visible changes. If you don't plan to use the tract colors in\nthe info window, disregard."
},
{
"role": "assistant",
"content": "define([], function() {\n return {\n ... | javascript | new_file | 0 | 4 | mit | 184cd407f85f39d310516672fa04a18dff7c4b0c | codeforboston/ungentry,codeforboston/ungentry,codeforboston/ungentry,codeforboston/ungentry,codeforboston/ungentry | src/colors.js | accepted | null | true |
[
{
"role": "user",
"content": "Write javascript code for the following: Add script to convert from binary representation to symbolic notation"
},
{
"role": "assistant",
"content": "'use strict';\n\nvar toBinaryString = require( '@stdlib/number/uint16/base/to-binary-string' );\nvar lpad = require(... | javascript | new_file | 0 | 0 | apache-2.0 | 76a2946b6dbb184bf252dd1c8b4d25e554e85499 | stdlib-js/stdlib,stdlib-js/stdlib,stdlib-js/stdlib,stdlib-js/stdlib,stdlib-js/stdlib,stdlib-js/stdlib,stdlib-js/stdlib,stdlib-js/stdlib | lib/node_modules/@stdlib/process/umask/scripts/binary_to_symbolic.js | accepted | null | true |
[
{
"role": "user",
"content": "Write javascript code for the following: Add the POST method for /images and /reports"
},
{
"role": "assistant",
"content": "module.exports = function(options, callback) {\n\n var fs = require('fs'),\n restify = require('restify'),\n util = require('util'... | javascript | new_file | 0 | 3 | mit | 810af368e821a4ae67972ce3d03ccbfb7d155983 | queixinhas/queixinhas-api | lib/service.js | accepted | null | true |
[
{
"role": "user",
"content": "Write javascript code for the following: Add library for handling morse code.\nThis will be tapped when we want to send a pattern from the \"not-yet-created\" lights module.\n\nThe current example is taking the number of active-builds and using that value as a pattern.\nEx.) th... | javascript | new_file | 0 | 5 | mit | 1b2a2de06e98c609ed6832b9e85b1961c913c0d6 | ritterim/sparkles | morse-codec.js | accepted | null | true |
[
{
"role": "user",
"content": "Write javascript code for the following: Add binary with v1 code."
},
{
"role": "assistant",
"content": "#!/usr/bin/env node\n\nprocess.title = 'npm-yarn-compare';\n\nlet child_process = require('child_process'),\n prettyMs = require('pretty-ms'),\n clc = requ... | javascript | new_file | 0 | 0 | mit | ad40a8a6eb20d07b6701680847d5d895415ea38f | supreetpal/npmvsyarn | bin/npm-yarn-compare.js | accepted | null | true |
[
{
"role": "user",
"content": "Write javascript code for the following: Structure of the operators if else"
},
{
"role": "assistant",
"content": "// operator if..elseif..else\n/*\nJavaScript has a similar set of control structures to other languages in the C family. \nConditional statements are s... | javascript | new_file | 0 | 0 | mit | 4891d09f6754607b7b41551ea2a421588552db69 | niksolaz/Learning-Javacript,niksolaz/Learning-Javacript,niksolaz/Learning-Javacript,niksolaz/Learning-Javacript,niksolaz/Learning-Javacript,niksolaz/Learning-Javacript | javascript/control_structure/control.js | accepted | null | true |
[
{
"role": "user",
"content": "Write javascript code for the following: Add help text for trading types"
},
{
"role": "assistant",
"content": "export default ({\n CALL: 'You win the payout if the exit spot is strictly higher than the entry spot.',\n PUT: 'You win the payout if the exit spot... | javascript | new_file | 0 | 0 | mit | 699a80458b1d7d3617b9d505ccd73fce99bca01f | nuruddeensalihu/binary-next-gen,nuruddeensalihu/binary-next-gen,nazaninreihani/binary-next-gen,binary-com/binary-next-gen,nazaninreihani/binary-next-gen,nuruddeensalihu/binary-next-gen,binary-com/binary-next-gen,binary-com/binary-next-gen,nazaninreihani/binary-next-gen | src/trade-type-picker/helpText.js | accepted | null | true |
[
{
"role": "user",
"content": "Write javascript code for the following: Test for time conversion fix"
},
{
"role": "assistant",
"content": "if(typeof exports === 'object') {\n\tvar assert = require(\"assert\");\n\tvar alasql = require('..');\n}\ndescribe('Test 431 error in 8 and 108 convert forma... | javascript | new_file | 0 | 1 | mit | 009e91723f6161dbe7bb08a2e607b2c4271bde74 | agershun/alasql,kanghj/alasql,kanghj/alasql,agershun/alasql,kanghj/alasql,agershun/alasql,agershun/alasql | test/test431.js | accepted | null | true |
[
{
"role": "user",
"content": "Write javascript code for the following: Test for duplicate name added."
},
{
"role": "assistant",
"content": "// Test suite for woad.\n// Run from 'test' subfolder\n'use strict';\nconst lg = require('../woad.js');\nconst test = require('unit.js');\nconst fs = requi... | javascript | new_file | 0 | 2 | mit | f8d34c9c3b5e3f322ead929b4032d0e5c533e2cd | kelvin-martin/woad | test/test10.js | accepted | null | true |
[
{
"role": "user",
"content": "Write javascript code for the following: Add minimal sanity test for hamjest exports"
},
{
"role": "assistant",
"content": "'use strict';\n\nvar _ = require('lodash-node')\n\t, hamjest = require('../lib/hamjest')\n\t, assertFalse = require('./asserts').assertFalse\n... | javascript | new_file | 0 | 1 | mit | 3637584f3c858a5025494d508193302e8a1cd8f8 | rluba/hamjest,rluba/hamjest | test/hamjestSpec.js | accepted | null | true |
[
{
"role": "user",
"content": "Write javascript code for the following: Create handling of accountKit in client side"
},
{
"role": "assistant",
"content": "// initialize Account Kit with CSRF protection\n AccountKit_OnInteractive = function () {\n AccountKit.init(\n {\n appId: '16... | javascript | new_file | 0 | 4 | mit | 4a1389a2844388d11b595a7fc7cf85213ce2e221 | chandrajob365/ChatApp,chandrajob365/ChatApp | public/javascript/accountKitLogin.js | accepted | null | true |
[
{
"role": "user",
"content": "Write javascript code for the following: Introduce GridBlock component that doesn't parse markdown\n\nReviewed By: jstejada\n\nDifferential Revision: D26202230\n\nfbshipit-source-id: fa3fc259e1fc34ef5ce383c142ee45963e3354d6"
},
{
"role": "assistant",
"content": "/**... | javascript | new_file | 0 | 7 | mit | 8e1afd54645731ae67d115506e2a9cff418e2980 | yungsters/relay,voideanvalue/relay,atxwebs/relay,kassens/relay,wincent/relay,facebook/relay,kassens/relay,wincent/relay,atxwebs/relay,wincent/relay,wincent/relay,voideanvalue/relay,josephsavona/relay,xuorig/relay,atxwebs/relay,josephsavona/relay,wincent/relay,facebook/relay,xuorig/relay,facebook/relay,kassens/relay,yun... | website/core/AltGridBlock.js | accepted | null | true |
[
{
"role": "user",
"content": "Write javascript code for the following: Add the controller for the type racer game."
},
{
"role": "assistant",
"content": "function TypeRacerCtrl($scope) {\n this.selectedLevelName;\n this.selectedLevelSpeed;\n this.playerName;\n \n this.$onInit = fu... | javascript | new_file | 0 | 7 | mit | 49f2e660460a8fe3efb64e8037dd5a943f3a9999 | gbelwariar/TypeRacer,gbelwariar/TypeRacer | public_html/type-racer-controller.js | accepted | null | true |
[
{
"role": "user",
"content": "Write javascript code for the following: Update: Add tests to Spinner component"
},
{
"role": "assistant",
"content": "/* eslint-env jest */\n\nimport React from 'react';\nimport { render, cleanup } from 'react-testing-library';\nimport Spinner from './Spinner';\n\n... | javascript | new_file | 0 | 1 | mit | bb471dc55d06a5851acd35bb4ca79ee3811c6f0a | TWExchangeSolutions/es-components,jrios/es-components,TWExchangeSolutions/es-components,jrios/es-components,jrios/es-components | packages/es-components/src/components/base/spinner/Spinner.specs.js | accepted | null | true |
[
{
"role": "user",
"content": "Write javascript code for the following: Add input plugin test. - client plugin added."
},
{
"role": "assistant",
"content": "var client = require('../../../lib/plugin/in/client.js'),\n nock = require('nock'),\n here = require('here').here;\n\ndescribe('input ... | javascript | new_file | 0 | 1 | mit | f99b4a72a5871b49dd95fa41bdf66ada81912e7e | hideack/evac | test/plugin/in/client_test.js | accepted | null | true |
[
{
"role": "user",
"content": "Write javascript code for the following: Add fishing and consume example"
},
{
"role": "assistant",
"content": "const mineflayer = require('mineflayer')\n\nif (process.argv.length < 4 || process.argv.length > 6) {\n console.log('Usage : node scoreboard.js <host> <p... | javascript | new_file | 0 | 4 | mit | a38d85b0914b7fbcd3e30d7776390605d6c08d4e | PrismarineJS/mineflayer,andrewrk/mineflayer | examples/fisherman.js | accepted | null | true |
[
{
"role": "user",
"content": "Write javascript code for the following: Add reducer test for ENHANCE_CAN_DROP_PIECE."
},
{
"role": "assistant",
"content": "import shogi from '../../../frontend/reducers/shogi';\nimport * as Action from '../../../frontend/actions';\nimport Piece from '../../../fron... | javascript | new_file | 0 | 1 | mit | e606304f9d074c8541aa45e376bb6cf3cc14137a | mgi166/usi-front,mgi166/usi-front | test/reducers/shogi/enhanceCanDropPosition_test.js | accepted | null | true |
[
{
"role": "user",
"content": "Write javascript code for the following: Add test script for the Nippon kiosk printer"
},
{
"role": "assistant",
"content": "const minimist = require('minimist')\nconst SerialPort = require('serialport')\n\nconst portOptions = {\n autoOpen: false,\n baudRate: 1152... | javascript | new_file | 0 | 2 | unlicense | eb6590a9b0685b1f36905bacfec1f1a9027f00d4 | lamassu/lamassu-machine,lamassu/lamassu-machine,lamassu/lamassu-machine,lamassu/lamassu-machine | tools/nipponPrinterTests.js | accepted | null | true |
[
{
"role": "user",
"content": "Write javascript code for the following: Add template json schema test"
},
{
"role": "assistant",
"content": "const fs = require('fs');\nconst path = require('path');\nconst jsYaml = require('js-yaml');\nconst should = require('should');\n// eslint-disable-next-line... | javascript | new_file | 0 | 1 | apache-2.0 | 74fcbee17bd99b0586a155b0794f561428181660 | ExpressGateway/express-gateway | test/config/templates-schema.js | accepted | null | true |
[
{
"role": "user",
"content": "Write javascript code for the following: Add test for bitwise hash"
},
{
"role": "assistant",
"content": "var assert = require('assert'),\n BitwiseHash = require('./../lib/BitwiseHash');\n\ndescribe('BitwiseHash', function () {\n it('Should create instance', f... | javascript | new_file | 0 | 1 | mit | 8cef34add0bbe730f4046faa9616aa99533bbe23 | ghaiklor/data-2-hash | test/BitwiseHash.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nvar Logger = function (config) {\n this.config = config;\n this.backend = this.config.backend || 'stdout'\n this.level = this.config.level || \"LOG_INFO\"\n if (this.backend == 'stdout') {\n this.util = require('util');\n } e... | javascript | edit | 0 | 6 | mit | 34c43896fa91a3b4d90632d380a0d985ba7f8744 | cit-lab/statsd,Mindera/statsd,aronatkins/statsd,Yelp/statsd,Yelp/statsd,roflmao/statsd,joshughes/statsd,blurredbits/statsd,sax/statsd,pagerinc/statsd,jmptrader/statsd,ShalomCohen/statsd,DataDog/statsd,cit-lab/statsd,AdamMagaluk/statsd-cloudwatch,jxqlovejava/statsd,Charlesdong/statsd,omniti-labs/statsd,cit-lab/statsd,bl... | lib/logger.js | rejected_duplicate | Near-duplicate of sample 92709 | true |
[
{
"role": "user",
"content": "Write javascript code for the following: Add promise wrapper over the child compiler"
},
{
"role": "assistant",
"content": "var extend = require('extend');\nvar Promise = require('bluebird');\nvar PluginError = require('../utils/PluginError');\n\n/**\n * @param {Com... | javascript | new_file | 0 | 4 | mit | bde9bf0bd609a89609088e4903fd921f0acdbe78 | kisenka/docpack,kisenka/webpack-docs-plugin | lib/compiler/ChildCompiler.js | accepted | null | true |
[
{
"role": "user",
"content": "Write javascript code for the following: Add the example to resize the image file via garphicsmagick."
},
{
"role": "assistant",
"content": "var gm = require('gm');\nvar dirpath = 'images/';\nvar imgname = 'download-logo.png';\nvar tmppath = 'tmp/';\n\ngm(dirpath +... | javascript | new_file | 0 | 2 | mit | 5baba1ee915859c95d0c3d1a5d56861f8a66df36 | nicebook/Node.js-Reference,nicebook/Node.js-Reference,nicebook/Node.js-Reference | 16/graphicsmagick-resize.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nPackage.describe({\n summary: \"A minimalist client-side MVC framework\"\n});\n\nPackage.on_use(function (api) {\n // XXX Backbone requires either jquery or zepto\n api.use(\"jquery\");\n\n api.add_files(\"backbone.js\", \"client\")... | javascript | edit | 0 | 2 | mit | 2887771f4aa39e4065c43f485f308e23e5a4aec7 | hristaki/meteor,TribeMedia/meteor,SeanOceanHu/meteor,akintoey/meteor,fashionsun/meteor,deanius/meteor,eluck/meteor,karlito40/meteor,meonkeys/meteor,pjump/meteor,AnjirHossain/meteor,sdeveloper/meteor,IveWong/meteor,jdivy/meteor,HugoRLopes/meteor,jenalgit/meteor,joannekoong/meteor,pjump/meteor,chasertech/meteor,D1no/mete... | packages/backbone/package.js | accepted | null | true |
[
{
"role": "user",
"content": "Write javascript code for the following: Add ES6 variant using classes"
},
{
"role": "assistant",
"content": "// ES6 variation with classes for \"Classical inheritance in JS ES5\".\n//\n// Eli Bendersky [http://eli.thegreenplace.net]\n// This code is in the public d... | javascript | new_file | 0 | 1 | unlicense | bc79b09f2081e7af016580f6a383aee322617655 | eliben/code-for-blog,eliben/code-for-blog,eliben/code-for-blog,eliben/code-for-blog,eliben/code-for-blog,eliben/code-for-blog,eliben/code-for-blog,eliben/code-for-blog,eliben/code-for-blog,eliben/code-for-blog,eliben/code-for-blog | 2013/js-inheritance-es6.js | accepted | null | true |
[
{
"role": "user",
"content": "Write javascript code for the following: Add tests for board vue component"
},
{
"role": "assistant",
"content": "import Board from '../src/components/kanban-board.vue'\n\ndescribe(\"KanbanBoard\", () => {\n it(\"should have child components\", () => {\n e... | javascript | new_file | 0 | 1 | mit | 1f02ea68b643c87e2031f0a4d1ca870849708d65 | drayah/xerpa-kanban,drayah/xerpa-kanban | test/kanban-board.spec.js | accepted | null | true |
[
{
"role": "user",
"content": "Write javascript code for the following: Add LPD8 script for cross-device identification"
},
{
"role": "assistant",
"content": "// Bitwig controller script for AKAI LPD\n// by Nick Donaldson, 2016\n//\n// Global constants\n\nvar SCRIPT_API_VERSION = 1;\nvar SCRIPT_V... | javascript | new_file | 0 | 0 | cc0-1.0 | 7ff5b1ccb90e096f5dbcbaa431bbcde5f208aca6 | ndonald2/bitwig-controller-scripts,ndonald2/bitwig-controller-scripts | Akai/LPD8.Virek.control.js | accepted | null | true |
[
{
"role": "user",
"content": "Write javascript code for the following: Add types for @storybook/addon-actions package"
},
{
"role": "assistant",
"content": "// flow-typed signature: 824de8c4d861db90a6471d410d3df917\n// flow-typed version: <<STUB>>/@storybook/addon-actions_v4.0.0/flow_v0.90.0\n\n... | javascript | new_file | null | null | mit | 41aa5f27916122de2f7f12f9a5916c08b1800649 | moira-alert/web2.0,moira-alert/web2.0,moira-alert/web2.0,moira-alert/web2.0 | flow-typed/npm/@storybook/addon-actions_v4.x.x.js | rejected_syntax | Syntax error detected by tree-sitter | false |
[
{
"role": "user",
"content": "Write javascript code for the following: Implement basic Hue API control"
},
{
"role": "assistant",
"content": "HueBridge = function(server, username) {\n this.server = server;\n this.username = username;\n}\n\nHueBridge.prototype = {\n\n _apiCall: function(metho... | javascript | new_file | 0 | 5 | mit | aaaa73ca984792217bc4e1c1c9185be47250a8a8 | iwazaru/notrebeausapin.fr,iwazaru/notrebeausapin.fr | hue.js | accepted | null | true |
[
{
"role": "user",
"content": "Write javascript code for the following: Add skeleton of mixer tests for play and pause"
},
{
"role": "assistant",
"content": "describe(\"Mixer\", function(){\n var mixer;\n var song;\n\n beforeEach(function(){\n mixer = [];\n song = new Howl({\n urls:... | javascript | new_file | 0 | 1 | mit | ad030be7e8cbdbc6817d2b9436317a255687e7c3 | chi-bobolinks-2015/TheGoldenRecord,chi-bobolinks-2015/TheGoldenRecord,chi-bobolinks-2015/TheGoldenRecord | spec/javascripts/mixerSpec.js | accepted | null | true |
[
{
"role": "user",
"content": "Write javascript code for the following: Add master run file to repo. Oops."
},
{
"role": "assistant",
"content": "(function () {\n function run () {\n \n // (reads from quizServer.cfg and mypwd.txt)\n var config = require('./lib/config').conf... | javascript | new_file | 0 | 3 | unlicense | 754b5d1d5c6695cc944448bcb3336f8042b7e442 | fbennett/newswriter | newswriter.js | accepted | null | true |
[
{
"role": "user",
"content": "Write javascript code for the following: tests: Add tests for prompt options module"
},
{
"role": "assistant",
"content": "var chai = require('chai');\nvar expect = chai.expect;\n\nvar promptOptionsModule = require('../../bin/promptOptions')();\n\nchai.should();\n\n... | javascript | new_file | 0 | 1 | mit | 2c091531f153b8d6b4a0d6d91fd351483030a1f8 | code-computerlove/quarry,cartridge/cartridge-cli,code-computerlove/slate-cli | test/cli/promptOptionsSpec.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nconst Card = require('./card.js');\n\nclass Deck {\n constructor() {\n this.cards = [];\n for (let suit of Card.Suits()) {\n for (let rank of Card.Ranks()) {\n let card = new Card(rank, suit);\n this.cards.push... | javascript | edit | 0 | 3 | mit | 332f393ac7527800036ca24bf5b76d84af531a41 | stvvan/slack-poker-bot,bdthinh/slack-poker-bot,CharlieHess/slack-poker-bot,rodrigomonteiro/slack-poker-bot,codevlabs/slack-poker-bot,sqlbyme/slack-poker-bot,jbomotti/slack-poker-bot,Andrey-Pavlov/slack-poker-bot,tim-mc/slack-poker-bot,bitzesty/slack-poker-bot,ysterp/poker,A-w-K/slack-poker-bot,Th3Mouk/slack-poker-bot,s... | src/deck.js | accepted | null | true |
[
{
"role": "user",
"content": "Write javascript code for the following: Write the second version of \"Fizz Buzz.\"\n\nThis version handles all the cases in the actual game:\n\n* Print \"FizzBuzz\" if the value is evenly divisible by both 3 and 5\n* Print \"Fizz\" if the value is evenly divisible by 3\n* Prin... | javascript | new_file | 0 | 0 | apache-2.0 | d8b89e1d4bd4b6c0b58b3804f9b3502f9f80a5eb | mrwizard82d1/eloquent-js | ch02/fizz_buzz_2.js | accepted | null | true |
[
{
"role": "user",
"content": "Write javascript code for the following: Add project team stats on learning Object section"
},
{
"role": "assistant",
"content": "const team = {\n _players:[\n {\n firstName: 'Cristiano',\n lastName: 'Ronaldo',\n age: 36\n },\n ... | javascript | new_file | 0 | 1 | apache-2.0 | ad3b613fc3eeb800a4c2a9d5f51d35debb9871c9 | SpAiNiOr/mystudy,SpAiNiOr/mystudy,SpAiNiOr/mystudy | learning/javascript/TeamStats.js | accepted | null | true |
[
{
"role": "user",
"content": "Write javascript code for the following: Add story for bookmarklet component"
},
{
"role": "assistant",
"content": "import React from 'react'\nimport { storiesOf } from '@storybook/react'\n\nimport Specimen from 'v2/stories/__components__/Specimen'\n\nimport Bookmar... | javascript | new_file | 0 | 1 | mit | de4a7ee9cb31e257a3fe5ceb494586b19a412ba2 | aredotna/ervell,aredotna/ervell,aredotna/ervell,aredotna/ervell,aredotna/ervell | src/v2/stories/Bookmarklet.stories.js | accepted | null | true |
[
{
"role": "user",
"content": "Write javascript code for the following: Add working draft of a saving scenario"
},
{
"role": "assistant",
"content": "'use strict';\n\n//https://github.com/angular/protractor/blob/master/docs/api.md\n//GetAttribute() returns \"boolean\" values and will return eithe... | javascript | new_file | 0 | 1 | apache-2.0 | ee3e4a943a7077547af7dffcb12c4c42b613efcb | 28msec/nolap-report-editor | tests/e2e/saving-scenario_.js | accepted | null | true |
[
{
"role": "user",
"content": "Write javascript code for the following: Add a variation on the Angular UI Bootstrap code which keeps the dropdown open as long as the clicks are inside the menu"
},
{
"role": "assistant",
"content": "/**\n * Enhances the angular bootstrap directive to allow it to s... | javascript | new_file | 0 | 3 | bsd-3-clause | 8bab3396c6e13326d8aba4e31adac88d4f310399 | trestle-pm/trestle | src/common/bootstrap/bootstrap.js | accepted | null | true |
[
{
"role": "user",
"content": "Write javascript code for the following: Update as Day 10 Customer Model"
},
{
"role": "assistant",
"content": "'use strict';\n\n/**\n * Module dependencies.\n */\nvar mongoose = require('mongoose'),\n\tSchema = mongoose.Schema;\n\n/**\n * Customer Schema\n */\nvar ... | javascript | new_file | 0 | 0 | mit | 8ee1550f8931410495e329d04a3b6bd71a462e1f | cheshiret/myMeanProject,cheshiret/myMeanProject,cheshiret/myMeanProject | app/models/customer.server.model.js | accepted | null | true |
[
{
"role": "user",
"content": "Write javascript code for the following: Create JS Olympics file for 7.6"
},
{
"role": "assistant",
"content": "/*\n\n PEER PARING CHALLENGE 7.6: JAVASCRIPT OLYMPICS\n\n WE PAIRED ON THIS CHALLENGE: Becca Nelson & Lars Johnson\n THIS CHALLENGE TOOK US: ___ Hours\... | javascript | new_file | 0 | 0 | mit | ad1dde3af5b710077ce07d450d92f86762b70da0 | larsjx/phase-0,larsjx/phase-0,larsjx/phase-0 | week-7/javascript_olympics.js | accepted | null | true |
[
{
"role": "user",
"content": "Write javascript code for the following: Add test coverage for actions"
},
{
"role": "assistant",
"content": "import * as actions from '../tasks';\n\ndescribe('Task Actions', () => {\n let defaultId,\n defaultTask;\n\n beforeEach(() => {\n defaul... | javascript | new_file | 0 | 1 | mit | cb260529a8585a8a5e34ff7962602e560be08e39 | CarlaCrandall/DoItNow,CarlaCrandall/DoItNow,CarlaCrandall/DoItNow | app/actions/__tests__/tasks.js | accepted | null | true |
[
{
"role": "user",
"content": "Write javascript code for the following: Add tests for `ref` :)"
},
{
"role": "assistant",
"content": "import { h, render, Component } from '../../src/preact';\n/** @jsx h */\n\ndescribe('refs', () => {\n\tlet scratch;\n\n\tbefore( () => {\n\t\tscratch = document.cr... | javascript | new_file | 0 | 2 | mit | c0304dcb326316638c41c209b76409e1853a8230 | neeharv/preact,developit/preact,gogoyqj/preact,neeharv/preact,developit/preact | test/browser/refs.js | accepted | null | true |
[
{
"role": "user",
"content": "Write javascript code for the following: Add tests for path module."
},
{
"role": "assistant",
"content": "var path = require(\"path\");\nprocess.mixin(require(\"./common\"));\n\nvar f = __filename;\n\nassert.equal(path.basename(f), \"test-path.js\");\nassert.equal(... | javascript | new_file | 0 | 1 | apache-2.0 | 988174a6294ab863be2961267174901440100944 | dreamllq/node,dreamllq/node,dreamllq/node,dreamllq/node,dreamllq/node,dreamllq/node,isaacs/nshtools,dreamllq/node,dreamllq/node,dreamllq/node | test/mjsunit/test-path.js | accepted | null | true |
[
{
"role": "user",
"content": "Write javascript code for the following: Create exports folder for namespacing imports/exports."
},
{
"role": "assistant",
"content": "import {\n Asset,\n BondBase,\n BondCorporate,\n BondGovernment,\n BondMortgage,\n Currency,\n CustomAsset,\n Derivative,\n... | javascript | new_file | null | null | apache-2.0 | d9350a3749a7d33a425c3f5f499984ff52c8690b | amaas-fintech/amaas-core-sdk-js | src/exports/assets.js | rejected_code_smell | Internal duplication: ~318% of the file is inside repeated 12+ line blocks | null |
[
{
"role": "user",
"content": "Write javascript code for the following: Create test file for cache."
},
{
"role": "assistant",
"content": "module.exports = {\n setUp: function (callback) {\n var path = require('path');\n\n this.cache = require('../lib/utils/cache');\n this... | javascript | new_file | 0 | 1 | mit | 5470155907b3c85417b63e92e7b2d9c7c04690fc | Solid-Interactive/grasshopper-api-js,Solid-Interactive/grasshopper-api-js | test/test-api-util-cache.js | accepted | null | true |
[
{
"role": "user",
"content": "Write javascript code for the following: Add mock mixin for Polymer.IronFitBehavior\n\nPolymer.IronFitBehavior doesn't have a mixin and should be added to\ncomponent using Polymer.mixinBehavior([Polymer.IronFitBehavior]).\nPolymer linter doesn't process this correctly. To worka... | javascript | new_file | 0 | 1 | apache-2.0 | 1017054e95ecb84155c54102705f8570e0199a49 | GerritCodeReview/gerrit,GerritCodeReview/gerrit,GerritCodeReview/gerrit,GerritCodeReview/gerrit,GerritCodeReview/gerrit,GerritCodeReview/gerrit,GerritCodeReview/gerrit,GerritCodeReview/gerrit | polygerrit-ui/app/types/polymer-behaviors.js | accepted | null | true |
[
{
"role": "user",
"content": "Write javascript code for the following: Add Physics placeholder. Planned to be implemented soon."
},
{
"role": "assistant",
"content": "/**\n * @module Joy.Behaviour\n */\n(function(J) {\n /**\n * TODO: Wouldn't it be nice?\n */\n var Physics = J.Behaviour.ex... | javascript | new_file | 0 | 1 | mit | 2060d39c9d2690095ce5520ea0cf25bad1015c70 | royquintanar/joy.js,endel/joy.js,royquintanar/joy.js | lib/core/behaviour/physics.js | accepted | null | true |
[
{
"role": "user",
"content": "Write javascript code for the following: Test for multiple addBatch() calls"
},
{
"role": "assistant",
"content": "// test-multiple-batch.js -- Multiple calls to addBatch()\n//\n// Copyright 2016 fuzzy.ai <<EMAIL>>\n//\n// Licensed under the Apache License, Version ... | javascript | new_file | 0 | 1 | apache-2.0 | 6d435c7da8a100b1520d0aedbb1974f0f41ee84f | vowsjs/vows,fuzzy-ai/perjury | test/test-multiple-batch.js | accepted | null | true |
[
{
"role": "user",
"content": "Write javascript code for the following: Add initial tests for inView.offset"
},
{
"role": "assistant",
"content": "import test from 'ava';\nimport inView from '../src/in-view';\n\ntest('inView.offset returns the offset', t => {\n t.true(inView.offset(50) === 50)... | javascript | new_file | 0 | 1 | mit | efdf64567548a52776c29f432911fce1a78a9bf5 | kudago/in-view,camwiegert/in-view | test/in-view.offset.spec.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n'use strict';\n\nmodule.exports = {\n name: 'trailingSemicolon',\n nodeTypes: ['rule', 'atrule'],\n message: 'All property declarations should end with a semicolon.',\n\n lint: function trailingSemicolonLinter (config, node)... | javascript | edit | 0 | 6 | mit | 6088dceecde8bd76c02bc3860b17e3d4ba932289 | JoshuaKGoldberg/lesshint,runarberg/lesshint,lesshint/lesshint | lib/linters/trailing_semicolon.js | accepted | null | true |
[
{
"role": "user",
"content": "Write javascript code for the following: Update project require-css to 0.1.8"
},
{
"role": "assistant",
"content": "define(function(){if(\"undefined\"==typeof window)return{load:function(e,t,n){n()}};var e=document.getElementsByTagName(\"head\")[0],t=window.navigato... | javascript | new_file | 0 | 5 | mit | ba5cb655163ee7e2f646f0716ba3e9125567156b | fchasen/jsdelivr,RoberMac/jsdelivr,jtblin/jsdelivr,firulais/jsdelivr,labsvisual/jsdelivr,bdukes/jsdelivr,stevelacy/jsdelivr,vousk/jsdelivr,dpellier/jsdelivr,RoberMac/jsdelivr,ajibolam/jsdelivr,anilanar/jsdelivr,cake654326/jsdelivr,yaplas/jsdelivr,dnbard/jsdelivr,wallin/jsdelivr,CTres/jsdelivr,ndamofli/jsdelivr,ajkj/jsd... | files/require-css/0.1.8/css.min.js | accepted | null | true |
[
{
"role": "user",
"content": "Write javascript code for the following: Add temporary simple LED button"
},
{
"role": "assistant",
"content": "var MeshbluSocketIO = require('meshblu');\nvar SerialPort = require('serialport');\nvar tinycolor = require('tinycolor2');\n\nvar cfg = require('./meshblu... | javascript | new_file | 0 | 8 | mit | de3d1a3c4cfbabc50e24c4acad51822daa7476e8 | jamesbulpin/meshblu-connector-ledbutton | fakehue/simplebutton.js | accepted | null | true |
[
{
"role": "user",
"content": "Write javascript code for the following: chore: Create function that merge 2 arrays"
},
{
"role": "assistant",
"content": "//function to combine two one dimensional arrays to one\n\nfunction array_merge2(arr1, arr2) {\n\treturn arr1.concat(arr2);\n}\n\nconsole.log(a... | javascript | new_file | 0 | 1 | mit | e3f3e344eef2dadf3781a54d0fad7231d7e20ec0 | divyanshu-rawat/Basic-JS-Algorithms | array/array_merge2.js | accepted | null | true |
[
{
"role": "user",
"content": "Write javascript code for the following: Add tests for the Scrollbar component"
},
{
"role": "assistant",
"content": "import React from 'react';\nimport { mount } from 'enzyme';\nimport Scrollbar from '../../../src/components/Scrollbar/Scrollbar';\n\ndescribe('<Scro... | javascript | new_file | 0 | 1 | mit | dce6f6ba0af831253b4351dd99735b3a28692335 | whawker/react-jsx-highcharts,AlexMayants/react-jsx-highcharts,whawker/react-jsx-highcharts,AlexMayants/react-jsx-highcharts | test/components/Scrollbar/Scrollbar.spec.js | accepted | null | true |
[
{
"role": "user",
"content": "Write javascript code for the following: Add YoutubeTrack class to represent a youtube track For future soundcloud support."
},
{
"role": "assistant",
"content": "var ytdl = require('ytdl-core');\n\nmodule.exports = YoutubeTrack = function(vid, cb) {\n var _this = ... | javascript | new_file | 0 | 2 | mit | 4bbc2eefe6a89f38a5cf2b21a757acc86047b010 | meew0/Lethe | lib/youtube-track.js | accepted | null | true |
[
{
"role": "user",
"content": "Write javascript code for the following: Add a github release upload script"
},
{
"role": "assistant",
"content": "\"use strict\"\n\nlet version = process.argv[2]\nlet auth = process.argv[3]\n\nif (!auth) {\n console.log(\"Usage: upload-release.js [TAG] [github-use... | javascript | new_file | 0 | 2 | mit | 14f9ee8730d2acfdc74a4963b1e1a8ea3f5ef47e | dperetti/CodeMirror,bfrohs/CodeMirror,xeronith/CodeMirror,codio/CodeMirror,hackmdio/CodeMirror,alur/CodeMirror,Jisuanke/CodeMirror,SidPresse/CodeMirror,vincentwoo/CodeMirror,wingify/CodeMirror,pabloferz/CodeMirror,MarcelGerber/CodeMirror,INTELOGIE/CodeMirror,alur/CodeMirror,dperetti/CodeMirror,jayaprabhakar/CodeMirror,... | bin/upload-release.js | accepted | null | true |
[
{
"role": "user",
"content": "Write javascript code for the following: Add pairs with given difference"
},
{
"role": "assistant",
"content": "const test = require('tape')\n\n/**\n * Given an array arr of distinct integers and a nonnegative integer k,\n * write a function that returns an array of... | javascript | new_file | 0 | 5 | mit | f6b2e366048308c44de85eb573417d9d12472974 | ayastreb/cs101 | src/Problems/PairsWithDifferenceK.js | accepted | null | true |
[
{
"role": "user",
"content": "Write javascript code for the following: Add script to pull piwik data, inject into posts"
},
{
"role": "assistant",
"content": "var superagent = require('superagent');\nvar _ = require('lodash');\nvar fs = require('fs');\nvar path = require('path');\nvar frontMatte... | javascript | new_file | 0 | 4 | mit | f5b2b81e1b87583f54ecc6b3578e072205566875 | scottnonnenberg/blog,scottnonnenberg/blog,scottnonnenberg/blog | popular_posts.js | accepted | null | true |
[
{
"role": "user",
"content": "Write javascript code for the following: Create new timeslot with ajax call"
},
{
"role": "assistant",
"content": "$(document).ready(function(){\n\n $(\"#new-timeslot-form\").submit(function(event){\n event.preventDefault();\n var data = createDate();\n $(... | javascript | new_file | 0 | 1 | mit | 001cacd3ddc41e01f230da17562d1c51835f7cb8 | theresaboard/theres-a-board,theresaboard/theres-a-board,theresaboard/theres-a-board | app/assets/javascripts/new_timeslot.js | accepted | null | true |
[
{
"role": "user",
"content": "Write javascript code for the following: Add field component tests on tags."
},
{
"role": "assistant",
"content": "describe('Test the field component', function() {\n\n /**\n * Get the textarea component\n */\n function getFieldComponent(field) {\n ... | javascript | new_file | 0 | 1 | mit | 1d0b3c7cb45be76fe7002a6f428373606e24e192 | IDCI-Consulting/ExtraFormBundle,IDCI-Consulting/ExtraFormBundle | Resources/public/js/tests/fieldTest.js | accepted | null | true |
[
{
"role": "user",
"content": "Write javascript code for the following: Add script for lessee reservation list"
},
{
"role": "assistant",
"content": "$(document).ready(function() {\n\t$('#reservation-table').DataTable({});\n}); \n\n$('.btn-cancel').on('click', function() {\n\tif (confirm('Are you... | javascript | new_file | 0 | 2 | mit | f4a490fcbe4d751a6ef64c4e5a0ffe4c4919bea4 | gctomakin/renTRMNL,gctomakin/renTRMNL,gctomakin/renTRMNL | assets/js/pages/lessees/reservations.js | accepted | null | true |
[
{
"role": "user",
"content": "Write javascript code for the following: Test for mark as fav"
},
{
"role": "assistant",
"content": "var expect = chai.expect;\n\ndescribe('markAsFavouriteService', function () {\n\n\t// console.log(angular.module('APP'))\n\tvar $httpBackend;\n\n\t// var APP;\n\tvar... | javascript | new_file | 0 | 1 | mit | 821ff82302228712ce5eea057b5437074cd722c1 | sporto/devtalks.net | test/client/modules/videos/mark_as_favourite_spec.js | accepted | null | true |
[
{
"role": "user",
"content": "Write javascript code for the following: Add command to get the hash of the git commit that is currently being run"
},
{
"role": "assistant",
"content": "var exec = require('child_process').exec;\n\nvar hash;\n\nmodule.exports.init = function(b) {\n\texec('git rev-p... | javascript | new_file | 0 | 2 | mit | c043ca4b069b8e50bc892fdb3c113232c6ddeb8a | euank/EuIrcBot,LinuxMercedes/EuIrcBot,gmackie/EuIrcBot,brhoades/EuIrcBot,brhoades/EuIrcBot,gmackie/EuIrcBot,euank/EuIrcBot,LinuxMercedes/EuIrcBot | modules/version.js | accepted | null | true |
[
{
"role": "user",
"content": "Write javascript code for the following: Create container for SignUpForm component"
},
{
"role": "assistant",
"content": "import React, { Component } from 'react';\nimport logo from '../../public/images/logo.png';\nimport PageFooter from '../PageFooter';\nimport Sig... | javascript | new_file | 0 | 4 | mit | 33b7b330687c4daa4e04ffe1e4d0e23b942673c6 | amarachukwu-agbo/hello-books,amarachukwu-agbo/hello-books | client/components/SignUp/SignUpPage.js | accepted | null | true |
[
{
"role": "user",
"content": "Write javascript code for the following: Complete 'Reject a promise' challenge in 'Promise it won't hurt' tutorial"
},
{
"role": "assistant",
"content": "var q = require('q');\nvar deferred = q.defer();\ndeferred.promise.then(null, function(err) {\n console.log(err... | javascript | new_file | 0 | 1 | mit | 1e7390448d7cd39522d122205e917f61438e7ba4 | PaoloLaurenti/nodeschool | promise-it-wont-hurt/reject-a-promise.js | accepted | null | true |
[
{
"role": "user",
"content": "Write javascript code for the following: Add some common HTTP error helpers"
},
{
"role": "assistant",
"content": "function httpError ( message, code ) {\n\n var err = new Error( message );\n err.status = code;\n\n return err;\n\n}\n\n\nexports.system = fun... | javascript | new_file | 0 | 1 | mit | 8ae7a077b9d64d6c9775ae7833a1c822801b3605 | projectweekend/express-classy | lib/errors.js | accepted | null | true |
[
{
"role": "user",
"content": "Write javascript code for the following: Add preview how we're going to organize as ES6 module"
},
{
"role": "assistant",
"content": "// note we can also import/export in CS2\n\n// fragment.js\n\nfunction replace() {\n}\n\nfunction extract() {\n}\n\nfunction three(... | javascript | new_file | 0 | 1 | mit | bf8e163558e88261e82323a15a4f42e4c6f4717f | unpoly/unpoly,unpoly/unpoly,unpoly/unpoly | design/es6.js | accepted | null | true |
[
{
"role": "user",
"content": "Write javascript code for the following: Add end-to-end tests for autocomplete"
},
{
"role": "assistant",
"content": "module.exports = {\n 'Should autocomplete words on home page': function (browser) {\n browser\n .url('http://localhost:8000/')\n .wait... | javascript | new_file | 0 | 1 | mit | 8fc5f419460926efb1a7d59d0c8249bf422c9180 | TheScienceMuseum/collectionsonline,TheScienceMuseum/collectionsonline | test/client/autocomplete.clienttest.js | accepted | null | true |
[
{
"role": "user",
"content": "Write javascript code for the following: Add customised asciimath plugin library for webpack"
},
{
"role": "assistant",
"content": "/**\n * Code were taken from https://github.com/quertt/markdown-it-asciimath\n * and modified for use with webpack, since the original... | javascript | new_file | 0 | 3 | mit | 191894db5c4bf0f9fa8e2c9a16e8bbd878e13d54 | nus-mtp/sashimi-note,nus-mtp/sashimi-note,nus-mtp/sashimi-note | sashimi-webapp/src/logic/documentPackager/markdown-it-asciimath.js | accepted | null | true |
[
{
"role": "user",
"content": "Write javascript code for the following: Add initial module definition boilerplate\n\nThe module definition supports both AMD and browser globals."
},
{
"role": "assistant",
"content": "(function (root, factory) {\n if (typeof define === 'function' && define.amd)... | javascript | new_file | 0 | 3 | mit | b437a1c89693af0aca0b0ad8c65aeefc1b9b4c19 | vgno/ably | src/ably.js | accepted | null | true |
[
{
"role": "user",
"content": "Write javascript code for the following: Add tests for parseCommand function"
},
{
"role": "assistant",
"content": "import { parseCommand, Spreadsheet } from './models';\n\ndescribe('parseCommand', () => {\n const ast = parseCommand('A0 = A1 + A2');\n\n it('parses... | javascript | new_file | 0 | 1 | mit | 505c07875d7a81f054a8d8cf6509a2170f1bc83c | schultyy/spreadsheet,schultyy/spreadsheet | src/models.spec.js | accepted | null | true |
[
{
"role": "user",
"content": "Write javascript code for the following: Add failing test for Plotband.Label updating together with axis"
},
{
"role": "assistant",
"content": "import React from 'react';\nimport Highcharts from 'highcharts';\nimport {\n HighchartsChart,\n Debug,\n HighchartsProv... | javascript | new_file | 0 | 1 | mit | b9cf17a63c0a0584b4150bcd9cf98a16936e6afe | whawker/react-jsx-highcharts,whawker/react-jsx-highcharts | packages/react-jsx-highcharts/test/components/PlotBandLine/PlotBandLineLabel.integration.spec.js | accepted | null | true |
[
{
"role": "user",
"content": "Write javascript code for the following: Add test for the common function"
},
{
"role": "assistant",
"content": "var helper = require('../helper')\n , expect = require('chai').expect;\n\ndescribe('orchestrate.io/common', function () {\n describe('.merge', function... | javascript | new_file | 0 | 1 | mit | 2ada54d87b87302013c67b5e864dc05431a13060 | giraffi/node-orchestrate.io | test/orchestrate.io/common-test.js | accepted | null | true |
[
{
"role": "user",
"content": "Write javascript code for the following: chore(docs): Add script to publish docs to ui-router.github.io"
},
{
"role": "assistant",
"content": "#!env node\n\nlet package = require('../package.json').name;\nlet version = require('../package.json').version;\n\nlet core... | javascript | new_file | 0 | 0 | mit | c8b7743ca97145c6b0691788d80d9cca8af8bdc5 | ui-router/ng2,wawyed/ng2,ui-router/angular,ui-router/ng2,ui-router/angular,wawyed/ng2,ui-router/angular,ui-router/angular,wawyed/ng2 | scripts/publishdocs.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n/**\n * Widget Header Directive\n */\n\nangular\n .module('RDash')\n .directive('rdWidgetHeader', rdWidgetTitle);\n\nfunction rdWidgetTitle() {\n var directive = {\n requires: '^rdWidget',\n scope: {\n ... | javascript | edit | 0 | 1 | mit | b4ae4fcb5e2880e6594be63dc72bbab27c4f81aa | jlengwork/rdash-angular,mkosuri/RP,ksiabani/rdash-angular,ksiabani/rdash-angular,NamithaNinan/SEVAWebsite,ahluis/1E-test,jasonmelgoza/Responsive-Dashboard,noahcooper/rdash-angular,RickyDan/rdash-angular,noahcooper/rdash-angular,tbaker0815/upwork_project,maxamillion32/rdash-angular,igorcarlospulini/igorcarlospulini.gith... | src/js/directives/widget-header.js | rejected_duplicate | Near-duplicate of sample 104146 | true |
[
{
"role": "user",
"content": "Write javascript code for the following: Test environment instrumentation: tiny script to modify a value in memcached that will trigger test starts."
},
{
"role": "assistant",
"content": "var Memcached = require('memcached');\nvar KeyGen = require('./mcKeyGenerator.... | javascript | new_file | 0 | 1 | apache-2.0 | 8ac7634543bb11b67ebdc0efbd0de85b333cc0fa | santiagocasti/collab,santiagocasti/collab,santiagocasti/collab,santiagocasti/collab | components/serverSide/triggerTestStart.js | accepted | null | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.