messages listlengths 2 2 | language stringclasses 8
values | prompt_type stringclasses 2
values | lint_errors int64 0 129 ⌀ | cyclomatic_complexity int64 0 32 ⌀ | license stringclasses 7
values | commit stringlengths 40 40 | repos stringlengths 5 116k | new_file stringlengths 4 220 | status stringclasses 6
values | error stringlengths 26 74 ⌀ | is_valid_syntax bool 2
classes |
|---|---|---|---|---|---|---|---|---|---|---|---|
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nimport React from 'react';\n\nimport AddTodoForm from './AddTodoForm';\nimport TodoList from './TodoList';\n\nexport default class App extends React.Component {\n state = {\n todos: []\n }\n\n render() {\n return (\n <div ... | javascript | edit | 0 | 1 | cc0-1.0 | 634a449e715b19994522db58c3de4695ab89be1a | ksmithbaylor/react-todo-list,ksmithbaylor/react-todo-list | src/TodoApp/index.js | rejected_duplicate | Near-duplicate of sample 76915 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nimport React, { Component, PropTypes } from 'react';\nimport { connect } from 'react-redux';\nimport RecordIcon from 'react-icons/lib/md/fiber-manual-record';\nimport StopIcon from 'react-icons/lib/md/stop';\nimport Button from '../Butt... | javascript | edit | 0 | 3 | mit | d997ad3718fde8040a84288957ec7474067b439d | zalmoxisus/remotedev-app,zalmoxisus/remotedev-app | src/app/components/buttons/RecordButton.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n$.fn.informantSubscribeForm = function (options) {\n var settings = $.extend({\n renderResults: false,\n resultContainer: null\n }, options);\n\n this.each(function () {\n var self = $(this);\n \n ... | javascript | edit | 0 | 2 | mit | 6d5a764d7004738fe38ce6d6d9edf22d1b068709 | fragaria/django-informant,fragaria/django-informant | informant/static/js/jquery.informantSubscribeForm.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nvar rimraf = require(\"rimraf\");\nvar async = require(\"async\");\nvar path = require(\"path\");\nvar fs = require(\"fs\");\n\nfunction symlinkDep(src, dest, callback) {\n fs.symlink(src, dest, \"dir\", callback);\n}\n\nfunctio... | javascript | edit | 0 | 7 | mit | d1c0f6f91d7377c9fe1ef02b70d395143fa0781d | lerna/lerna,kittens/lerna,tbayaa/lerna,dmfenton/lerna,sveisvei/lerna,evocateur/lerna,treshugart/lerna,onigoetz/lerna-hg,lerna/lerna,sebmck/lerna,doug-wade/lerna,evocateur/lerna,asini/asini,lerna/lerna,FaHeymann/lerna | lib/commands/bootstrap/linkDependenciesForPackage.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nmodule.exports = {\n all: {\n options: {\n separator: ';',\n },\n files: {\n 'dist/js/lib.js': [\n 'src/javascript/lib/jquery.js', \n 'src/javascript/lib/highst... | javascript | edit | 0 | 0 | apache-2.0 | 677b17e686e1ea8217e61adecb26626ac3cf8f1d | animeshsaxena/binary-static,borisyankov/binary-static,borisyankov/binary-static,brodiecapel16/binary-static,massihx/binary-static,junbon/binary-static-www2,brodiecapel16/binary-static,junbon/binary-static-www2,massihx/binary-static,tfoertsch/binary-static,massihx/binary-static,einhverfr/binary-static,massihx/binary-sta... | build/concat.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n/*jslint unparam: true, browser: true, indent: 2 */\n;(function ($, window, document, undefined) {\n 'use strict';\n\n Foundation.libs.tab = {\n name : 'tab',\n\n version : '5.0.3',\n\n settings : {\n active_class: 'acti... | javascript | edit | 0 | 2 | mit | 6a669cc7f7873d28c890ccce6b237c3830edcfd9 | andycochran/foundation-sites,r14r-work/fork_foundation_master,youprofit/foundation,birthdayalex/foundation,NikhilKalige/foundation,stanwmusic/foundation,marcosvicente/foundation,zurb/foundation,DouglasAllen/css-foundation,sashaegorov/foundation-sites,celsoyh/foundation,laantorchaweb/foundation,zurb/foundation,glunco/fo... | js/foundation/foundation.tab.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nimport { join } from 'path';\n\nexport default {\n output: {\n path: join(__dirname, '../dist/js'),\n filename: 'bundle.js',\n libraryTarget: 'commonjs2',\n },\n plugins: [\n ],\n resolve: {\n extensions: ['', '.js'],\n... | javascript | edit | 0 | 0 | mit | 4be302af5a33263d667a94fbbb1ff9cc8b8dd33a | jhen0409/react-native-debugger,jhen0409/react-native-debugger,jhen0409/react-native-debugger | webpack/base.babel.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nimport React, { Component, PropTypes } from 'react';\nimport { Label } from 'react-bootstrap';\n\nexport class TimeSlot extends Component {\n render() {\n const { onChange, selected, slot } = this.props;\n\n return (\n <tr c... | javascript | edit | 0 | 6 | mit | 413a2ee3905b12ac2623f20c590e184facdbd624 | fastmonkeys/respa-ui | app/components/reservation/TimeSlot.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nmartinCostello = {\n website: {\n branch: $(\"meta[name='x-site-branch']\").attr(\"content\"),\n revision: $(\"meta[name='x-site-revision']\").attr(\"content\")\n }\n};\n\n```\n\nApply this change: Add function to s... | javascript | edit | 0 | 2 | apache-2.0 | 21845940ecc3abcb81f9bf4a5b59d9cc67823d30 | martincostello/website,martincostello/website,martincostello/website,martincostello/website | src/Website/Assets/Scripts/js/site.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nApplication.Services.factory('tags', [\"mcapi\",\n function tags(mcapi) {\n var service = {\n tags: [],\n\n createTag: function (tag, item_id) {\n mcapi('/tags/item/%', item_id)\n ... | javascript | edit | 0 | 1 | mit | c9478ecd104e2693876263861002481c3921da31 | materials-commons/materialscommons.org,materials-commons/materialscommons.org,materials-commons/materialscommons.org,materials-commons/materialscommons.org,materials-commons/materialscommons.org | website/app/application/services/tags.js | rejected_duplicate | Near-duplicate of sample 84162 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nTC.control = TC.control || {};\r\n\r\nif (!TC.Control) {\r\n TC.syncLoadJS(TC.apiLocation + 'TC/Control');\r\n}\r\n\r\nTC.control.NavBar = function () {\r\n TC.Control.apply(this, arguments);\r\n};\r\n\r\nTC.inherit(TC.control.Na... | javascript | edit | 0 | 2 | bsd-2-clause | cdebd6bdd109c39732a6c3ad60bbea3225bf9327 | sitna/api-sitna,sitna/api-sitna | TC/control/NavBar.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nimport axios from 'axios';\nimport cheerio from 'cheerio';\n\nconst USER_AGENT =\n 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2227.1 Safari/537.36';\n\nfunction inferTitle(url) {... | javascript | edit | 0 | 1 | bsd-2-clause | bd89f90a3d77f3a2694c5b179177cdac914070c5 | skewedlines/Nativefier,skewedlines/Nativefier,jiahaog/Nativefier,jiahaog/Nativefier,skewedlines/Nativefier,gfpacheco/Nativefier,gfpacheco/Nativefier,jiahaog/Nativefier,gfpacheco/Nativefier | src/infer/inferTitle.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nvar path = require('path');\nvar webappengine = require('webappengine');\nvar cncserver = require('./dist/app/cncserver');\nvar options = {\n port: 8000,\n routes: [\n {\n type: 'server',\n route: '/',... | javascript | edit | 0 | 0 | mit | 89e36cc3beb7dbef072e8702cbd5397a978fea9b | cheton/cnc,cncjs/cncjs,cheton/piduino-grbl,cncjs/cncjs,cncjs/cncjs,cheton/cnc,cheton/cnc.js,cheton/piduino-grbl,cheton/cnc.js,cheton/cnc,cheton/cnc.js,cheton/piduino-grbl | index.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nvar url = require('url');\nvar express = require('express');\nvar router = express.Router();\nvar request = require(\"request\");\nrouter.get('/', function (req, res) {\n res.render('index', {title: 'Github User Search'});\n});\n\n\n... | javascript | edit | 0 | 3 | mit | a9dcefcbefe45b8ab86533f2f1821dd14611fc23 | m301/node-github-search,m301/node-github-search | routes/index.js | rejected_duplicate | Near-duplicate of sample 85061 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n/* eslint-disable no-unused-vars */\n\nimport 'babel-polyfill'\nimport postcss from 'postcss'\nimport path from 'path'\nimport fs from 'fs'\n\nimport nesting from 'postcss-nesting'\n\n\nconst getRoot = atRule => {\n let rule = atRule\n... | javascript | edit | 0 | 5 | mit | 1f64ad97d91804370885d96c9acc31e37e0c63c4 | Nitive/postcss-extract | index.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nvar express = require('express');\nvar router = express.Router();\n\n/* GET home page. */\nrouter.get('/', function(req, res, next) {\n res.render('index', { title: 'Express' });\n});\n\n\n\nmodule.exports = router;\n\n```\n\nApply thi... | javascript | edit | 0 | 1 | mit | 3293e06730281195805f8f66fd81c25d16d626be | michael-lowe-nz/ageGuessAPI,michael-lowe-nz/ageGuessAPI | routes/index.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nimport Ember from 'ember';\n\nconst {\n get,\n Mixin\n} = Ember;\n\nexport default Mixin.create({\n resetController() {\n let model = get(this, 'controller.model');\n\n if (!get(model, 'isDeleted')) {\n model.rollbackAttri... | javascript | edit | 0 | 3 | mit | d76c074597b81c65b4a70282372bbe32bd487df3 | dockyard/ember-data-route,dockyard/ember-data-route | addon/index.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n/**\n * (c) 2016 Tieto Finland Oy\n * Licensed under the MIT license.\n */\n'use strict';\n\n/**\n * @ngdoc function\n * @name dashboard.controller:helpDialogCtrl\n * @description\n * # infoDialogCtrl\n * Controller of the dashboard\n *... | javascript | edit | 0 | 1 | mit | e1daacb113bacacad83a061d60fb0c591b95abdb | ahjo-dashboard/dashboard-ui,tkenakka/dashboard-ui,ahjo-dashboard/dashboard-ui,tkenakka/dashboard-ui,evidentti/dashboard-ui,evidentti/dashboard-ui | app/scripts/controllers/help.mtg.ctrl.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n'use strict';\nvar defaults = require('defaults'),\n\t\tthrough = require('through2'),\n\t\tgetLicenseTemplate = require('./lib/licenseTemplateStore').get,\n\t\tprefixStream = require('./lib/prefixStream');\n\nmodule.exports = function(... | javascript | edit | 0 | 4 | mit | 7b913dabc7e53fb51733664a2316d05f3a8b617d | adoyle-h/gulp-license,terinjokes/gulp-license | index.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n'use strict';\n\nvar uniq = require('lodash.uniq')\n\nvar CssSelectorParser = require('css-selector-parser').CssSelectorParser\nvar cssSelector = new CssSelectorParser()\n\ncssSelector.registerSelectorPseudos('not')\ncssSelector.registe... | javascript | edit | 0 | 5 | mit | d71d5998c36ddaf45c5ccb19e5cb5ef907f099ff | andrezsanchez/css-selector-classes | index.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nfunction serveFromCacheOrNetwork(request) {\n if (request.headers.get('X-Cache-Only') == 'true') {\n return shed.cacheOnly(request).then(function(response) {\n if (response) {\n return response;\n } else {\n ... | javascript | edit | 0 | 2 | apache-2.0 | 31a98adc9c335a3d8d0a6318eec78d0e8ea1ea8c | jeffposnick/ioweb2015,Thiruppathi/ioweb2015,BLamy/ioweb2015,jeffposnick/ioweb2015,Thiruppathi/ioweb2015,GoogleChrome/ioweb2015,BLamy/ioweb2015,jeffposnick/ioweb2015,Thiruppathi/ioweb2015,google/ioweb2015,b-cuts/ioweb2015,BLamy/ioweb2015,google/ioweb2015,GoogleChrome/ioweb2015,BLamy/ioweb2015,b-cuts/ioweb2015,b-cuts/iow... | app/scripts/shed/cache-then-network.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nmodule.exports = Select;\n\nfunction Select() {}\n\nSelect.prototype.view = __dirname + '/views';\nSelect.prototype.style = __dirname + '/styles';\nSelect.prototype.name = 'select';\nSelect.prototype.components = [];\n\nrequire('./opera... | javascript | edit | 0 | 4 | mit | 46051480dc6e713bf920c03d2ee4f408c635ae1a | BBWeb/d-md-components,BBWeb/d-md-components | select/index.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\ndraft.View = class View extends draft.Element {\n /* render(renderer) {\n this['render' + renderer.toUpperCase()]();\n } */\n\n get aspectRatio() {\n var width = draft.px(this.prop('width'));\n var height = draft.px(this.pro... | javascript | edit | 0 | 2 | mit | ea6453fc058f1c7724e62492ecffb747ac14315e | D1SC0tech/draft.js,D1SC0tech/draft.js | src/elements/view.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n/**\n * Converts breakpoint units in px to rem or em\n * @param {Object} breakpoints - an object containing breakpoint names as keys and the width as value\n * @param {number} [16] ratio - size of 1 rem in px. What is your main font-siz... | javascript | edit | 0 | 3 | mit | 16bdcf171f8ecdaa20956f278822814901acf78e | morajabi/styled-media-query | src/convertors.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nimport { createElement } from './create-element.js';\nimport { parseArguments, isString, isNode } from './util.js';\n\nconst ns = 'http://www.w3.org/2000/svg';\n\nconst svgCache = {};\n\nconst memoizeSVG = query => svgCache[query] || (s... | javascript | edit | 0 | 4 | mit | acec5b56ce1d9cb1bcab30837fc541fa877424c4 | pakastin/redom,redom/redom | esm/svg.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nvar nconf = require('nconf');\n\nnconf\n .file({ file: './config/config.json' })\n .env();\n\nnconf.defaults({\n 'RIPPLE_REST_API': 'http://localhost:5990',\n 'DATABASE_URL': 'postgres://postgres:password@localhost:5432/ripple_gatew... | javascript | edit | 0 | 0 | isc | 52a657f2619693477c39cdf83a3b1806ca5f58df | whotooktwarden/gatewayd,zealord/gatewayd,zealord/gatewayd,whotooktwarden/gatewayd,crazyquark/gatewayd,xdv/gatewayd,Parkjeahwan/awegeeks,xdv/gatewayd,Parkjeahwan/awegeeks,crazyquark/gatewayd | config/nconf.js | rejected_duplicate | Near-duplicate of sample 92775 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n// Copyright (c) 2014 Readium Foundation and/or its licensees. All rights reserved.\n//\n// Redistribution and use in source and binary forms, with or without modification,\n// are permitted provided that the following conditions are... | javascript | edit | 0 | 2 | bsd-3-clause | 65c111b5b34da754266ceec11b8b8c32dfb10a80 | readium/readium-cfi-js,pmstss/readium-cfi-js,pmstss/readium-cfi-js | build-config/RequireJS_config_browser.js | rejected_duplicate | Near-duplicate of sample 68258 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nconst Random = require('random-js')\n\nconst stringLength = 16\n\nconst uniqueId = function() {\n const randomEngine = Random.engines.mt19937().autoSeed();\n const randomDistrib = Random.string();\n\n return randomDistrib(rando... | javascript | edit | 0 | 1 | bsd-3-clause | a2808d7565235ff008d4f82600e942595354446a | borisceranic/uniqider | index.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n'use strict';\n\nvar through = require('through2');\nvar objectPath = require('object-path');\nvar File = require('vinyl');\nvar deepAssign = require('deep-assign');\nvar path = require('path');\n\nmodule.exports = function jsonBundler(... | javascript | edit | 0 | 1 | mit | b57575173dc0de4d74cda6e063703086d8f26e49 | wunderflats/gulp-json-bundler | index.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n'use strict';\n\nvar angular = require('angular');\n\n// angular modules\nrequire('angular-ui-router');\nrequire('angular-animate');\nrequire('angular-moment');\nrequire('angular-loading-bar');\nrequire('./templates');\nrequire('./contr... | javascript | edit | 0 | 1 | mit | e76443ae9f5eed21e561fdb45014db92d33e762a | loklak/loklak_webclient,aayusharora/loklak_webclient,aayusharora/loklak_webclient,codethejason/loklak_webclient,loklak/loklak_webclient,codethejason/loklak_webclient,aayusharora/loklak_webclient,loklak/loklak_webclient,codethejason/loklak_webclient | app/js/main.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n// Define search and replace terms for image src link\nlet search = /\\/s[0-9]+/g;\nlet replace = 's512';\n\nfunction getProfileImageContainer() {\n // Get profile image containers\n return $('#channel-header-container');\n}\n\nfu... | javascript | edit | 0 | 3 | apache-2.0 | 3c37adc0facfa0dd5cbed6a21dc8f49ee1a94374 | eladnava/enlarge-profile-image-for-youtube | assets/js/content.js | rejected_duplicate | Near-duplicate of sample 75950 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nfunction render(template, model) {\n var data = toJsonObject(model);\n return new EJS({text: template}).render({data: data});\n}\n\n/* Create a real JSON object from the model Map
. You can't pass the model directly\n * into EJS -... | javascript | edit | 0 | 1 | mit | ad115c52ac616b683ba275705a8fdde9de673c04 | pugnascotia/spring-react-boilerplate,pugnascotia/spring-react-boilerplate,fernandojunior/spring-react-boilerplate,fernandojunior/spring-react-boilerplate,pugnascotia/spring-react-boilerplate,fernandojunior/spring-react-boilerplate,pugnascotia/spring-react-boilerplate | src/main/resources/static/js/render.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nimport quotes from '../util/quotes.js';\n\nexport default {\n isLoggedIn: false,\n\n showMenu: false,\n circleIcons: true,\n toast: null,\n\n quote: {\n text: null,\n author: null,\n current: Math.flo... | javascript | edit | 0 | 0 | mit | 8f13e29d7028e093f3e166e4153c0c5c9961d7c5 | benct/tomlin-web,benct/tomlin-web | app/scripts/redux/defaultState.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n(function($){\n\n $.fn.arrowPopup = function(popupSelector, arrowDirection) {\n var popup = $(popupSelector);\n var offset = $(this).offset();\n arrowDirection = arrowDirection || 'up';\n\n var left = 0;\n... | javascript | edit | 0 | 6 | mit | aecc91a20d029d2f532e35fe8e9986ca2bfe2f24 | youtify/youtify,youtify/youtify,youtify/youtify | scripts/jquery.arrowpopup.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n'use strict';\nrequire('es6-promise').polyfill();\nrequire('whatwg-fetch');\n\nconst url = require('url'),\n querystring = require('querystring').parse,\n githubUrl = require('github-url-from-git');\n\nconst registry = 'http:/... | javascript | edit | 0 | 3 | mit | e1c97da9e7e56e80095033515c49bbaebde33b0b | npmdocs/www | index.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nvar minify = require('html-minifier').minify\n , loaderUtils = require('loader-utils')\n\nmodule.exports = function(source) {\n this.cacheable && this.cacheable()\n var defaultOptions = {\n removeComments: true,\n colla... | javascript | edit | 0 | 5 | mit | ed225fd8321c201931d3301286261c295d7b9df3 | sapics/html-minifier-loader | index.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nmodule.exports = [\n {\n \"text\": \"Supported hardware\",\n \"link\": \"/#supported\",\n \"scroll\": \"true\"\n },\n {\n \"modal\": true,\n \"id\": \"signup\",\n \"text\": \"Sign up\"\... | javascript | edit | 0 | 0 | mit | 7f534d76b896c78cbb71d097c7048426bff52467 | alexbirkett/ten20homepage,alexbirkett/ten20homepage,alexbirkett/ten20homepage | app/config/sections/nav.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nmodule.exports = function (grunt) {\n\n // config\n grunt.initConfig({\n\n less: {\n build: {\n expand: true,\n cwd: 'src/less/',\n src: ['**/*.less'],\n ... | javascript | edit | null | null | mit | 3dad61cf3510f4c8df3e43ee3b5fe5cd00b54d4f | yajamon/nw-timer,yajamon/nw-timer | Gruntfile.js | rejected_syntax | Syntax error detected by tree-sitter | false |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nvar extent = require('turf-extent');\nvar bboxPolygon = require('turf-bbox-polygon');\n\n/**\n* Takes a {@link Feature} or {@link FeatureCollection} and returns a rectangular {@link Polygon} feature that encompasses all vertices.\n*\n* ... | javascript | edit | 0 | 1 | mit | ebaf37237660be5ce8e984952cd325f3dfc8ba31 | Turfjs/turf-envelope | index.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nvar fs = require( \"fs\" );\nvar mkdirp = require( \"mkdirp\" );\nvar path = require( \"path\" );\nvar slash = require( \"slash\" );\nvar through = require( \"through2\" );\n\nmodule.exports = function( pugFile, options ) {\n... | javascript | edit | 0 | 4 | mit | 94d4d4f4b468ddc48174c556960cceaf3d6351fa | oliversalzburg/gulp-jade-script,oliversalzburg/gulp-pug-script | index.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n'use strict';\n\nvar\n server = require('./lib/server'),\n _ = require('lodash'),\n path = require('path'),\n _server = null;\n\nfunction middleware(options, files, metalsmith, next) {\n if(_server) {\n return next();\... | javascript | edit | 0 | 3 | mit | 46fe78dda29ec7b907fce7524ea2c521f5633197 | chiefy/metalsmith-express | index.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nvar express = require('express');\nvar app = express();\n\nvar PORT = process.env.PORT || 3000;\n\napp.use(function(req, res, next) {\n res.setHeader('Strict-Transport-Security', 'max-age=600');\n res.setHeader('Content-Security-Polic... | javascript | edit | 0 | 1 | mit | 7b7659a406005dd750e37ceb93996ebb1b927bbc | heroku/quick-fix,heroku/quick-fix | index.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n'use strict';\n\nconst AWS = require('aws-sdk');\nconst codePipeline = new AWS.CodePipeline();\n\nexports.handler = (event, context, callback) => {\n const jobData = event['CodePipeline.job'].data;\n const jobId = event['CodePipel... | javascript | edit | null | null | mit | d444e09ccc6a7a8e2213480b3082fbaa7b9ccbaf | Yarovoy/codepipeline-to-s3 | index.js | rejected_syntax | Syntax error detected by tree-sitter | false |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nprocess.env.NODE_ENV = 'test';\n\nconst supertest = require('supertest');\nconst chai = require('chai');\nconst chaiHttp = require('chai-http');\n\nconst app = require('../app.js');\n\nconst request = supertest(app);\n\nconst expect = c... | javascript | edit | 0 | 2 | mit | c6459543e62fdd92e5bf2293772ad797d607aca6 | ayeniblessing101/Post_It,ayeniblessing101/Post_It | app/server/test/siginin.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nconst Alexa = require('alexa-sdk');\nconst fs = require('fs');\nconst path = require('path');\n\nconst { appId, dbName } = process.env;\n\n// loads all modules in handlers folder\nconst allHandlers = [];\nfs.readdirSync(path.join(__dirn... | javascript | edit | 0 | 2 | mit | 7514d19c00bf465ae20e883e72eebf1e09873edb | thomasmunduchira/myq-home-alexa,thomasmunduchira/myq-home-alexa | index.js | accepted | null | true |
[
{
"role": "user",
"content": "Write javascript code for the following: Rename keyCodes export to keySyms"
},
{
"role": "assistant",
"content": "var NativeExtension = require('bindings')('NativeExtension');\nmodule.exports = NativeExtension;\nmodule.exports.keySyms = require('./keysymdef');\n"
... | javascript | new_file | 0 | 0 | mit | a3e9cb31f5445d7ea393c8fd4e3ba1442a7a809f | jfr3000/node-xtest-bindings,jfr3000/node-xtest-bindings,jfr3000/node-xtest-bindings,jfr3000/node-xtest-bindings | index.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n#!/usr/bin/env node\n\nglobal.__base = __dirname + '/src/';\n\n// Commands\nvar cli = require('commander');\n\ncli\n .version('0.0.1')\n .option('-p, --port <port>' , 'Change static server port [8000]', 8000)\n .option('-P... | javascript | edit | 0 | 0 | mit | 5c8fcde284004d10ef805cb425f254472c52229d | eth0lo/slr | index.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n'use strict';\n\nvar Cesium = require('cesium');\nvar fsExtra = require('fs-extra');\nvar nconf = require('nconf');\nvar Promise = require('bluebird');\n\nvar defined = Cesium.defined;\n\nnconf.env('__')\n .file({\n file: 'con... | javascript | edit | 0 | 2 | apache-2.0 | c89d915109c31c18daf97fd3fe7b928bfd95f6c2 | AnalyticalGraphicsInc/cesium-concierge,AnalyticalGraphicsInc/cesium-concierge | lib/Settings.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n#!/usr/bin/env node\n\n\"use strict\";\n\nvar bunyan = require(\"bunyan\");\nvar ss = require(\"stream-splitter\");\n\nvar lineFormat = /(\\d{4})\\/(\\d{2})\\/(\\d{2}) (\\d{2}):(\\d{2}):(\\d{2}) /;\nvar tagFormat = /([\\w.]+): /;\n\nvar... | javascript | edit | 0 | 4 | mit | 8a1801e7b1fecd9d639a9dab8b6dcb54175c03b9 | samcday/etcd-json-logs | index.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nvar grunt = require('grunt');\nrequire('load-grunt-tasks')(grunt);\n\nvar files = ['test/*.js'];\n\ngrunt.initConfig({\n mochacli: {\n options: {\n reporter: 'spec',\n bail: false\n },\n all: files\n }... | javascript | edit | 0 | 0 | mit | 0213ea2236c23e0fd77ead86500df9beba0d07af | sazeesha/azure-quickstart-templates,uday31in/azure-quickstart-templates,Volkanco/azure-quickstart-templates,ShubhaVijayasarathy/azure-quickstart-templates,Envera/azure-quickstart-templates,gossion/azure-quickstart-templates,liupeirong/azure-quickstart-templates,lizzha/azure-quickstart-templates,BorisB2015/azure-quickst... | Gruntfile.js | rejected_duplicate | Near-duplicate of sample 76927 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nvar MonitoringPlugin = function () {\n};\n\nMonitoringPlugin.prototype.sendMetrics = function () {\n console.log('Im running:', this.engine.nTasksLeft.toString(), 'tasks');\n};\n\nMonitoringPlugin.prototype.init = function (rcl, wfli... | javascript | edit | 0 | 3 | mit | 1a154ed63855cac6c4fb8300923b7729b5e750bc | dice-cyfronet/hyperflow-monitoring-plugin | index.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n\nvar hasOwn = Object.prototype.hasOwnProperty;\nvar toStr = Object.prototype.toString;\n\nmodule.exports = function forEach (obj, fn, ctx) {\n if (typeof obj !== 'object' || obj === null) {\n throw new TypeError('can only ite... | javascript | edit | 0 | 8 | mit | 2932748fae1e9d21609170251dd0256356876597 | manuelstofer/foreach,ellipticaljs/foreach,npmcomponent/manuelstofer-foreach,LeoOnTheEarth/foreach,tachyon1337/foreach | index.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n/**\n * Author: petar bojinov - @pbojinov\n * Date: 9/29/13\n */\n\n/**\n * @method getClientIp\n *\n * Get client IP address\n *\n * Will return 127.0.0.1 when testing locally\n * Useful when you need the user ip for geolocation or ser... | javascript | edit | 0 | 5 | mit | e533009516c885889206961ef151811f53ba4d0d | pbojinov/request-ip,andfaulkner/request-ip | index.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n\"use strict\";\n\nmodule.exports = function (grunt) {\n grunt.initConfig({\n eslint: {\n options: {\n config: \".eslintrc\"\n },\n src: [\n \"Gruntfile.js\",\n ... | javascript | edit | 0 | 1 | mit | 7e1fb9d49766eba1cea53adbd4f1524ff773bd6f | albertosantini/argo-trading-plugin-seed | Gruntfile.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nvar express = require('express');\nvar superagent = require('superagent');\n\nvar constants = require('../constants');\n\n\nvar proxy_headers = [\n 'Accept-Charset',\n 'Accept-Language',\n 'Accept-Datetime',\n 'User-Agent',\... | javascript | edit | 0 | 2 | mit | 6382bb2b240af9fbbcc50e478411e30916f1e62c | AlmostBetterNetwork/almostbetter.net,AlmostBetterNetwork/almostbetter.net | src/modules/feeds.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n\"use strict\";\nvar Promise = require(\"bluebird\");\nvar LRU = require(\"lru-cache-plus\");\n\nfunction buildCache() {\n return new LRU({\n length: function (v) {\n return v && v.length || 1;\n }\n });\n}\n\nfunction Asyn... | javascript | edit | 0 | 3 | mit | 18d326e7c3b4bf02e4ea92914c095ae80c805997 | ExpressenAB/exp-asynccache | index.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n'use strict'\n\nvar http = require('http')\nvar https = require('https')\nvar url = require('url')\nvar config = require('./config')\n\nfunction ping (cb) {\n if (url.parse(config.registry).protocol === 'https:') {\n http = https\n ... | javascript | edit | 0 | 3 | mit | 566dd0ff484643781d51d356623b54f42fb5d92d | alexanderGugel/ied,alexanderGugel/mpm | lib/ping_cmd.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n// Copyright (C) 2006 Google Inc.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// ht... | javascript | edit | 0 | 0 | apache-2.0 | 451813a77b10040e9bf82e31f55aa5e16041795a | ProjectSoft-STUDIONIONS/prettify,ProjectSoft-STUDIONIONS/prettify | src/lang-proto.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nexport default {\n\tbaseUrl: 'https://api.particle.io/',\n\tclientSecret: 'particle-api',\n\tclientId: 'particle-api',\n\ttokenDuration: 7776000, // 90 days\n};\n\n```\n\nApply this change: Remove trailing slash from baseUrl\n\nFixes #7... | javascript | edit | 0 | 0 | apache-2.0 | 39ef03edcd79ddf4e1e15afe6fd9e0edd653b1f4 | spark/particle-api-js,spark/particle-api-js | src/Defaults.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nimport React from 'react';\nimport css from './FilterPaneSearch.css';\nimport Icon from '../Icon';\nimport Button from '../Button';\n\nclass FilterPaneSearch extends React.Component{\n constructor(props){\n super(props);\n this.s... | javascript | edit | 0 | 1 | apache-2.0 | 4e0e6140c03bd1b6b00592b3bffe3c0de1ff96e3 | folio-org/stripes-components,folio-org/stripes-components | lib/FilterPaneSearch/FilterPaneSearch.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nimport { Observable } from 'rxjs/Observable'\nimport { of } from 'rxjs/observable/of'\nimport { merge } from 'rxjs/observable/merge'\nimport { delay } from 'rxjs/operator/delay'\nimport { takeUntil } from 'rxjs/operator/takeUntil'\nimpo... | javascript | edit | null | null | cc0-1.0 | d059451416bf9477e2aa9af7b880b0e401618c4f | philpl/rxjs-diagrams | src/models/emissions/makeVirtualStream.js | rejected_syntax | Syntax error detected by tree-sitter | false |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nmodule.exports = {\n all: {\n files: [\n {\n expand: true,\n src: [\n 'index.html',\n '404.html',\n 'sitemap.xml',\n ... | javascript | edit | 0 | 0 | apache-2.0 | d5a06fb616b5dc1453daa746d84ceff7b02411b2 | raunakkathuria/binary-static,binary-com/binary-static,negar-binary/binary-static,kellybinary/binary-static,kellybinary/binary-static,ashkanx/binary-static,4p00rv/binary-static,binary-static-deployed/binary-static,ashkanx/binary-static,4p00rv/binary-static,negar-binary/binary-static,kellybinary/binary-static,4p00rv/bina... | build/copy.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n\"use strict\";\n\nmodule.exports = function (grunt) {\n grunt.initConfig({\n bump: {\n options: {\n files: [\"package.json\"],\n commit: true,\n commitMessage: \"Release... | javascript | edit | 0 | 1 | bsd-2-clause | e601d9880267a0256a8117b6cbf29113f1a26143 | jhliberty/droppy,jhliberty/droppy,silverwind/droppy,silverwind/droppy,silverwind/droppy | Gruntfile.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n(function (app, $) {\n app.events = app.events || function () {\n $.connection.hub.start();\n\n var timeout = 0;\n\n // try reconnect if disconnected\n $.connection.eventsHub.disconnected(function() {\n ... | javascript | edit | 0 | 5 | mit | cf42ef9dab74878d906d681274d3366a88989ae4 | RightpointLabs/Pourcast,RightpointLabs/Pourcast,RightpointLabs/Pourcast,RightpointLabs/Pourcast,RightpointLabs/Pourcast | RightpointLabs.Pourcast.Web/Scripts/app/pourcast.events.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n\n'use strict';\n\nvar https = require(\"https\"),\n EventEmitter = require('events');\n\n/**\n * Forward an error to another emitter.\n */\nvar forwardError = function (emitter) {\n return function (error) {\n emitter.emit... | javascript | edit | 0 | 2 | mit | 5d4fe6fb462dede1f5578f045beaf5ab51df82a1 | mattunderscorechampion/uk-petitions,mattunderscorechampion/uk-petitions | src/petition-util.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nvar init_dashboard = function(id, columns, preferences, url) {\n $('#'+id).dashboard({\n 'columns': columns,\n 'load_preferences_function': function(options) {\n return preferences;\n },\n 'save... | javascript | edit | 0 | 1 | mit | 31bb11449c7963453f8296feb0f510c154ec41d2 | liberation/django-admin-tools,liberation/django-admin-tools,liberation/django-admin-tools,liberation/django-admin-tools | admin_tools/dashboard/static/admin_tools/js/dashboard.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n$(document).ready(function () {\n $.fancybox.defaults.locales = $.extend({}, $.fancybox.defaults.locales, {\n ru: {\n CLOSE: Translator.trans('fancybox.close'),\n NEXT: Translator.trans('fancyb... | javascript | edit | 0 | 2 | mit | e9c19d37c6ad723e73f13e4f47af5d206b940d11 | DarvinStudio/DarvinAdminBundle,DarvinStudio/DarvinAdminBundle,DarvinStudio/DarvinAdminBundle | Resources/public/scripts/fancybox-init.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n//Load Roles\nvar deathCreeps = require('role.deathCreeps');\nvar spawnCreeps = require('role.spawnCreeps');\nvar roleHarvester = require('role.harvester');\nvar roleBuilder = require('role.builder');\nvar roleUpgrader = require('role.u... | javascript | edit | 0 | 5 | mit | fb3c6b1f77afdddf3aea29f27580805854d75ef7 | adleywd/screeps | default/main.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nclass View {\n static render(state){\n return TreeBuilder.build(h =>\n h(\"div\", {}\n , h(\"button\", {}, \"OK\")\n , h(\"input\", { type: \"checkbox\" })\n , h(\"a\", { href: \"#\" }, \"link \" + state.val)\n ... | javascript | edit | 0 | 1 | mit | 3e42a1bb8f10a629cb2a7edce9eeeb38651968c1 | sonota88/sinatra-skelton,sonota88/sinatra-skelton,sonota88/sinatra-skelton,sonota88/sinatra-skelton | app/public/js/page_index.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nangular.module('bolt.profile', ['bolt.auth'])\n\n.controller('ProfileController', function ($scope, $rootScope, Auth, Profile) {\n $rootScope.user = {};\n $scope.newInfo = {};\n\n var getUserInfo = function () {\n Profile.getUser(... | javascript | edit | 0 | 2 | mit | e9463f42bec57ac4bcfc0e1e590562dacc0e5e62 | gm758/Bolt,elliotaplant/Bolt,boisterousSplash/Bolt,elliotaplant/Bolt,thomasRhoffmann/Bolt,gm758/Bolt,boisterousSplash/Bolt,thomasRhoffmann/Bolt | client/app/controllers/profile.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nimport { combineReducers } from 'redux';\n\nimport quotes from './quotes';\nimport loading from './loading';\n\nexport default combineReducers({\n\tquotes,\n\tloading\n});\n```\n\nApply this change: Add backup as state tree"
},
{
... | javascript | edit | 0 | 0 | mit | 56a0380c9542f28ed5c7d8a7d12d442b8159fab3 | subramaniashiva/quotes-pwa,subramaniashiva/quotes-pwa | app/redux/reducers/root-reducer.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nimport PropTypes from 'prop-types';\nimport React from 'react';\nimport Select from '../select';\nimport { getY } from '../../index';\n\nconst choices = currentValue => () =>\n new Promise(resolve => {\n const gmId = getY().We... | javascript | edit | 0 | 3 | mit | 9706ddaa54592874f5f53a5dd28b4717da3d6fbb | Heigvd/Wegas,Heigvd/Wegas,Heigvd/Wegas,Heigvd/Wegas,Heigvd/Wegas | wegas-app/src/main/webapp/wegas-react-form/src/Views/Interacting/eventselect.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n'use strict';\n\nvar check = require('./check');\n\nmodule.exports = function globalCheck(source, value) {\n var checkResult = check(source, value);\n var error = [];\n if (!checkResult) {\n error.push('Check digit error... | javascript | edit | 0 | 2 | mit | 2f83107b03e355efd1b0d4098cce8dd2ba0cd5e3 | cheminfo-js/mrz | src/util/globalCheck.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nimport React from 'react'\n\nimport Base from './Base'\nimport Components from '../constants/QueryComponentConstants'\n\nconst ClickTokens = props => {\n const { field, ...others } = props\n return (\n <Base\n {...others}\n ... | javascript | edit | 0 | 1 | mit | 10c44fcf72156d7705660402891759807577fee7 | sajari/sajari-sdk-react,sajari/sajari-sdk-react | src/api-components/Tokens.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nimport React, { PropTypes } from 'react'\nimport {\n matchContext as matchContextType\n} from './PropTypes'\n\nclass MatchProvider extends React.Component {\n static propTypes = {\n match: PropTypes.any,\n children: PropTypes.no... | javascript | edit | 0 | 1 | mit | 8386c9cc983becb329b54f91db38e31a7906a4fd | goblortikus/react-router,DelvarWorld/react-router,ReactTraining/react-router,ReactTraining/react-router,asaf/react-router,rafrex/react-router,reactjs/react-router,OpenGov/react-router,rackt/react-router,goblortikus/react-router,d-oliveros/react-router,OpenGov/react-router,asaf/react-router,ReactTraining/react-router,d-... | modules/MatchProvider.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nimport ClimateVulnerability from 'components/country-compare/country-compare-climate-vulnerability/country-compare-climate-vulnerability';\n\nexport default [\n {\n hash: 'ghg-emissions',\n label: 'GHG Emissions',\n anchor: tr... | javascript | edit | 0 | 0 | mit | f9ff355e1067bf2f6589476bcc5fd1eb955e0ef9 | Vizzuality/climate-watch,Vizzuality/climate-watch,Vizzuality/climate-watch,Vizzuality/climate-watch | app/javascript/app/routes/app-routes/country-compare-sections/country-compare-sections.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n(function($) {\n module('Mutli-edit');\n\n test('Basic', function() {\n var multiEdit = {\n fields: {\n fieldA: { label: 'fieldA' },\n fieldB: { label: 'fieldB' },\n add: { label: 'add', addButton: true }\... | javascript | edit | 0 | 1 | apache-2.0 | ac00c64dc08149d78ba1556de7ac3bfc0a00b35d | argv0/cloudstack,mufaddalq/cloudstack-datera-driver,argv0/cloudstack,cinderella/incubator-cloudstack,jcshen007/cloudstack,DaanHoogland/cloudstack,DaanHoogland/cloudstack,cinderella/incubator-cloudstack,argv0/cloudstack,argv0/cloudstack,wido/cloudstack,jcshen007/cloudstack,resmo/cloudstack,resmo/cloudstack,GabrielBrasch... | ui/tests/test.multiEdit.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nmodule.exports = (function() {\n const environment = process.env.NODE_ENV || 'production';\n\n const prefixGet = function(body) {\n let id = `VOLONTARIO_${environment}_${body}`;\n let upperCaseId = id.toUpperCase();\n\n if (p... | javascript | edit | 0 | 3 | mit | f01c2ea62c1e7185a626d60c49117affd0f7a152 | volontario/volontario-server | app/config/config.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nimport React from 'react'\nimport Search from './Search'\nimport { shallow } from 'enzyme'\nimport { shallowToJson } from 'enzyme-to-json'\n\ntest('Search snapshot test', () => {\n const component = shallow(<Search />)\n const tree = ... | javascript | edit | 0 | 1 | mit | 0890134b7ec9138f5be0029edddb92dcfa7ce258 | jbarbettini/intro-to-react-workshop,jbarbettini/intro-to-react-workshop | js/Search.spec.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n// This is a manifest file that'll be compiled into including all the files listed below.\n// Add new JavaScript/Coffee code in separate files in this directory and they'll automatically\n// be included in the compiled file accessible f... | javascript | edit | 0 | 0 | mit | 0ee9a9dfebd99e54170187e58a81d01a792fd30a | cyclestreets/cyclescape,auto-mat/toolkit,cyclestreets/cyclescape,auto-mat/toolkit,cyclestreets/cyclescape | app/assets/javascripts/application.js | rejected_duplicate | Near-duplicate of sample 76815 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nvar cheerio = require('cheerio');\nvar _ = require('lodash');\nvar slug = require('github-slugid');\n\n// insert anchor link into section\nfunction insertAnchors(content) {\n var $ = cheerio.load(content);\n $(':header').each(func... | javascript | edit | 0 | 2 | apache-2.0 | d3f35a2510266de00cbef4734ddd60f2e3bedcf5 | rlmv/gitbook-plugin-anchors | index.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\ndefine(['mac/roman'], function(macintoshRoman) {\n\n 'use strict';\n \n return function(resource) {\n var dv = new DataView(resource.data.buffer, resource.data.byteOffset, resource.data.byteLength);\n resource.dataObject = {\n ... | javascript | edit | 0 | 1 | mit | 03dad3a6919fb766d8d767757ae7bb764b0d1296 | radishengine/drowsy,radishengine/drowsy | mac/resources/open_CNTL.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nvar es = require('event-stream');\nvar path = require('path');\nvar htmlv = require('html-validator');\n\nmodule.exports = function(options) {\n\n if (!options) options = {};\n if (!options.format) options.format = 'json';\n\n functi... | javascript | edit | 0 | 3 | mit | 7cadfe51825587641c1d5cdbfe62433b905217b2 | hoobdeebla/gulp-html-validator | index.js | accepted | null | true |
[
{
"role": "user",
"content": "Write javascript code for the following: Create handler. but most simple."
},
{
"role": "assistant",
"content": "'use streict';\n\nmodule.exports.handle = (event, context, callback) => {\n console.log('eventObject: %s', JSON.stringify(event, null, 2));\n callback(... | javascript | new_file | 0 | 1 | mit | 962d3ca0cbf9ddae3c09ae55054a1a030297b73a | mgi166/serverless-image-resizer | index.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nconst Promise = require('bluebird');\nconst argvSplit = require('argv-split');\nconst execa = require('execa');\nconst fs = Promise.promisifyAll(require('fs'));\nconst path = require('path');\n\nfunction history(histFile) {\n histFile ... | javascript | edit | 0 | 4 | mit | ea70e8517b2dc82f088443eaffa2cb98dd2996db | danasilver/zsh-history,danasilver/zsh-history | index.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n'use strict';\n\nconst {app, BrowserWindow, ipcMain} = require('electron');\nconst fs = require('fs');\nconst path = require('path');\n\napp.on('window-all-closed', () => {\n app.quit();\n});\n\napp.on('ready', () => {\n let mainWindo... | javascript | edit | 0 | 2 | mit | e1d6943bd8748c0759bf5e2e271bc9bd52c7a43d | hrysd/idobata-electron,hrysd/idobata-electron | index.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nconst discord = require('discord.js')\nconst fs = require(\"fs\")\nconst config = require('./config.json')\n\nconst client = new discord.Client()\n\nvar commands = new Map();\n\nclient.on('ready', () => {\n\tif(!config.prefix) con... | javascript | edit | 0 | 4 | mit | a49818573f27319b3ba58ba8b440fc826c6f3a86 | IanMurray/AnnuBot | index.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nmodule.exports = function logger() {\n return (ctx, next) => {\n const { username, first_name: firstName, last_name: lastName, id } = ctx.from;\n let content = null;\n\n switch (ctx.updateType) {\n case 'message':\n ... | javascript | edit | 0 | 6 | mit | 85f741f770fdca4ec57cb5700f019671ef87a04d | drvirtuozov/telegraf-logger | index.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n// Karma Edge Launcher\n// =================\n\n// Constructor\nfunction EdgeBrowser (baseBrowserDecorator) {\n baseBrowserDecorator(this)\n\n this._getOptions = function (url) {\n return [url, '-k']\n }\n}\n\nEdgeBrowser.prototyp... | javascript | edit | 0 | 1 | mit | 9c84ad1c78b413fb9870a27a4e0df97121ffef01 | nicolasmccurdy/karma-edge-launcher,karma-runner/karma-edge-launcher | index.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n'use strict';\n\nconst { NativeModules } = require('react-native');\nconst { RNI18n } = NativeModules;\nlet I18n = require('i18n-js');\n\nI18n.locale = (RNI18n) ? RNI18n.locale.replace(/_/, '-') : '';\n\nmodule.exports = I18n;\n\n```\n\... | javascript | edit | 0 | 0 | mit | 91662a4cda3f966c6e16088664bcbb7c3dec47d5 | AlexanderZaytsev/react-native-i18n,AlexanderZaytsev/react-native-i18n,AlexanderZaytsev/react-native-i18n,AlexanderZaytsev/react-native-i18n | index.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n'use strict'\n\nvar emoji = require('node-emoji')\n\n/**\n * Returns a string surrounded by the poop emoji (poomoji)\n * @param string\n */\n\nmodule.exports = function (string) {\n var string = string.trim()\n var poop = emoji.get('h... | javascript | edit | 0 | 3 | mit | d5008feb94f17cc32fe124d499947cdb5f48c1c1 | Charlotteis/poopthis | index.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n#!/usr/bin/env node\n\nconst chalk = require('chalk');\nconst yargs = require('yargs');\n\n// ./modules\nconst rocketLaunch = require('./lib/modules/rocketLaunch');\n\nvar argv = yargs\n .usage('Usage: $0 <command> [options]')\n .dema... | javascript | edit | 0 | 1 | mit | 0336bdbf32a0aefa6cfd24fac7398166a518f60d | Belar/space-cli | index.js | rejected_duplicate | Near-duplicate of sample 70857 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nvar dataModule = require('data-module');\nvar gutil = require('gulp-util');\nvar through2 = require('through2');\n\nvar DataModuleError = gutil.PluginError.bind(null, 'gulp-data-module');\n\n\nvar gulpDataModule = function gulpDataModul... | javascript | edit | 0 | 4 | mit | 6ca14e42fc3df9fb6a8661fde6950aa9399527e3 | tomekwi/gulp-data-module | index.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nPackage.describe({\n name: 'less',\n version: '2.7.9-beta.1',\n summary: 'Leaner CSS language',\n documentation: 'README.md'\n});\n\nPackage.registerBuildPlugin({\n name: \"compileLessBatch\",\n use: ['caching-compiler', 'ecmascri... | javascript | edit | 0 | 1 | mit | 6a4d76ef8e78ef2e764514596028817edc0921f1 | Hansoft/meteor,Hansoft/meteor,Hansoft/meteor,Hansoft/meteor,Hansoft/meteor,Hansoft/meteor,Hansoft/meteor | packages/less/package.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n/*jslint node:true indent:2 */\n'use strict';\n\nmodule.exports = function (req, res, next) {\n\n function sendResponse(code, json) {\n return res.status(code).json(json);\n }\n\n function getSuccessCode() {\n return req.method... | javascript | edit | 0 | 2 | mit | 306f82ed13185bc1ef7919d898f45410f9301d0f | rohanorton/proto-jSend,rohanorton/express-jSend | index.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nvar EXPORTED_SYMBOLS = [\"GM_notification\"];\n\nvar Cc = Components.classes;\nvar Ci = Components.interfaces;\n\n// The first time this runs, we check if nsIAlertsService is installed and\n// works. If it fails, we re-define notify to ... | javascript | edit | 0 | 3 | bsd-3-clause | 80dfbfce67cab0156963cdb479eec7ef3eaa2036 | HasClass0/greasemonkey,Ventero/greasemonkey,Ventero/greasemonkey,Martii/greasemonkey,the8472/greasemonkey,HasClass0/greasemonkey,Martii/greasemonkey,the8472/greasemonkey | modules/GM_notification.js | rejected_duplicate | Near-duplicate of sample 71078 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n/**\n * @license\n * Copyright 2017 The FOAM Authors. All Rights Reserved.\n * http://www.apache.org/licenses/LICENSE-2.0\n */\nfoam.CLASS({\n package: 'foam.nanos.auth',\n name: 'Phone',\n\n documentation: 'Phone number information.... | javascript | edit | 0 | 2 | apache-2.0 | 43bf393447c2399991cd01f4ecb5eec2f7c9c330 | foam-framework/foam2,jacksonic/vjlofvhjfgm,foam-framework/foam2,foam-framework/foam2,foam-framework/foam2,jacksonic/vjlofvhjfgm,jacksonic/vjlofvhjfgm,foam-framework/foam2 | src/foam/nanos/auth/Phone.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n'use strict';\nvar Filter = require('broccoli-filter');\nvar RSVP = require('rsvp');\nvar less = require('less');\n\nfunction LessFilter(inputTree, options) {\n\tif (!(this instanceof LessFilter)) {\n\t\treturn new LessFilter(inputTree,... | javascript | edit | 0 | 3 | mit | 50e60a091da6090afa69eb99d69c3128a77f5110 | joefiorini/broccoli-less | index.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nvar express = require('express');\nvar app = express();\nvar redis = require('redis').createClient(process.env.REDIS_URL);\n\nconsole.log(process.env.REDIS_URL);\n\napp.get('/', function(req, res){\n res.send('hello world');\n});\n\nap... | javascript | edit | 0 | 1 | mit | 97403abe04e708da5901ee79850d45afb1f22001 | codehackdays/HelloWorld | index.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n// don't include object's inherited properties in pretty printed output\njasmine.PrettyPrinter.prototype.iterateObject = function(obj, fn) {\n for (var property in obj) {\n if (!obj.hasOwnProperty(property)) continue; // our additio... | javascript | edit | 0 | 1 | apache-2.0 | e51237588961060687e3661ed685baaa925a1284 | lukepolo/chorus,prakash-alpine/chorus,jamesblunt/chorus,atul-alpine/chorus,lukepolo/chorus,mpushpav/chorus,hewtest/chorus,lukepolo/chorus,hewtest/chorus,mpushpav/chorus,hewtest/chorus,atul-alpine/chorus,jamesblunt/chorus,hewtest/chorus,lukepolo/chorus,mpushpav/chorus,hewtest/chorus,jamesblunt/chorus,hewtest/chorus,atul... | spec/javascripts/helpers/jasmine_extensions.js | accepted | null | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.