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 a skeletal pdf generation file"
},
{
"role": "assistant",
"content": "const fs = require('fs');\n\nconst PDFDocument = require('pdfkit');\n\nvar doc = new PDFDocument();\ndoc.pipe(fs.createWriteStream('templates/resour... | javascript | new_file | 0 | 0 | mit | 894ca9adcb73e6f799aa6e1ca4bb59ba3ea45166 | Balletboetiek/website,Balletboetiek/website,Balletboetiek/website | src/create-schedule.js | accepted | null | true |
[
{
"role": "user",
"content": "Write javascript code for the following: Create a module for commonly needed sample functionality."
},
{
"role": "assistant",
"content": "module.exports = function(r) {\n return {\n removeUnusedSamples\n };\n\n function* removeUnusedSamples(sampleIds... | javascript | new_file | 0 | 3 | mit | 5135bd1a50894c11f09cc982f0f140222fe0d691 | materials-commons/materialscommons.org,materials-commons/materialscommons.org,materials-commons/materialscommons.org,materials-commons/materialscommons.org,materials-commons/materialscommons.org | backend/servers/mcapi/db/model/sample-common.js | accepted | null | true |
[
{
"role": "user",
"content": "Write javascript code for the following: Create a context for configuring vertical spacing of <List>"
},
{
"role": "assistant",
"content": "// #FIXME: use React navive context API when upgraded to v16+\nimport createReactContext from 'create-react-context';\n\nconst... | javascript | new_file | 0 | 0 | apache-2.0 | d8eb90edcf34e1c15cf862eece8fef831f10c105 | iCHEF/gypcrete,iCHEF/gypcrete | packages/core/src/contexts/listSpacing.js | accepted | null | true |
[
{
"role": "user",
"content": "Write javascript code for the following: Add test for throwing on bad `this`\n\nFixes @caitp's review comment at https://codereview.chromium.org/771863002/diff/60001/test/mjsunit/harmony/array-includes-to-object.js."
},
{
"role": "assistant",
"content": "// Copyrigh... | javascript | new_file | 0 | 1 | bsd-2-clause | 058ec9922c74ee76837b0a91bf5e4b85a7ac07e2 | tc39/Array.prototype.includes,tc39/Array.prototype.includes,tc39/Array.prototype.includes | test/exception-bad-this.js | accepted | null | true |
[
{
"role": "user",
"content": "Write javascript code for the following: Add a new exit strategy, calling window.open() before window.close(), as a workaround for LG devices that do not currently allow window.close() if the current window was not opened by a script."
},
{
"role": "assistant",
"con... | javascript | new_file | 0 | 1 | apache-2.0 | 4295d68d536a8f9597cae00f932170523e4b89c0 | ZeboFranklin/tal,joeyjojo/tal,ZeboFranklin/tal,joeyjojo/tal,joeyjojo/tal,ZeboFranklin/tal,ZeboFranklin/tal,joeyjojo/tal,joeyjojo/tal,ZeboFranklin/tal | static/script/devices/exit/openclosewindow.js | accepted | null | true |
[
{
"role": "user",
"content": "Write javascript code for the following: Add test to check we can restrict alg when PEM is used"
},
{
"role": "assistant",
"content": "\n\ndescribe('pem-as-hmac-key', function ()\n{\n var token;\n\n before(function ()\n {\n // generate HS256 token us... | javascript | new_file | 0 | 1 | mit | 6dc3d5db2efcd632b0a46f86394408aefe868967 | davedoesdev/node-jsjws,davedoesdev/node-jsjws,davedoesdev/node-jsjws | test/pem_as_hmac_key_spec.js | accepted | null | true |
[
{
"role": "user",
"content": "Write javascript code for the following: Add a sample of Terminail.app mouse events"
},
{
"role": "assistant",
"content": "#!/usr/bin/env node\n\n//\n// Can Terminal.app (Mac OS X) accept mouse events?\n//\n// * click needs \"Option\" pressing\n//\n\nconsole.log('St... | javascript | new_file | 0 | 2 | mit | 823b15e51314bf335a50d775d0e5399f489c5066 | kjirou/nodejs-codes | examples/_mac-terminal-app/index.js | accepted | null | true |
[
{
"role": "user",
"content": "Write javascript code for the following: Add placeholder fallback for older browsers."
},
{
"role": "assistant",
"content": "// Placeholder fallback for browsers that don't support it.\n//\n// Requirements:\n// Modernizr\n//\n// Instructions:\n// 1. Require sencha_b... | javascript | new_file | 0 | 3 | mit | 8dcdaa48cf23a5fec53013b4af63a29fc4d786d2 | jvcanote/SenchaBase,hypertiny/SenchaBase,hypertiny/SenchaBase,jvcanote/SenchaBase,hypertiny/SenchaBase,jvcanote/SenchaBase | app/assets/javascripts/sencha_base/placeholder_fallback.js | accepted | null | true |
[
{
"role": "user",
"content": "Write javascript code for the following: Add helper to start protractor"
},
{
"role": "assistant",
"content": "var q = require('q');\nvar childProcess = require('child_process');\n\nvar CLI_PATH = 'node /Users/andresdom/dev/protractor/lib/cli.js ' +\n '--elementE... | javascript | new_file | 0 | 2 | mit | 86ab0e203fb62f1d3b1e13445966f72567f6cbd8 | andresdominguez/elementor,andresdominguez/elementor | bin/cliHelper.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nimport React, { PropTypes } from 'react';\nimport { BootstrapTable, TableHeaderColumn } from 'react-bootstrap-table';\nimport BSTyle from 'react-bootstrap-table/dist/react-bootstrap-table.min.css';\n\nexport default class ManageSubscrib... | javascript | edit | 0 | 2 | bsd-3-clause | c86b7b6126ce716d8ff685c1dd105ed660054ac9 | zhakkarn/Mail-for-Good,zhakkarn/Mail-for-Good,karuppiah7890/Mail-for-Good,zhakkarn/Mail-for-Good,karuppiah7890/Mail-for-Good,karuppiah7890/Mail-for-Good | client/components/lists/ManageSubscribersTable.js | accepted | null | true |
[
{
"role": "user",
"content": "Write javascript code for the following: Add module 2 work out project slug from project id"
},
{
"role": "assistant",
"content": "var rest = require('./rest');\n\n/**\n * Fetches a project by project id, then fetches its project slug for use\n * when working with t... | javascript | new_file | 0 | 1 | mit | 5acf747c9025491ab5198dc80a5b0c13c2e568ac | mediasuitenz/node-activecollab | projectSlug.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n// Spectrum Colorpicker\n// French (fr) localization\n// https://github.com/bgrins/spectrum\n\n(function ( $ ) {\n\n var localization = $.spectrum.localization[\"fr\"] = {\n cancelText: \"Annuler\",\n chooseText: \"Vali... | javascript | edit | 0 | 1 | mit | eaa48afb8c904527c71a7953d037133b92e90015 | bgrins/spectrum,ajssd/spectrum,bgrins/spectrum,ginlime/spectrum,GerHobbelt/spectrum,safareli/spectrum,armanforghani/spectrum,kotmatpockuh/spectrum,shawinder/spectrum,GerHobbelt/spectrum,maurojs25/spectrum,kotmatpockuh/spectrum,liitii/spectrum,safareli/spectrum,maurojs25/spectrum,c9s/spectrum,armanforghani/spectrum,ginl... | i18n/jquery.spectrum-fr.js | accepted | null | true |
[
{
"role": "user",
"content": "Write javascript code for the following: Add @jmcarp filerevision ko model from osfstorage"
},
{
"role": "assistant",
"content": "'use strict';\n\nvar ko = require('knockout');\nrequire('knockout-punches');\nvar $ = require('jquery');\nvar $osf = require('osfHelpers... | javascript | new_file | 0 | 2 | apache-2.0 | 111688be26d8647ca3c2a42633007f9e298ff2d7 | felliott/osf.io,pattisdr/osf.io,lyndsysimon/osf.io,kushG/osf.io,lamdnhan/osf.io,kushG/osf.io,bdyetton/prettychart,DanielSBrown/osf.io,barbour-em/osf.io,caseyrollins/osf.io,GaryKriebel/osf.io,doublebits/osf.io,cslzchen/osf.io,abought/osf.io,cldershem/osf.io,amyshi188/osf.io,dplorimer/osf,RomanZWang/osf.io,zachjanicki/os... | website/static/js/fileRevisions.js | accepted | null | true |
[
{
"role": "user",
"content": "Write javascript code for the following: Add library for converting slot IDs from/to NBT format"
},
{
"role": "assistant",
"content": "module.exports = { fromNBT, toNBT };\n\nconst replace = {\n \"100\": 8, \"101\": 7, \"102\": 6, \"103\": 5, \"-106\": 45\n}\n\nfun... | javascript | new_file | 0 | 4 | mit | 1c8dd493e796d7b576e4b1b09e8415306a6ab1b6 | mhsjlw/flying-squid,demipixel/flying-squid,PrismarineJS/flying-squid | src/lib/convertInventorySlotId.js | accepted | null | true |
[
{
"role": "user",
"content": "Write javascript code for the following: Add button that moves the collaborator from one collaborator type (uid arr) to the other."
},
{
"role": "assistant",
"content": "import React from 'react';\n\nimport app from '../Firebase';\nimport Button from 'react-bootstra... | javascript | new_file | 0 | 2 | apache-2.0 | 91564336b9e0dc02bf0025b90e15c34801b20fbe | googleinterns/SLURP,googleinterns/SLURP,googleinterns/SLURP | frontend/src/components/ViewTrips/change-collaborator-type-button.js | accepted | null | true |
[
{
"role": "user",
"content": "Write javascript code for the following: feat(worker-example): Add code to run on the main thread for Dedicated Worker example"
},
{
"role": "assistant",
"content": "const input = document.getElementById(\"input-message\");\nconst output = document.getElementById(\"... | javascript | new_file | 0 | 2 | mit | e1fa882726ce18c9a9fb4092d8663d33b75ad96a | Velenir/workers-journey,Velenir/workers-journey | app/marked/Dedicated/script.js | accepted | null | true |
[
{
"role": "user",
"content": "Write javascript code for the following: Add the example to use moment to set a full time with utc."
},
{
"role": "assistant",
"content": "var moment = require('moment');\n\nconsole.log(moment(\"2014-12-11 21+0800\").format()); \nconsole.log(moment(\"2014-W50-4 21+0... | javascript | new_file | 0 | 0 | mit | 80ad17a9ce1223e19fd0be5cbfa5bd901a40ecb8 | nicebook/Node.js-Reference,nicebook/Node.js-Reference,nicebook/Node.js-Reference | 3/moment-setfulltime_utc.js | accepted | null | true |
[
{
"role": "user",
"content": "Write javascript code for the following: Add getting started example to the repo"
},
{
"role": "assistant",
"content": "\n\n/* Outside of this project, change to:\n *\n * const SBOLDocument = require('sboljs')\n */\nconst SBOLDocument = require('../lib/SBOLDocumen... | javascript | new_file | 0 | 0 | bsd-2-clause | 99dd1d8abc174cb8682958ad1bd9138989c8a6c4 | ICO2S/sboljs,ICO2S/sboljs | examples/getting-started.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n/* jshint node: true */\n\nmodule.exports = function(environment) {\n var ENV = {\n modulePrefix: '<%= modulePrefix %>',\n environment: environment,\n baseURL: '/',\n locationType: 'auto',\n EmberENV: {\n FEATURES: ... | javascript | edit | 0 | 4 | mit | 225e53a1f6de6d23f3db5e4efb738e63621d7146 | martndemus/ember-cli,EricSchank/ember-cli,buschtoens/ember-cli,searls/ember-cli,mike-north/ember-cli,coderly/ember-cli,yaymukund/ember-cli,fpauser/ember-cli,mschinis/ember-cli,seanpdoyle/ember-cli,joaohornburg/ember-cli,nathanhammond/ember-cli,princeofdarkness76/ember-cli,fpauser/ember-cli,Restuta/ember-cli,csantero/em... | blueprints/app/files/config/environment.js | rejected_duplicate | Near-duplicate of sample 69089 | true |
[
{
"role": "user",
"content": "Write javascript code for the following: Add tests for marker store"
},
{
"role": "assistant",
"content": "\"use babel\";\n\nimport { Range } from \"atom\";\n\nimport MarkerStore from \"../../lib/store/markers\";\n\ndescribe(\"MarkerStore\", () => {\n let store;\n ... | javascript | new_file | 0 | 1 | mit | 76ae0e7258d2a952f2a187c2abd574dadd87ef21 | nteract/hydrogen,nteract/hydrogen,xanecs/hydrogen,rgbkrk/hydrogen | spec/store/markers-spec.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nfunction autosaveSnippet () {\n var $url = $('.edit_snippet')[0].action;\n var $data = $('.edit_snippet').serialize();\n $.ajax({\n type: \"PATCH\",\n url: $url,\n data: $data,\n dataType: \"text\"\n }).done(function(res... | javascript | edit | 0 | 2 | mit | a07c46d7cc3861ac98c98bcf0a179f8285dc9182 | pearlshin/StoryVine,mxngyn/StoryVine,mxngyn/StoryVine,SputterPuttRedux/storyvine_clone,SputterPuttRedux/storyvine_clone,mxngyn/StoryVine,pearlshin/StoryVine,pearlshin/StoryVine,SputterPuttRedux/storyvine_clone | app/assets/javascripts/autosave.js | accepted | null | true |
[
{
"role": "user",
"content": "Write javascript code for the following: Add missing tests for 'Row'"
},
{
"role": "assistant",
"content": "import React from 'react';\nimport ReactTestUtils from 'react/lib/ReactTestUtils';\nimport Row from '../src/Row';\n\ndescribe('Row', function () {\n it('uses... | javascript | new_file | 0 | 1 | mit | 9f88221838c29374d8845e5dd7c5895953ba37af | dongtong/react-bootstrap,egauci/react-bootstrap,gianpaj/react-bootstrap,JimiHFord/react-bootstrap,HorizonXP/react-bootstrap,react-bootstrap/react-bootstrap,jakubsikora/react-bootstrap,Sipree/react-bootstrap,Terminux/react-bootstrap,chrishoage/react-bootstrap,xuorig/react-bootstrap,azmenak/react-bootstrap,mmarcant/react... | test/RowSpec.js | accepted | null | true |
[
{
"role": "user",
"content": "Write javascript code for the following: Add module JS to manage alerts\n\nSigned-off-by: Aitor Magán García <<EMAIL>>"
},
{
"role": "assistant",
"content": "/**\n * Copyright (c) 2015, CoNWeT Lab., Universidad Politécnica de Madrid\n * Code licensed under BSD 3-C... | javascript | new_file | 0 | 1 | bsd-3-clause | daa98b6991b4997deb5202ae4e5dbc307d720226 | Fiware/apps.WMarket,conwetlab/WMarket,conwetlab/WMarket,Fiware/apps.WMarket,Fiware/apps.WMarket,conwetlab/WMarket,Fiware/apps.WMarket,conwetlab/WMarket | src/main/webapp/resources/marketplace/js/AlertManager.js | accepted | null | true |
[
{
"role": "user",
"content": "Write javascript code for the following: Add unit test for image detail\n\nChange-Id: I8ae82e37be53b8b7642534e4f6772cb1e52ef3d6"
},
{
"role": "assistant",
"content": "/**\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\"); you may\n * not use... | javascript | new_file | 0 | 1 | apache-2.0 | f0fff4fe4f8e5fffa984b55d90c0a70d6e302fe2 | openstack/horizon,openstack/horizon,NeCTAR-RC/horizon,openstack/horizon,NeCTAR-RC/horizon,ChameleonCloud/horizon,ChameleonCloud/horizon,NeCTAR-RC/horizon,ChameleonCloud/horizon,openstack/horizon,ChameleonCloud/horizon,NeCTAR-RC/horizon | openstack_dashboard/static/app/core/images/details/details.module.spec.js | accepted | null | true |
[
{
"role": "user",
"content": "Write javascript code for the following: Rename Gulpfile to use Babel."
},
{
"role": "assistant",
"content": "const gulp = require('gulp'),\n bs = require('browser-sync').create(),\n nunjucks = require('gulp-nunjucks-render'),\n sass = require('gulp-s... | javascript | new_file | 0 | 1 | mit | 41667f629da4f51769d8849df9465ef9da75ea47 | majtom2grndctrl/design-guide-scaffold,majtom2grndctrl/design-guide-scaffold | gulpfile.babel.js | accepted | null | true |
[
{
"role": "user",
"content": "Write javascript code for the following: Add the example to the worker for RabbitMG server."
},
{
"role": "assistant",
"content": "var amqp = require('amqp');\n\nvar connection = amqp.createConnection({\n host: 'localhost'\n});\n\nconnection.on('ready', function... | javascript | new_file | 0 | 1 | mit | a2f4e0a23386678a46fceaa4efd8802d8dd5d6bd | nicebook/Node.js-Reference,nicebook/Node.js-Reference,nicebook/Node.js-Reference | 17/amqp-server-worker.js | accepted | null | true |
[
{
"role": "user",
"content": "Write javascript code for the following: Add the package main file"
},
{
"role": "assistant",
"content": "\"use strict\";\n\n// Export the most important modules\n\nglobal[ \"ResourceBundle\" ] = require( \"./lib/resource-bundle\" );\nglobal[ \"Locale\" ] = require(... | javascript | new_file | 0 | 0 | mit | d11e67d241fd12daff2ec7ea2c2ad5ef1d8bb166 | yannickebongue/text-formatjs,yannickebongue/text-formatjs | index.js | accepted | null | true |
[
{
"role": "user",
"content": "Write javascript code for the following: Manage default editor group on a single page"
},
{
"role": "assistant",
"content": "/* gettext library */\n// This function is copied from django admin path\n\nvar catalog = new Array();\n\nfunction pluralidx(count) { return ... | javascript | new_file | 0 | 3 | bsd-3-clause | 1ab91d4923ece874474ae08934452b35609c4124 | MiltosD/CEF-ELRC,MiltosD/CEF-ELRC,zeehio/META-SHARE,MiltosD/CEFELRC,JuliBakagianni/META-SHARE,JuliBakagianni/CEF-ELRC,zeehio/META-SHARE,MiltosD/CEFELRC,JuliBakagianni/CEF-ELRC,JuliBakagianni/META-SHARE,MiltosD/CEF-ELRC,MiltosD/CEFELRC,JuliBakagianni/META-SHARE,JuliBakagianni/CEF-ELRC,zeehio/META-SHARE,zeehio/META-SHARE... | metashare/media/js/jsi18n.js | accepted | null | true |
[
{
"role": "user",
"content": "Write javascript code for the following: Add test cases of mecab.js"
},
{
"role": "assistant",
"content": "'use strict';\n\nconst assert = require('assert');\n\nconst Mecab = require('../lib/mecab');\n\ndescribe('Mecab', () => {\n const tests = [\n {argv: ... | javascript | new_file | 0 | 1 | mit | 54a5a217282470916cbc97c08209f39f89296f19 | tanikawa04/kyrica | test/mecab_test.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n/*!\n * Connect - timeout\n * Ported from https://github.com/LearnBoost/connect-timeout\n * MIT Licensed\n */\n\n/**\n * Module dependencies.\n */\n\nvar debug = require('debug')('connect:timeout');\n\n/**\n * Timeout:\n *\n * Times out... | javascript | edit | 0 | 2 | mit | 45e9577cad2e3955edc60e3acb831ef1445c38e6 | behind2/connect,chinazhaghai/connect,liuwei9413/connect,khirayama/connect,austincitylimits/connect,RoseTHERESA/connect,lian774739140/connect,davehorton/drachtio,tanveer12332/connect,khalerc/connect,qitianchan/connect,gtomitsuka/connect,RickyDan/connect,dkfiresky/connect,mi2oon/connect,keenwon/connect,llwanghong/connect... | lib/middleware/timeout.js | accepted | null | true |
[
{
"role": "user",
"content": "Write javascript code for the following: Add directive to focus an element based on an expression (useful for search inputs)."
},
{
"role": "assistant",
"content": "/*global angular*/\n(function () {\n 'use strict';\n\n angular.module('core').directive('focusO... | javascript | new_file | 0 | 2 | mit | a3b279660d21b9e4453a68f9cbfaae7d0cef1ef0 | tmol/iQSlideShow,tmol/iQSlideShow,tmol/iQSlideShow | public/modules/core/directives/focusOn.js | accepted | null | true |
[
{
"role": "user",
"content": "Write javascript code for the following: Add JS date toggle file and functionality."
},
{
"role": "assistant",
"content": "$(function() {\n $('.toggleDeadlineUnitDate').on('click', function(e) {\n e.preventDefault();\n $(this).replaceWith(\"<label for='projec... | javascript | new_file | 0 | 1 | mit | 043fec02cb4d1ad6c90422701079f12d80662811 | tiger-swallowtails-2014/write-now,tiger-swallowtails-2014/write-now | app/assets/javascripts/unit_toggler.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n// node modules\nimport fs from 'fs';\n// npm modules\nimport homedir from 'homedir';\n\nconst configFilePath = `${homedir()}/.urcli/config.json`;\n\nexport class Config {\n constructor() {\n try {\n const config = JSON.parse(f... | javascript | edit | 0 | 3 | mit | bd532c391431ab5f097fbf15e36a5db9b4e8415a | trolster/urcli,gabraganca/ur-cli,trolster/ur-cli | src/utils/config.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n// This file configures a web server for testing the production build\n// on your local machine.\n\nimport browserSync from 'browser-sync';\nimport historyApiFallback from 'connect-history-api-fallback';\n\n// Run Browsersync\nbrowserSy... | javascript | edit | 0 | 0 | mit | aa46f414201a857a1ab58f7ebd250efa4f4bfe93 | Tinker-Ware/eyes,Tinker-Ware/eyes | tools/distServer.js | rejected_duplicate | Near-duplicate of sample 75789 | true |
[
{
"role": "user",
"content": "Write javascript code for the following: Add script showing Math.pow bug"
},
{
"role": "assistant",
"content": "'use strict';\n\nvar x = 10;\nvar y = 308;\nvar actual = Math.pow( x, y );\nvar expected = 1e308;\n\nconsole.log( 'pow(%d,%d) = %d. Expected: %d.', x, y, ... | javascript | new_file | 0 | 4 | mit | 82d1b94903536e70edf56faa5011246be9c67be3 | kgryte/talks-nodejs-interactive-2016,kgryte/talks-nodejs-interactive-2016 | scripts/bugs/math_pow.js | accepted | null | true |
[
{
"role": "user",
"content": "Write javascript code for the following: Add solution to question 73"
},
{
"role": "assistant",
"content": "/**\n * @param {number[][]} matrix\n * @return {void} Do not return anything, modify matrix in-place instead.\n */\nvar setZeroes = function(matrix) {\n va... | javascript | new_file | 0 | 4 | mit | 24136b649067029c3d0f8be4254accc50a68c455 | Rhadow/leetcode,Rhadow/leetcode,Rhadow/leetcode,Rhadow/leetcode | Medium/073_Set_Matrix_Zeroes.js | accepted | null | true |
[
{
"role": "user",
"content": "Write javascript code for the following: Add a list of useful regex."
},
{
"role": "assistant",
"content": "const symbols = {\n '~': 'tilde',\n '`': 'backtick',\n '!': 'exclamation',\n '@': 'at',\n '#': 'pound',\n $: 'dollar',\n '%': 'percent',\n '^': 'carat... | javascript | new_file | 0 | 0 | mit | 1067669be2af48b5f8f55411c0c7d35438535438 | kroogs/scanty | src/common.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nimport React, { PropTypes } from 'react';\nimport ImmutablePropTypes from 'react-immutable-proptypes';\nimport Widgets from './Widgets';\n\nexport default class PreviewPane extends React.Component {\n previewFor(field) {\n const { e... | javascript | edit | 0 | 2 | mit | 102429aa5b8f3c56f2aa64ab5cc09b4c6bb1e7de | dopry/netlify-cms,netlify/netlify-cms,Aloomaio/netlify-cms,netlify/netlify-cms,Aloomaio/netlify-cms,netlify/netlify-cms,netlify/netlify-cms,dopry/netlify-cms | src/components/PreviewPane.js | accepted | null | true |
[
{
"role": "user",
"content": "Write javascript code for the following: Add missing nav menu js"
},
{
"role": "assistant",
"content": "/**\n * Handle the custom post type nav menu meta box\n */\njQuery( document ).ready( function($) {\n\t$( '#submit-mlp_language' ).click( function( event ) {\n\t\... | javascript | new_file | 0 | 1 | mit | faa58cbd818d4bfcdc2861301d5cd2415b432ac5 | inpsyde/multilingual-press,inpsyde/multilingual-press | js/nav_menu.js | accepted | null | true |
[
{
"role": "user",
"content": "Write javascript code for the following: Solve problem 02. Divide by 7 and 5"
},
{
"role": "assistant",
"content": "function solve(argument) {\n\tvar n = parseInt(argument[0]);\n\n\tif (n % 7 === 0 && n % 5 === 0) {\n\t\tconsole.log(\"true \" + n);\n\t} else {\n\t\t... | javascript | new_file | 0 | 3 | mit | d2b3e46f9f58b3b47dcec1032401885b2ea139cf | Gyokay/Telerik-Academy-Homeworks,Gyokay/Telerik-Homeworks,Gyokay/Telerik-Academy-Homeworks,Gyokay/Telerik-Homeworks,Gyokay/Telerik-Academy-Homeworks | JS-Fundamentals-Homeworks/Operators-and-Expressions/02.Divide-by-7-and-5.js | accepted | null | true |
[
{
"role": "user",
"content": "Write javascript code for the following: Create a script to update old photo URL to new URL"
},
{
"role": "assistant",
"content": "const promise = require(\"bluebird\");\nconst options = {\n // Initialization Options\n promiseLib: promise, // use bluebird as promi... | javascript | new_file | 0 | 2 | mit | 1a2b5a507dbfd75fdaf8630f6b29907d813c3bb9 | participedia/api,participedia/api,participedia/api,participedia/api | scripts/points-url-data-to-new-bucket.js | accepted | null | true |
[
{
"role": "user",
"content": "Write javascript code for the following: Move game of life module to its own file"
},
{
"role": "assistant",
"content": "var GameOfLife = (function () {\n var ALIVE = \"alive\", DEAD = \"dead\";\n\n function Cell(initialState) {\n var state = initialSta... | javascript | new_file | 0 | 4 | mit | f4b135a3897e708a6332aebc307cc0d6602cef3b | velcrin/GameOfLife | app/js/GameOfLife.js | accepted | null | true |
[
{
"role": "user",
"content": "Write javascript code for the following: Test error for cen command"
},
{
"role": "assistant",
"content": "var cen = require(\"__buttercup/classes/commands/command.cen.js\");\n\nmodule.exports = {\n setUp: function(cb) {\n this.command = new cen();\n (cb)();\... | javascript | new_file | 0 | 1 | mit | fecd3b971f6536a7ef289640168d33d981ac5c66 | buttercup/buttercup-core,buttercup/buttercup-core,buttercup/buttercup-core,perry-mitchell/buttercup-core,buttercup-pw/buttercup-core,perry-mitchell/buttercup-core,buttercup-pw/buttercup-core | tests/commands/cenTests.js | accepted | null | true |
[
{
"role": "user",
"content": "Write javascript code for the following: Truncate a string with a specific length"
},
{
"role": "assistant",
"content": "const stringTruncate = (str, lgt) => {\n if (str.length > lgt) {\n return str.substring(0, lgt) + \"...\";\n }\n return str;\n};\n\nstringT... | javascript | new_file | 0 | 2 | mit | ad3e5c3f9a4529819b26ebeef3ba2ec94eaecf83 | divyanshu-rawat/Basic-JS-Algorithms | string-truncate.js | accepted | null | true |
[
{
"role": "user",
"content": "Write javascript code for the following: Add failing test for hasQuickActions"
},
{
"role": "assistant",
"content": "import { hasQuickActions } from '~/notes/stores/utils';\n\ndescribe('hasQuickActions', () => {\n it.each`\n input ... | javascript | new_file | 0 | 1 | mit | 4ce36f3443a3385468fd6fde0ae9f27d54ea1d37 | stoplightio/gitlabhq,stoplightio/gitlabhq,stoplightio/gitlabhq,mmkassem/gitlabhq,mmkassem/gitlabhq,mmkassem/gitlabhq,stoplightio/gitlabhq,mmkassem/gitlabhq | spec/frontend/notes/stores/utils_spec.js | accepted | null | true |
[
{
"role": "user",
"content": "Write javascript code for the following: Add initial version of routes.js"
},
{
"role": "assistant",
"content": "var Router = (function() {\n var routes = [],\n redirects = [];\n\n /**\n * Add a set of routes and their callbacks to the Router\n ... | javascript | new_file | 0 | 5 | mit | 7a45e111d37b899432e191e439f7c843e74b3455 | AndreiDuma/router.js | router.js | accepted | null | true |
[
{
"role": "user",
"content": "Write javascript code for the following: Add smoke test for running the executable script\n\nIt's slow, but we only need a few of these just to ensure that\neverything has been wired together correctly."
},
{
"role": "assistant",
"content": "var expect = require('ch... | javascript | new_file | 0 | 2 | mit | e308516a1407f64f9642fadf0ca51707340a56bc | lebab/lebab,mohebifar/xto6,mohebifar/lebab | test/bin.js | accepted | null | true |
[
{
"role": "user",
"content": "Write javascript code for the following: Replace src in html with class=hash"
},
{
"role": "assistant",
"content": "function replaceHtml(htmlString, hashObject) {\n const filesArray = Object.keys(hashObject)\n let newHtmlString = htmlString\n \n function replace... | javascript | new_file | 0 | 3 | mit | cb14823f8fb538a662e7220740aa46af93b36bc1 | CarolAG/WebFlight,coryc5/WebFlight | replaceHtml.js | accepted | null | true |
[
{
"role": "user",
"content": "Write javascript code for the following: Add tests for fitness behaviour and bug"
},
{
"role": "assistant",
"content": "const {scoreScenario, boilDownIndividualScore} = require('../app/fitness-scoring.js');\n\nconst assert = require('assert');\n\ndescribe('scoreScen... | javascript | new_file | null | null | mit | ea8d07da420713a6adc1c3ac50402e9adbc6a88c | helix-pi/helix-pi,Widdershin/helix-pi,helix-pi/helix-pi,Widdershin/helix-pi | test/fitness-scoring.js | rejected_code_smell | Internal duplication: ~23% of the file is inside repeated 12+ line blocks | null |
[
{
"role": "user",
"content": "Write javascript code for the following: Add PhantomJS script to report test results."
},
{
"role": "assistant",
"content": "var system = require('system')\n , webpage = require('webpage');\n\nvar page = webpage.create()\n , passes = 0\n , failures = 0\n , total... | javascript | new_file | 0 | 6 | mit | adf64a16d81e5c2968b4d572d9cb649b48d92910 | jaredhanson/phantomjs-mocha | scripts/mocha.js | accepted | null | true |
[
{
"role": "user",
"content": "Write javascript code for the following: Add migration for a crowdsale contract"
},
{
"role": "assistant",
"content": "var NeufundTestToken = artifacts.require(\"./NeufundTestToken.sol\");\nvar Crowdsale = artifacts.require(\"./Crowdsale.sol\");\n\nmodule.exports = ... | javascript | new_file | 0 | 1 | mit | fa12c52231dd91e2485433cbd9df2161b8839c7a | Neufund/Contracts | migrations/3_deploy_crowdsale_contract.js | accepted | null | true |
[
{
"role": "user",
"content": "Write javascript code for the following: Add maintenance script for recomputing indexed geometries"
},
{
"role": "assistant",
"content": "#!/usr/bin/env node\n/*jslint node: true */\n\n/*\n * Compute a new indexedGeometry field for every Response document.\n * We sh... | javascript | new_file | 0 | 6 | bsd-3-clause | 4b051356414093bcee39a46d0ab727261e6d4a54 | LocalData/localdata-api,LocalData/localdata-api,LocalData/localdata-api | maintenance/recompute-indexed-geometry.js | accepted | null | true |
[
{
"role": "user",
"content": "Write javascript code for the following: Add the example to change format of image via sharp."
},
{
"role": "assistant",
"content": "var sharp = require('sharp');\n\nvar dirpath = 'images/';\nvar imgname = 'download-logo.png';\nvar tmppath = 'tmp/'\n\nsharp(dirpath... | javascript | new_file | 0 | 2 | mit | b395f02cf30a64bd21af14bfd0883467962b4902 | nicebook/Node.js-Reference,nicebook/Node.js-Reference,nicebook/Node.js-Reference | 16/sharp-toFormat.js | accepted | null | true |
[
{
"role": "user",
"content": "Write javascript code for the following: Add first prototype of LabyrinthDB."
},
{
"role": "assistant",
"content": "'use strict';\n\nvar r = require('rethinkdb');\n\n\nexport class LabyrinthDB {\n constructor (conn, dbName) {\n this.conn = conn;\n this.dbName... | javascript | new_file | 0 | 3 | mit | 05131a5eaf5c4bdab431a8de4d86f3ce726fc7e4 | nobus/Labyrinth,nobus/Labyrinth | server/labyrinthdb.js | accepted | null | true |
[
{
"role": "user",
"content": "Write javascript code for the following: Add <html> tags to email header and footer"
},
{
"role": "assistant",
"content": "RocketChat.Migrations.add({\n\tversion: 95,\n\tup() {\n\t\tif (RocketChat && RocketChat.models && RocketChat.models.Settings) {\n\t\t\tconst em... | javascript | new_file | 0 | 6 | mit | 2f234f6ce007a625382f597af0cd017d8ca044ac | mrinaldhar/Rocket.Chat,fatihwk/Rocket.Chat,mrsimpson/Rocket.Chat,galrotem1993/Rocket.Chat,inoio/Rocket.Chat,danielbressan/Rocket.Chat,k0nsl/Rocket.Chat,Sing-Li/Rocket.Chat,4thParty/Rocket.Chat,cnash/Rocket.Chat,4thParty/Rocket.Chat,k0nsl/Rocket.Chat,Sing-Li/Rocket.Chat,4thParty/Rocket.Chat,nishimaki10/Rocket.Chat,VoiSm... | server/startup/migrations/v095.js | accepted | null | true |
[
{
"role": "user",
"content": "Write javascript code for the following: Add lazy loader client script"
},
{
"role": "assistant",
"content": "import axios from 'axios';\n\nfunction Loader(options = {}) {\n this.page = options.page || 0;\n this.limit = options.limit || 1;\n this.url = options.ur... | javascript | new_file | 0 | 4 | mit | 73a91ee247e43d67fb586b5b0c7b8e2694c14345 | tuelsch/bolg,tuelsch/bolg | src/modules/gallery-lazy-load.js | accepted | null | true |
[
{
"role": "user",
"content": "Write javascript code for the following: Add script to execute manually to update parkings"
},
{
"role": "assistant",
"content": "'use strict';\n\nconst co = require('co');\nconst logger = require('../modules').logger;\nconst mongooseHelper = require('../modules').m... | javascript | new_file | 0 | 1 | mit | f9c48d88a67fed97610ba82106df668abca53698 | carparker/carparker-server | scripts/opendata_manual_update.js | accepted | null | true |
[
{
"role": "user",
"content": "Write javascript code for the following: Return fixture data until json feed proxy implemented"
},
{
"role": "assistant",
"content": "import {get} from 'utils/ajax'\n\nimport {fixtureJSONFeed} from 'src/status/fixtures'\n// TODO: remove async/await & object return, ... | javascript | new_file | 0 | 1 | mit | e8bebebe19e64d664069f23e534b173ca50e4d2f | li-ang/influxdb,mark-rushakoff/influxdb,influxdb/influxdb,nooproblem/influxdb,influxdb/influxdb,mark-rushakoff/influxdb,nooproblem/influxdb,influxdb/influxdb,li-ang/influxdb,influxdb/influxdb,nooproblem/influxdb,mark-rushakoff/influxdb,influxdb/influxdb,mark-rushakoff/influxdb,influxdb/influxdb,influxdata/influxdb,mark... | ui/src/status/apis/index.js | accepted | null | true |
[
{
"role": "user",
"content": "Write javascript code for the following: Examples: Add API observable server example"
},
{
"role": "assistant",
"content": "var lightResource,\n\tsensor = require( \"./mock-sensor\" )(),\n\tiotivity = require( \"iotivity\" ),\n\tdevice = iotivity.OicDevice(),\n\tset... | javascript | new_file | 0 | 5 | mit | d2b27174c997b0bda5836ade508511fd3a21c9cf | zqzhang/iotivity-node,zolkis/iotivity-node,zqzhang/iotivity-node,zolkis/iotivity-node,zqzhang/iotivity-node,zolkis/iotivity-node,zqzhang/iotivity-node,zolkis/iotivity-node,zolkis/iotivity-node,zqzhang/iotivity-node | js/api-server.js | accepted | null | true |
[
{
"role": "user",
"content": "Write javascript code for the following: Write a script to setup db and a test user & post"
},
{
"role": "assistant",
"content": "/**\n * Generate the dbtables\n * and generate a user with a post\n *\n * username = batman\n * password = robin\n */\nconst path = requ... | javascript | new_file | 0 | 2 | mit | e019d9c26f2be9d571016a9c606c3635437af323 | chamsocial/Chamsocial,chamsocial/Chamsocial,chamsocial/Chamsocial | scripts/init-db.js | accepted | null | true |
[
{
"role": "user",
"content": "Write javascript code for the following: Read syslog data and outputs to console as JSON"
},
{
"role": "assistant",
"content": "var dgram = require(\"dgram\");\n\nvar socket = dgram.createSocket(\"udp4\");\n\nsocket.on(\"error\", function (err) {\n console.log(\"se... | javascript | new_file | 0 | 1 | bsd-3-clause | 68f52baec830b28259d5d486b3dcf892e51285d3 | genebean/sawyer | server.js | accepted | null | true |
[
{
"role": "user",
"content": "Write javascript code for the following: Add the 'createHook()' function. Rather hacky but oh well..."
},
{
"role": "assistant",
"content": "\n/**\n * This is our \"Hook\" class that allows a script to hook into the lifecyle of the\n * \"configure\", \"build\" and \... | javascript | new_file | 0 | 4 | mit | fbe55dba68fb2542fd12e4daf5bd1203d356bb5c | maghoff/node-gyp,spacelis/node-gyp,spacelis/node-gyp,maghoff/node-gyp,tepez/node-gyp,pombredanne/pangyp,saper/node-gyp,yorkie/node-gyp,justinmchase/node-gyp,overra/node-gyp,MiniGod/nw-gyp,implausible/pangyp,CodeJockey/node-ninja,rvagg/pangyp,watonyweng/node-gyp,atiti/pangyp,nodegit/node-gyp,jqk6/node-gyp,fengmk2/node-g... | lib/util/hook.js | accepted | null | true |
[
{
"role": "user",
"content": "Write javascript code for the following: Add start of tests for checking that plugin adds ids correctly on initial load"
},
{
"role": "assistant",
"content": "/* bender-tags: editor,unit */\n/* bender-ckeditor-plugins: autoid */\n\n'use strict';\n\nbender.editor = {... | javascript | new_file | 0 | 1 | mit | 56b7877f251fdd0b9cd53dfa6d0d19f9fd6b7d8f | PolicyStat/ckeditor-plugin-autoid-headings,PolicyStat/ckeditor-plugin-autoid-headings | tests/ids/add_ids.js | accepted | null | true |
[
{
"role": "user",
"content": "Write javascript code for the following: Add method to delete users destination"
},
{
"role": "assistant",
"content": "function deleteDestination(place) {\n function placeToDelete(){\n return place;\n };\n\n// delete user's destination\n// NEED TO REPLACE USERN... | javascript | new_file | 0 | 2 | mit | 9b7b663c33e9dea0e21ac778712f4dfa8f507883 | okjill/scout,okjill/scout,okjill/scout,okjill/scout | sandbox/sangmee.js | accepted | null | true |
[
{
"role": "user",
"content": "Write javascript code for the following: Add initial API docs js injector"
},
{
"role": "assistant",
"content": "var DocInjector = {\n\tinit: function() {\n\t\tvar that = this;\n\t\t$.each(this.data, function(i, docReference) {\n\t\t\tthat.inject(docReference)\n\t\t... | javascript | new_file | 0 | 2 | mit | 93e2ebe6e77256e9102019350f0969ee3470e813 | joeyw/octodoctotron,joeyw/octodoctotron,joeyw/octodoctotron | src/doc_injector.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nvar GridStore = require('mongodb').GridStore;\n\n/**\n * @param filename: filename or ObjectId\n */\nvar SkinGridStore = exports.SkinGridStore = function(skinDb) {\n this.skinDb = skinDb;\n}\n\n/**\n * @param filename: filename or Obj... | javascript | edit | 0 | 2 | mit | 987f8fb93621526c42b7866af816f01b6d7fced4 | kissjs/node-mongoskin,microlv/node-mongoskin,mleanos/node-mongoskin,dropfen/node-mongoskin | lib/mongoskin/gridfs.js | rejected_duplicate | Near-duplicate of sample 86485 | true |
[
{
"role": "user",
"content": "Write javascript code for the following: Implement basic representation of a trading pair"
},
{
"role": "assistant",
"content": "\n/*\n *\n * poloniex-unofficial\n * https://git.io/polonode\n *\n * Yet another unofficial Node.js wrapper for the Poloniex cryptocurren... | javascript | new_file | 0 | 4 | mit | 84c329ce0406b08649bb2c667e5b0e3f4c3e1132 | tylerfilla/node-poloniex-unofficial | lib/util/TradingPair.js | accepted | null | true |
[
{
"role": "user",
"content": "Write javascript code for the following: Update to have Children for Product2 run in JavaScript"
},
{
"role": "assistant",
"content": "var Product2 = module.exports = function(vlocity) {\n this.vlocity = vlocity;\n};\n\nProduct2.prototype.childrenExport = async f... | javascript | new_file | 0 | 8 | mit | ce34ddf2c1dc99050e669f24f6f35794bbe956a0 | vlocityinc/vlocity_build,vlocityinc/vlocity_build,vlocityinc/vlocity_build | lib/datapacktypes/product2.js | accepted | null | true |
[
{
"role": "user",
"content": "Write javascript code for the following: Set up '/signup' to use User controller"
},
{
"role": "assistant",
"content": "import express from 'express';\n\nimport * as userController from '../../controllers/users';\n\nconst user = express.Router();\n\n// define route ... | javascript | new_file | 0 | 0 | apache-2.0 | 84157c3942725eaaf928a08ad5ac3ba389dc141a | larrystone/BC-26-More-Recipes,larrystone/BC-26-More-Recipes | server/routes/users/index.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nvar semver = require('semver'),\n runtimeVersion = semver.parse(process.version);\n\n/**\n * Get Runtime Name\n *\n * @api private\n */\n\nfunction getRuntimeName() {\n return process.execPath\n .split(/[\\\\/]+/).pop()\n ... | javascript | edit | 0 | 3 | mit | c365f8c33825e67846d40e651f4bb7dd063461c5 | Vitogee/node-sass,littlepoolshark/node-sass,paulcbetts/node-sass,nschonni/node-sass,quentinyang/node-sass,justame/node-sass,Smartbank/node-sass,justame/node-sass,SomeoneWeird/node-sass,pmq20/node-sass,chriseppstein/node-sass,yanickouellet/node-sass,besarthoxhaj/node-sass,am11/node-sass,kylecho/node-sass,nibblebot/node-... | lib/extensions.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nconst refPattern = /\\[\\s*(\\*|[0-9]|[1-9][0-9]+)\\s*\\]/g;\nconst splitPattern = /([^\\\\](?:\\\\\\\\)*)\\./;\nconst escapeKeyPattern = /\\\\|\\./g;\nconst unescapeKeyPattern = /((?:\\\\)+)\\1|\\\\(\\.)/g;\n\nexport function escapeKey... | javascript | edit | 0 | 2 | mit | fae9ab2828b9e5a4c19a65a7e2918b9e33b60558 | marcalexiei/ractive,ISNIT0/ractive,marcalexiei/ractive,marcalexiei/ractive,ISNIT0/ractive,ractivejs/ractive,ractivejs/ractive,ractivejs/ractive,ISNIT0/ractive | src/shared/keypaths.js | accepted | null | true |
[
{
"role": "user",
"content": "Write javascript code for the following: Format numbers with thousand seperators"
},
{
"role": "assistant",
"content": "\"use static\";\n\nfunction numberWithCommas(number) {\n var parts = number.toString().split(\".\");\n parts[0] = parts[0].replace(/\\B(?=(\... | javascript | new_file | 0 | 1 | bsd-2-clause | 66cfb46a9a824b185f7ff3b8c74e666fd80436be | narthollis/eve-skillplan-webapp,narthollis/eve-skillplan-webapp | lib/number.with.commas.js | accepted | null | true |
[
{
"role": "user",
"content": "Write javascript code for the following: Add test for player eats virus"
},
{
"role": "assistant",
"content": "const chai = require('chai');\nconst assert = chai.assert;\n\nconst Player = require('../public/online-player');\nconst Virus = require('../lib/virus');\n\... | javascript | new_file | 0 | 1 | mit | 394cbfd34ee9439048e266fc824432a5a6edec25 | jecrockett/gametime,jecrockett/gametime | test/player-eats-virus-test.js | accepted | null | true |
[
{
"role": "user",
"content": "Write javascript code for the following: Add html->md script (moved from wkoszek/me/scripts)"
},
{
"role": "assistant",
"content": "#!/usr/bin/env node\n\nvar fs = require('fs')\ntoMarkdown = require('to-markdown');\n\nfn = process.argv[2]\n\nfs.readFile(fn, 'utf8',... | javascript | new_file | 0 | 4 | bsd-2-clause | e2558b0870f368dcbf7a3defa63167384f521c66 | wkoszek/tools,wkoszek/tools,wkoszek/tools | html2md.js | accepted | null | true |
[
{
"role": "user",
"content": "Write javascript code for the following: Move API functions into separate file"
},
{
"role": "assistant",
"content": "export function get(path) {\n return request('GET', path, '', {});\n}\n\nexport function post(path, body, signature) {\n return request('POST', pa... | javascript | new_file | 0 | 1 | apache-2.0 | 944f8f79929e732b6554b7648dac0188213ca540 | dillonhafer/garage-ios,dillonhafer/garage-ios | app/components/api.js | accepted | null | true |
[
{
"role": "user",
"content": "Write javascript code for the following: Add initial pattern matching logic\n\nget schwifty!"
},
{
"role": "assistant",
"content": "const squanch = (...patterns) => {\n\treturn v => {\n\t\tconst primitives = ['Number', 'String', 'Boolean', 'Symbol'];\n\n\t\tconst is... | javascript | new_file | 0 | 7 | mit | 5dcc55153ee9f81058f01d22a4db8a215b221966 | magbicaleman/squanch | squanch.js | rejected_duplicate | Near-duplicate of sample 101969 | true |
[
{
"role": "user",
"content": "Write javascript code for the following: Add a \"Hello JerryScript!\" program to the tests\n\nThe current code base does not contain any \"first JavaScript\nprogram\" for those who build JerryScript for Linux console. It\ndoes contain a LED-blinking example -- blinky.js -- but ... | javascript | new_file | 0 | 0 | apache-2.0 | 7022aa26b0ef3a0610b5f80255bc95d8d29027a7 | zherczeg/jerryscript,jack60504/jerryscript,slaff/jerryscript,bzsolt/jerryscript,robertsipka/jerryscript,loki04/jerryscript,LaszloLango/jerryscript,slaff/jerryscript,akosthekiss/jerryscript,bzsolt/jerryscript,jerryscript-project/jerryscript,martijnthe/jerryscript,tilmannOSG/jerryscript,martijnthe/jerryscript,LaszloLango... | tests/hello.js | accepted | null | true |
[
{
"role": "user",
"content": "Write javascript code for the following: Add tests for time parser utility"
},
{
"role": "assistant",
"content": "/** @ignore */\nconst TimeParser = requireApp('utils/time/TimeParser');\n/** @ignore */\nconst assert = require('assert');\n\ndescribe('app/utils/time/T... | javascript | new_file | 0 | 1 | mit | 98c536016b4c8d2364b854b835ad347038dc49dd | Senither/AvaIre | tests/utils/time/TimeParserTests.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nconst express = require('express');\nconst redis = require(\"redis\");\nconst session = require('express-session');\nconst RedisStore = require('connect-redis')(session);\nconst passport = require('passport');\nconst path = require('pat... | javascript | edit | 0 | 1 | bsd-3-clause | cdd10264a128017b80b501e183c2925e30048a43 | zhakkarn/Mail-for-Good,karuppiah7890/Mail-for-Good,karuppiah7890/Mail-for-Good,zhakkarn/Mail-for-Good,zhakkarn/Mail-for-Good,karuppiah7890/Mail-for-Good | server/index.js | accepted | null | true |
[
{
"role": "user",
"content": "Write javascript code for the following: Change the email validator so it also works for optional fields"
},
{
"role": "assistant",
"content": "Ext.define('Starter.data.validator.Email', {\n\toverride: 'Ext.data.validator.Email',\n\n\tvalidate: function(value) {\n\t... | javascript | new_file | 0 | 6 | apache-2.0 | b85b349730792bfc7721d343467a831a7304e1a8 | ralscha/eds-starter6-mongodb,ralscha/eds-starter6-mongodb,ralscha/eds-starter6-mongodb | client/app/data/validator/Email.js | accepted | null | true |
[
{
"role": "user",
"content": "Write javascript code for the following: Add inital test for mixin blueprint"
},
{
"role": "assistant",
"content": "'use strict';\n\nvar blueprintHelpers = require('ember-cli-blueprint-test-helpers/helpers');\nvar setupTestHooks = blueprintHelpers.setupTestHooks;\nv... | javascript | new_file | 0 | 1 | mit | 7f61cb688bdd653a05f8d44bb242f63732acdcc2 | kimroen/ember-cli-coffeescript,kimroen/ember-cli-coffeescript,kimroen/ember-cli-coffeescript | node-tests/blueprints/mixin-test.js | accepted | null | true |
[
{
"role": "user",
"content": "Write javascript code for the following: Add the example to get the authorization from facebook."
},
{
"role": "assistant",
"content": "var passport = require('passport');\nvar FacebookStrategy = require('passport-facebook').Strategy;\nvar express = require('express... | javascript | new_file | 0 | 1 | mit | 3a0dfb0a715d352ff612059a924a8992006fa6c9 | nicebook/Node.js-Reference,nicebook/Node.js-Reference,nicebook/Node.js-Reference | 25/passport-facebook.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n// Spectrum Colorpicker\n// Spanish (es) localization\n// https://github.com/bgrins/spectrum\n\n(function ( $ ) {\n\n var localization = $.spectrum.localization[\"es\"] = {\n cancelText: \"Cancelar\",\n chooseText: \"El... | javascript | edit | 0 | 1 | mit | 68235553f0d6fda45339cbf88b4998942ca5037c | ginlime/spectrum,GerHobbelt/spectrum,liitii/spectrum,GerHobbelt/spectrum,ajssd/spectrum,maurojs25/spectrum,kotmatpockuh/spectrum,liitii/spectrum,safareli/spectrum,ginlime/spectrum,shawinder/spectrum,armanforghani/spectrum,bgrins/spectrum,ajssd/spectrum,kotmatpockuh/spectrum,safareli/spectrum,c9s/spectrum,shawinder/spec... | i18n/jquery.spectrum-es.js | accepted | null | true |
[
{
"role": "user",
"content": "Write javascript code for the following: Add basic gui reducer test"
},
{
"role": "assistant",
"content": "/* eslint-disable max-len */\nimport { UPDATE_LOCATION } from 'react-router-redux'\nimport { expect, // sinon\n } from '../spec_helper'\nimport * as subj... | javascript | new_file | 0 | 1 | mit | 6a6e35d90b2da1265911c1c4ebdf5082b2d1e777 | ello/webapp,ello/webapp,ello/webapp | test/reducers/gui_test.js | accepted | null | true |
[
{
"role": "user",
"content": "Write javascript code for the following: Update the database structure of the chat channels to be more flexible."
},
{
"role": "assistant",
"content": "exports.up = function(db, cb) {\n db.runSql(`\n CREATE TABLE channels (\n name citext PRIMARY KEY,\n ... | javascript | new_file | 0 | 2 | mit | 558503a4eb6e696294255161d5d83645c89702d5 | ShieldBattery/ShieldBattery,ShieldBattery/ShieldBattery,ShieldBattery/ShieldBattery,ShieldBattery/ShieldBattery,ShieldBattery/ShieldBattery | migrations/20160728121504-update-chat-channels-to-be-more-flexible.js | accepted | null | true |
[
{
"role": "user",
"content": "Write javascript code for the following: Add 7.3 variables and objects"
},
{
"role": "assistant",
"content": "// JavaScript Variables and Objects\n\n// I paired by myself on this challenge.\n\n// __________________________________________\n// Write your code below.\... | javascript | new_file | 0 | 2 | mit | 57e0abe38feb077cfb1e33414813d5bc704d150e | marcus-a-davis/phase-0,marcus-a-davis/phase-0,marcus-a-davis/phase-0 | week-7/variables-objects.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n// Common webpack configuration used by webpack.hot.config and webpack.rails.config.\n\nconst path = require('path');\n\nmodule.exports = {\n\n // the project dir\n context: __dirname,\n entry: ['jquery', 'jquery-ujs', './assets/java... | javascript | edit | 0 | 0 | mit | 851dc3c21b3b98d60965cda6368623a3750c3c22 | szyablitsky/react-webpack-rails-tutorial,yakovenkodenis/react-webpack-rails-tutorial,roxolan/react-webpack-rails-tutorial,janklimo/react-webpack-rails-tutorial,shunwen/react-webpack-rails-tutorial,Rvor/react-webpack-rails-tutorial,jeffthemaximum/jeffline,janklimo/react-webpack-rails-tutorial,suzukaze/react-webpack-rail... | client/webpack.common.config.js | accepted | null | true |
[
{
"role": "user",
"content": "Write javascript code for the following: Add code and reflection for challenge."
},
{
"role": "assistant",
"content": "// Separate Numbers with Commas in JavaScript **Pairing Challenge**\n\n\n// I worked on this challenge with: Joseph Scott.\n\n// Pseudocode\n// tur... | javascript | new_file | 0 | 4 | mit | 1ea2a51a7d944e5e0abf15ff23c959085178adf5 | svcastaneda/phase-0,svcastaneda/phase-0,svcastaneda/phase-0 | week-7/nums_commas.js | accepted | null | true |
[
{
"role": "user",
"content": "Write javascript code for the following: Add more simple modules/classes to test example"
},
{
"role": "assistant",
"content": "\n/**\n * This is a class/module.\n * @class class1\n * @module module1\n */\n\n/**\n * This is another class/module.\n * @class class2\n ... | javascript | new_file | 0 | 0 | mit | 37ea3cd02080533bb1fd8f9794f06eef83a6f4eb | kevinlacotaco/yuidoc-bootstrap-theme,wyantb/yuidoc-bootstrap-theme,naturalatlas/yuidoc-lucid-theme,kevinlacotaco/yuidoc-bootstrap-theme,wyantb/yuidoc-bootstrap-theme,wyantb/yuidoc-bootstrap-theme,kevinlacotaco/yuidoc-bootstrap-theme,naturalatlas/yuidoc-lucid-theme | example/MultiModule.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n\nvar postcss = require('postcss'),\n color = require('color');\n\nmodule.exports = postcss.plugin('postcss-lowvision', function () {\n return function (css) {\n css.walkDecls('color', function (decl) {\n var val... | javascript | edit | 0 | 1 | mit | b6ced965ce852c91998b9b9fd08c8120ad5f973c | keukenrolletje/postcss-lowvision | index.js | rejected_duplicate | Near-duplicate of sample 104338 | true |
[
{
"role": "user",
"content": "Write javascript code for the following: Update project transportapi.js to 0.0.1"
},
{
"role": "assistant",
"content": "var TransportAPI=function(){var a=\"\",b=\"\",c=\"http://transportapi.com/v3\",d=function(){return\"app_id=\"+a+\"&api_key=\"+b+\"&callback=?\"},e... | javascript | new_file | 0 | 2 | mit | d14ab90a3d1d459d277beb24d987fc634f7dcaf1 | Swatinem/jsdelivr,walkermatt/jsdelivr,royswastik/jsdelivr,firulais/jsdelivr,bdukes/jsdelivr,ManrajGrover/jsdelivr,ntd/jsdelivr,labsvisual/jsdelivr,justincy/jsdelivr,alexmojaki/jsdelivr,firulais/jsdelivr,Sneezry/jsdelivr,garrypolley/jsdelivr,tomByrer/jsdelivr,dpellier/jsdelivr,yaplas/jsdelivr,bonbon197/jsdelivr,Metrakit... | files/transportapi.js/0.0.1/transportapi.min.js | accepted | null | true |
[
{
"role": "user",
"content": "Write javascript code for the following: Add solution to question 70"
},
{
"role": "assistant",
"content": "/**\n * @param {number} n\n * @return {number}\n */\nvar climbStairs = function(n) {\n var ans = [1,1,2];\n\n for (var i = 3; i <= n; i++) {\n an... | javascript | new_file | 0 | 2 | mit | 28637a6017dd9dd142d795e6600eb31b2f4a48fe | Rhadow/leetcode,Rhadow/leetcode,Rhadow/leetcode,Rhadow/leetcode | Easy/070_Clibing_Stairs.js | accepted | null | true |
[
{
"role": "user",
"content": "Write javascript code for the following: Add a switch to flip between electron and node"
},
{
"role": "assistant",
"content": "/**\n * Detect Electron renderer process, which is node, but we should\n * treat as a browser.\n */\n\nif ((process || {}).type === 'render... | javascript | new_file | 0 | 0 | mit | d26711169f97188af5600ce48897e6332cb6b024 | visionmedia/debug,jabaz/debug,jabaz/debug | index.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nimport React, {PropTypes} from 'react'\n\nimport InfiniteScroll from 'shared/components/InfiniteScroll'\nimport LogsTableRow from 'src/kapacitor/components/LogsTableRow'\n\nconst LogsTable = ({logs, onToggleExpandLog}) =>\n <div classN... | javascript | edit | 0 | 1 | mit | b615be2f238a488b17a394d0b2d0572541164c95 | li-ang/influxdb,influxdb/influxdb,nooproblem/influxdb,mark-rushakoff/influxdb,li-ang/influxdb,mark-rushakoff/influxdb,influxdb/influxdb,nooproblem/influxdb,nooproblem/influxdb,nooproblem/influxdb,mark-rushakoff/influxdb,influxdb/influxdb,influxdb/influxdb,influxdata/influxdb,mark-rushakoff/influxdb,mark-rushakoff/influ... | ui/src/kapacitor/components/LogsTable.js | accepted | null | true |
[
{
"role": "user",
"content": "Write javascript code for the following: Add a utility for getting an element definition from the registry base on the element itself."
},
{
"role": "assistant",
"content": "import customElements from '../native/custom-elements';\n\nexport default function (elem) {\... | javascript | new_file | 0 | 5 | mit | d3371d4c6eff5c69ff3c904f76541b3c6277355a | chrisdarroch/skatejs,chrisdarroch/skatejs,skatejs/skatejs,skatejs/skatejs,skatejs/skatejs | src/util/find-element-in-registry.js | accepted | null | true |
[
{
"role": "user",
"content": "Write javascript code for the following: Add stopwords which have little meaning and can be excluded from analysis for Chinese."
},
{
"role": "assistant",
"content": "/*\r\nCopyright (c) 2011, David Przybilla, Chris Umbel\r\n\r\nPermission is hereby granted, free of... | javascript | new_file | 0 | 0 | mit | 943e66b8b52cadeb4959378b608cc91ed2d28cb4 | ahmedshuhel/natural,kjhenner/natural,PTaylour/natural,NaturalNode/natural,mamaral/natural,Hugo-ter-Doest/natural,itamayo/natural,mcanthony/natural,walkingdoctors/natural,dpraimeyuu/natural,levy5674/natural,moos/natural,PMSI-AlignAlytics/natural,karimsa/natural,Logicify/natural,polymaths/natural | lib/natural/util/stopwords_zh.js | accepted | null | true |
[
{
"role": "user",
"content": "Write javascript code for the following: Test case for addCreateAndModified plugin"
},
{
"role": "assistant",
"content": "var vows = require('vows')\n , assert = require('assert')\n , mongoose = require('mongoose')\n , timestamp = require('../lib/addCreatedAndMod... | javascript | new_file | 0 | 1 | mit | 51fab14d010e8187d2691f205439722faac03837 | tblobaum/mongoose-troop,janez89/mongoose-utilities,iliakan/mongoose-troop | test/addCreateAndModified-test.js | rejected_duplicate | Near-duplicate of sample 86497 | true |
[
{
"role": "user",
"content": "Write javascript code for the following: Test for gjs style report"
},
{
"role": "assistant",
"content": "'use strict';\n\nvar deferred = require('deferred');\n\nmodule.exports = function (t, a) {\n\tvar report = [{ message: 'Lorem ipsum', character: 1, line: 1 }], ... | javascript | new_file | 0 | 1 | mit | 5b98216ecbcff1bd99ffd8f98630a069d4ad3f2b | medikoo/xlint,medikoo/xlint | test/reporters/console-gjs.js | accepted | null | true |
[
{
"role": "user",
"content": "Write javascript code for the following: Add a test program for an initiator context"
},
{
"role": "assistant",
"content": "var Buffer = require('buffer').Buffer;\nvar readline = require('readline');\n\nvar gss = require('./index.js');\n\nvar creds = gss.acquireCred... | javascript | new_file | 0 | 2 | mit | 846a954d365408a8571c30c22e88beb3c91bd949 | roost-im/node-gss,roost-im/node-gss,roost-im/node-gss | context-test.js | accepted | null | true |
[
{
"role": "user",
"content": "Write javascript code for the following: Add chapter 15, exercise 3"
},
{
"role": "assistant",
"content": "function asTabs(node) {\n\tfor (let child of node.children) {\n\t\tlet label = child.getAttribute(\"data-tabname\");\n\t\tlet button = document.createElement(\... | javascript | new_file | 0 | 3 | mit | 16e3b3de48b4ee6d391d647ab49dc92e3347204c | bewuethr/ctci | eloquent_js/chapter15/ch15_ex03.js | accepted | null | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.