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\nvar Xray = require('x-ray'),\n fs = require('fs')\n\nvar x = Xray()\n\nvar baseURLPrefix = \"http://www.thaischool.in.th/sitemap.php?school_area=&province_id=\",\n baseURLSuffix = \"&schooltype_id=&txtsearch=\",\n provinces = r... | javascript | edit | 0 | 1 | isc | e5ffafb53bdce4fdfca12680175adb6858dacd75 | lukyth/thailand-school-collector | index.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n/**\n * Initialize Pattern builder plugin.\n */\n;(function ($) {\n\n var pluginName = 'patternMaker',\n pluginDefaults = {\n palette: []\n };\n\n /**\n * Constructor.\n *\n * @param {dom} ... | javascript | edit | 0 | 2 | mit | b4f454f3701fd304e9775affc51234847d376918 | ivannpaz/PatternMaker | src/Plugin.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n(function () {\n 'use strict';\n\n moj.Modules.Conditional = {\n el: '.js-Conditional',\n\n init: function () {\n var _this = this;\n\n this.cacheEls();\n this.bindEvents();\n\n this.$conditionals.each(functi... | javascript | edit | 0 | 4 | mit | bc6673cefccf4db6b83742eaafe338d22b2d7310 | ministryofjustice/cla_frontend,ministryofjustice/cla_frontend,ministryofjustice/cla_frontend,ministryofjustice/cla_frontend | cla_frontend/assets-src/javascripts/modules/moj.Conditional.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nvar enums = require(\"./enum.js\");\n\ndescribe(\"Enum\", function() {\n it(\"can have symbols with custom properties\", function() {\n var color = new enums.Enum({\n red: { de: \"rot\" },\n green: { de: ... | javascript | edit | 0 | 1 | mit | 5d4ce6182c59c0c15aed5646809c39e4d67c839e | rauschma/enums | enums.spec.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nexport const formatURL = (url) => (\n url.length ? url.replace(/^https?:\\/\\//, '') : ''\n)\n\nexport const getTitle = (data) => (\n data.about && data.about.name\n ? data.about.name\n : data.totalItems + \" Entries\"\n)\n\nex... | javascript | edit | 0 | 5 | apache-2.0 | 6ee08bdbccec11791f9946d692174739176ffa8e | literarymachine/crg-ui | src/common.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nvar TimeSegments = {\n\n // Segment an array of events by scale\n segment(events, scale, options) {\n scale = scale || 'weeks';\n options = options || {};\n _.defaults(options, {\n startAttribute: 'start',\n endAttr... | javascript | edit | 0 | 3 | mit | 80cfc47a1c60e66836fdd7660c944f64c5d4c0c4 | jmeas/time-segments.js | src/time-segments.js | rejected_duplicate | Near-duplicate of sample 68117 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nPackage.describe({\n summary: \"Reactive bootstrap modals for meteor\",\n version: \"1.0.5\",\n git: \"https://github.com/jchristman/reactive-modal.git\",\n name: \"jchristman:reactive-modal\"\n});\n\nPackage.on_use(function (api) {... | javascript | edit | 0 | 2 | mit | 4462762d313e3f7e3535101c576488e2e2ae2374 | jchristman/reactive-modal,jchristman/reactive-modal | package.js | rejected_duplicate | Near-duplicate of sample 103116 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n'use strict'\n\nlet fs = require('fs')\nlet dotenv = require('dotenv')\nlet express = require('express')\nlet session = require('express-session')\nlet cookieParser = require('cookie-parser')\nlet bodyParser = require('body-parser')\nle... | javascript | edit | 0 | 1 | mit | 1daccbf90de27ae2b3a6ac29d448cd78664a0f87 | shrunyan/mc-core,shrunyan/mc-core,andyfleming/mc-core,andyfleming/mc-core | src/server.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n// make is a function that takes an instance of the\r\n// elm runtime\r\n// returns an object where:\r\n// keys are names to be accessed in pure Elm\r\n// values are either functions or values\r\nfunction make(elm) {\r\n //... | javascript | edit | 0 | 1 | mit | 34f2f7d42346f564e4846435fb35ba19d3b5f8f8 | binary-koan/elm-spruce | src/Native/Spruce.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nPackage.describe({\n summary: \"Login service for VKontakte accounts (https://vk.com)\",\n version: \"0.1.4\",\n git: \"https://github.com/alexpods/meteor-accounts-vk\",\n name: \"mrt:accounts-vk\"\n});\n\nPackage.on_use(fun... | javascript | edit | 0 | 1 | mit | 4ec97ddac5fcc131705e5047f4e6057c2abc5cdc | newsiberian/meteor-accounts-vk,newsiberian/meteor-accounts-vk,alexpods/meteor-accounts-vk,alexpods/meteor-accounts-vk | package.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nvar vows = require('vows'),\n assert = require('assert'),\n events = require('events'),\n load = require('./load'),\n suite = vows.describe('brushModes');\n\nfunction d3Parcoords() {\n var promise = new(events.EventEmitter)... | javascript | edit | 0 | 1 | bsd-3-clause | a0f35993688c09fdb7fa49ec67070384e4a79ee2 | bbroeksema/parallel-coordinates,julianheinrich/parallel-coordinates,julianheinrich/parallel-coordinates,bbroeksema/parallel-coordinates | test/brushModes-test.js | accepted | null | true |
[
{
"role": "user",
"content": "Write javascript code for the following: Handle auto-running of the TestSwarm injection script in the test suite."
},
{
"role": "assistant",
"content": "jQuery.noConflict(); // Allow the test to run with other libs or jQuery's.\n\n// load testswarm agent\n(function(... | javascript | new_file | 0 | 3 | mit | f6a50cacd8cd7663650d3ff5557cc20bfcdcd765 | dtjm/jquery,chitranshi/jquery,RubyLouvre/jquery,scottjehl/jquery,sancao2/jquery,jquery/jquery,fat/jquery,roytoo/jquery,chitranshi/jquery,hoorayimhelping/jquery,gnarf/jquery,diracdeltas/jquery,Karyotyper/jquery,sancao2/jquery,isaacs/jquery,rwaldron/jquery,roytoo/jquery,eburgos/jquery,diracdeltas/jquery,jquery/jquery,jcu... | test/data/testrunner.js | rejected_duplicate | Near-duplicate of sample 70016 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nimport { createAuthMiddleware } from '../src'\n\ndescribe('auth middleware', () => {\n const middleware = createAuthMiddleware()\n const nextHandler = middleware({})\n const actionHandler = nextHandler()\n\n test('it returns a funct... | javascript | edit | 0 | 1 | mit | 2cded40e931866ecf95915ba49719609d1c591e9 | jerelmiller/redux-simple-auth | test/middleware.spec.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n#!/usr/bin/env nodejs\n\n// Autoformatter for Turing\n\nconst fs = require('fs'),\n argv = require('minimist')(process.argv.slice(2), {boolean:true});\n\nvar files = argv._;\n\n// Check for flags, and process them\nvar flags = argv... | javascript | edit | 0 | 8 | mit | ea146316b0f0d854a750ecb913b95df2705d1257 | tyxchen/turing-autoformat,tyxchen/turing-autoformat | autoformat.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nimport React, {PropTypes} from 'react';\nimport ReactDOM from 'react-dom';\n\nclass Portal extends React.Component {\n componentDidMount() {\n this.nodeEl = document.createElement('div');\n document.body.appendChild(this.nodeEl);... | javascript | edit | 0 | 1 | apache-2.0 | d8d45721bd463e59645470604f18e82d5e98e636 | mesosphere/reactjs-components,mesosphere/reactjs-components | src/Portal/Portal.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n'use strict';\n\nvar BaseView = require('../base-view');\n\nfunction BasePickerView() {\n BaseView.apply(this, arguments);\n\n this._initialize();\n}\n\nBasePickerView.prototype = Object.create(BaseView.prototype);\nBasePickerView.pro... | javascript | edit | 0 | 2 | mit | 1039b0472ae8427539f1b1034b59596415e981fb | braintree/braintree-web-drop-in,braintree/braintree-web-drop-in,braintree/braintree-web-drop-in | src/views/picker-views/base-picker-view.js | rejected_duplicate | Near-duplicate of sample 100196 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n// http://unheap.com\n\n$(function() {\n $('.browsehappy').on('click', function() {\n $(this).slideUp('fast');\n });\n});\n\n```\n\nApply this change: Make browse happy slide up cleaner"
},
{
"role": "assistant",
"conte... | javascript | edit | 0 | 1 | mit | 142b39b54eb529386ff917c2a6e80ec74abece11 | kennethwang14/VerticalRhythmDemo,kennethwang14/LostGridExample,kennethwang14/LostGridExample,kennethwang14/TypographyHandbook,kennethwang14/TypographyHandbook,corysimmons/boy,kennethwang14/VerticalRhythmDemo | js/plugins.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nimport { expect } from '../spec_helper'\nimport jsdom from 'jsdom'\nimport {\n getRestrictedSize,\n // orientImage,\n} from '../../src/helpers/file_helper'\n\n\nfunction getDOMString() {\n // 1x1 transparent gif\n const src = 'data:... | javascript | edit | 0 | 1 | mit | 7c9ec3264fcc0f6815028d793b8156d8af216ad0 | ello/webapp,ello/webapp,ello/webapp | test/helpers/file_helper_test.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nvar chai = require('chai');\nvar expect = chai.expect;\n// var sinon = require('sinon');\nvar requestToContext = require('../src/requestToContext');\n\ndescribe('requestToContext', function () {\n it('Convert the req to the correct con... | javascript | edit | 0 | 1 | apache-2.0 | a544b1ae597692ebb60175cf0572376f7d609d90 | krolow/falcor-express,jmnarloch/falcor-express,jontewks/falcor-express,Netflix/falcor-express | test/index.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nimport App from './app';\nimport 'babel-polyfill';\ncommon.app = new App(common);\ncommon.app.start();\n\n```\n\nApply this change: Remove babel-polyfill import in man.js"
},
{
"role": "assistant",
"content": "import App fro... | javascript | edit | 0 | 0 | mit | 6bba09d9f9946d3498d6b31112074cd07bc6fc86 | snphq/generator-sp,i-suhar/generator-sp,snphq/generator-sp,snphq/generator-sp,i-suhar/generator-sp,i-suhar/generator-sp | generators/app/templates/app/scripts/main.js | rejected_duplicate | Near-duplicate of sample 103463 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nvar ACME = require( '..' )\nvar assert = require( 'assert' )\nvar nock = require( 'nock' )\n\nsuite( 'ACME', function() {\n\n var client = new ACME({\n baseUrl: 'https://api.example.com',\n })\n\n test( 'throws an error if baseUrl... | javascript | edit | 0 | 1 | mit | 466e870fc742981be4b178015042285717cdee12 | jhermsmeier/node-acme-protocol | test/index.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n/**\n * Setup the user (DOM) event flow.\n *\n * @private\n * @param {object} The moule instnace.\n*/\nmodule.exports = function (instance, template, options, dom, data) {\n for (var event in template.events) {\n for (var i = ... | javascript | edit | 0 | 4 | mit | b5169369bea5ccdde34b214641f0c8eec09f64dd | adioo/view | lib/events.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n/**\n * Module dependencies.\n */\nvar redis = require('redis');\n\n\nexports = module.exports = function(settings, logger) {\n\tvar config = settings.toObject();\n\tif (!config.host) { throw new Error('Redis host not set in config'); }... | javascript | edit | 0 | 4 | mit | ad49b5c4e7e355fc7533a62b232bcdb94e3ec152 | bixbyjs/bixby-redis | lib/client.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nvar logit = require('./main');\n\nvar logger = logit({\n prefix: 'my app',\n date: true\n});\n\nlogger.info(\"Test 1\");\nlogger.debug(\"Test 2\");\nlogger.warn(\"Test 3\");\nlogger.error(\"Test 4\");\n\nlogger = logit({\n prefix: 'm... | javascript | edit | 0 | 1 | mit | 5583da7b0961b3f3d94ff08faf606fa5fbaab5f9 | cozy/printit,nono/printit | tests.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nimport { displayOrder, transforms } from 'transformime-react';\n\n/**\n * Thus begins our path for custom mimetypes and future extensions\n */\n\nimport PlotlyTransform from './plotly';\nimport GeoJSONTransform from './geojson';\n\n\nco... | javascript | edit | 0 | 0 | bsd-3-clause | 50714f6b030bddce42d1e3f69be83cb4c9da4188 | jdetle/nteract,0u812/nteract,jdetle/nteract,nteract/composition,captainsafia/nteract,rgbkrk/nteract,0u812/nteract,jdfreder/nteract,captainsafia/nteract,nteract/nteract,rgbkrk/nteract,nteract/nteract,temogen/nteract,temogen/nteract,temogen/nteract,jdfreder/nteract,jdetle/nteract,nteract/composition,nteract/nteract,rgbkr... | src/notebook/components/transforms/index.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n// Karma configuration\n\nmodule.exports = function (config) {\n config.set({\n\n // base path that will be used to resolve all patterns (eg. files, exclude)\n basePath: './',\n\n // testing frameworks to use\n frameworks: ... | javascript | edit | 0 | 1 | mit | 112b74dcbde73c4f35426c24ab51bb10287b9c63 | gm758/Bolt,gm758/Bolt,elliotaplant/Bolt,thomasRhoffmann/Bolt,boisterousSplash/Bolt,thomasRhoffmann/Bolt,boisterousSplash/Bolt,elliotaplant/Bolt | karma.conf.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n/* @flow strict */\nimport { autoUpdater } from \"electron-updater\";\n\nexport function initAutoUpdater() {\n const log = require(\"electron-log\");\n log.transports.file.level = \"info\";\n autoUpdater.logger = log;\n autoUpdater.... | javascript | edit | 0 | 2 | bsd-3-clause | 245e9614db9218ddd4f982ba4b007665ba3627b3 | rgbkrk/nteract,nteract/nteract,nteract/nteract,rgbkrk/nteract,nteract/nteract,rgbkrk/nteract,nteract/composition,nteract/nteract,rgbkrk/nteract,nteract/composition,nteract/composition,rgbkrk/nteract,nteract/nteract | applications/desktop/src/main/auto-updater.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nExt.define('App.model.Query', {\n extend: 'Ext.data.Model',\n\n config: {\n fields: [\n {\n name: 'detail',\n mapping: 'properties',\n convert: function(value, record)... | javascript | edit | 0 | 1 | bsd-2-clause | 3096c29162a5acbf3b98ae1f699e6039976caf19 | tsauerwein/c2cgeoportal,tsauerwein/c2cgeoportal,tsauerwein/c2cgeoportal,tsauerwein/c2cgeoportal | c2cgeoportal/scaffolds/update/+package+/static/mobile/app/model/Query.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nconst {playwrightLauncher} = require('@web/test-runner-playwright');\n\nconst defaultBrowsers = [\n playwrightLauncher({product: 'chromium'}),\n playwrightLauncher({product: 'webkit'}),\n playwrightLauncher({product: 'firefox', concu... | javascript | edit | 0 | 1 | bsd-3-clause | 60b6dce28eaaa22987acb0000977a7646066cce0 | webcomponents/polyfills,webcomponents/polyfills,webcomponents/polyfills | web-test-runner.config.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nvar pingPong = function(i) {\n if ((i % 3 === 0) || (i % 5 === 0)) {\n return true;\n } else {\n return false;\n }\n};\n\n$(function() {\n $(\"#game\").submit(function(event) {\n $('#outputList').empty();\n\n var number ... | javascript | edit | 0 | 7 | mit | d2e1ba9dbe878690d33c82025bb12e4e9efd8f65 | kcmdouglas/pingpong,kcmdouglas/pingpong | js/scripts.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nvar webpack = require('webpack');\n// TODO: use BowerWebpackPlugin\n// var BowerWebpackPlugin = require('bower-webpack-plugin');\nvar webpackCommon = require('./webpack.common.config.js');\n\n// Put in separate file?\nvar webpackTestCon... | javascript | edit | 0 | 1 | apache-2.0 | 7e15fe61c4300ac591adc7a153b32d060a3feff6 | samchrisinger/osf.io,cosenal/osf.io,lyndsysimon/osf.io,alexschiller/osf.io,arpitar/osf.io,mluo613/osf.io,crcresearch/osf.io,felliott/osf.io,TomBaxter/osf.io,leb2dg/osf.io,monikagrabowska/osf.io,adlius/osf.io,jeffreyliu3230/osf.io,jeffreyliu3230/osf.io,ticklemepierce/osf.io,Nesiehr/osf.io,zkraime/osf.io,jeffreyliu3230/o... | karma.conf.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n// Register 'usergroups' special setting values fetcher.\n// Allows to use `values: usergroups` in setting definitions.\n\n\n'use strict';\n\n\nvar _ = require('lodash');\n\n\nmodule.exports = function (N) {\n\n N.wire.before('init:set... | javascript | edit | 0 | 1 | mit | 5650dbb2c03ff9d045782cbb9175403b40d24985 | nodeca/nodeca.users | lib/hooks/init/setting_usergroups_fetcher.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nimport React, { Component } from 'react';\nimport TextField from 'material-ui/TextField';\nimport Card, { CardActions, CardContent } from 'material-ui/Card';\nimport Button from 'material-ui/Button';\n\nimport TaxCalculator from '../lib... | javascript | edit | 0 | 1 | apache-2.0 | 1030f20315b0f661993c7aca33bb3f6fb9753503 | migutw42/jp-tax-calculator,migutw42/jp-tax-calculator | src/components/InputArea.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nimport { Application } from 'spectron'\nimport electronPath from 'electron'\nimport path from 'path'\n\njasmine.DEFAULT_TIMEOUT_INTERVAL = 15000\n\nconst delay = time => new Promise(resolve => setTimeout(resolve, time))\n\ndescribe('mai... | javascript | edit | 0 | 3 | mit | 06595b1ea4a93825e22a1221e6c44846e7bde1f8 | LN-Zap/zap-desktop,LN-Zap/zap-desktop,LN-Zap/zap-desktop | test/e2e/e2e.spec.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n'use strict';\n\nvar hosts = {\n 'bbc.co.uk': 'bbc',\n 'm.bbc.co.uk': 'bbc',\n 'reddit.com': 'reddit',\n 'www.reddit.com': 'reddit',\n 'condenast.co.uk': 'condenast'\n};\n\nvar organisations = {\n 'bbc': {\n 'owner': null,\n ... | javascript | edit | null | null | mit | 46962ed201abf4e701fb069c02ab1a1751464857 | magicmark/Transparification-Server | information.js | rejected_syntax | Syntax error detected by tree-sitter | false |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n/**\n * Insert content, specified by the parameter, to the end of each\n * element in the set of matched elements.\n */\nfunction append(el) {\n var l = this.length, clone = false;\n // wrap content\n el = this.air(el);\n // match... | javascript | edit | 0 | 2 | mit | 69aa8d49b5a2082d2870d453521194a39a215001 | socialally/air,tmpfs/air,tmpfs/air,socialally/air | lib/append.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nvar doxdox = require('doxdox'),\n utils = require('doxdox/lib/utils'),\n fs = require('fs'),\n path = require('path'),\n extend = require('extend');\n\nmodule.exports = function (grunt) {\n\n grunt.registerMultiTask('doxd... | javascript | edit | 0 | 11 | mit | 7f0176380ad5ade420384d1ae4ea14a5180f05e8 | mmarcon/grunt-doxdox,neogeek/grunt-doxdox | tasks/doxdox.js | rejected_complexity | Cyclomatic complexity too high: 11 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n#!/usr/bin/env node\n'use strict';\n\n// Load base requirements\nconst program = require('commander'),\n dotenv = require('dotenv').config(),\n path = require('path');\n\n// Load our libraries\nconst utils = require('./libs/ut... | javascript | edit | 0 | 1 | apache-2.0 | 04bbd69917a604457ce3a3df860f3f5cb1d21c65 | transmutejs/core | app/transmute.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n$(document).ready(function() {\n // autocomplete widget javascript initialization for bootstrap=countrycity\n $('.autocomplete_light_widget[data-bootstrap=countrycity]').each(function() {\n var country_wrapper = $(this).pre... | javascript | edit | 0 | 3 | mit | e03b40541d8e0843c4585489a2a711ee4183e222 | max-arnold/django-cities-light,yourlabs/django-cities-light,affan2/django-cities-light,eevol/django-cities-light,gpichot/django-cities-light,eevol/django-cities-light,KevinGrahamFoster/django-cities-light,affan2/django-cities-light,greenday2/django-cities-light,max-arnold/django-cities-light,gpichot/django-cities-light | cities_light/static/cities_light/autocomplete_light.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n'use strict';\n\n/**\n* jsFiddle tag\n*\n* Syntax:\n* {% jsfiddle shorttag [tabs] [skin] [height] [width] %}\n*/\n\nfunction jsfiddleTag(args, content){\n var id = args[0];\n var tabs = args[1] && args[1] !== 'default' ? args[1] : '... | javascript | edit | 0 | 9 | mit | b54ae8bc91ae77569048be8af229be058e81d0f8 | amobiz/hexo,hexojs/hexo,zhipengyan/hexo,wangjordy/wangjordy.github.io,wangjordy/wangjordy.github.io,leelynd/tapohuck,noikiy/hexo,kywk/hexi,DevinLow/DevinLow.github.io,hexojs/hexo,DevinLow/DevinLow.github.io,zhipengyan/hexo,ppker/hexo,ppker/hexo,aulphar/hexo,kywk/hexi | lib/plugins/tag/jsfiddle.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nimport React from 'react'\nimport { sparqlConnect } from '../sparql/configure-sparql'\nimport { LOADED } from 'sparql-connect'\nimport ServiceList from './service-list'\n\nfunction ServicesByGSBPMPhase({ loaded, services }) {\n if(load... | javascript | edit | 0 | 1 | mit | 2a774a58d510bc23eb7216543f0b4f83a5b8b481 | UNECE/Model-Explorer,UNECE/Model-Explorer | src/js/components/services-by-gsbpm-phase.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nRouter.configure({\n layoutTemplate: 'layout'\n});\n\nRouter.route('/', {\n name: 'home',\n waitOn: function () {\n return Meteor.subscribe('verifiedUsersCount');\n },\n onBeforeAction: function () {\n if (Meteor.user()) {\n ... | javascript | edit | 0 | 3 | mit | 91cd5e4293ad2f85c19de4ffe69127b6936fd8ab | obvio171/rideboard,obvio171/rideboard | lib/router.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nvar dest = './public/dist';\nvar src = './client';\nvar bowerComponents = './bower_components';\n\nmodule.exports = {\n adminAssets: {\n src: src + '/admin/**',\n dest: dest + '/admin/assets'\n },\n bower: {\n dest: dest + '... | javascript | edit | 0 | 1 | mit | ac6ffeea337475579d93bb0608f75197e3495b7a | risq/dihh,risq/dihh | gulp/config.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n'use strict';\n\nconst fs = require('fs');\n\nconst express = require('express');\nconst send = require('send');\nconst morgan = require('morgan');\nconst errorHandler = require('errorhandler');\nconst compression = require('compression... | javascript | edit | 0 | 2 | mit | 270c333096dbeb495571baed81c5f9debdf7d967 | pfleidi/podslurp | lib/server.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n\n(function () {\n\n \n var addImageGallery = function(post) {\n\n if(post.length && !post.hasClass('smi-img-gallery')) {\n console.log('POST: ', post);\n post.addClass('smi-img-gallery');\n\n post.find('img').each(f... | javascript | edit | 0 | 3 | mit | cb17adbc69f22307c2d3c4e64adec64c6f200511 | armandocat/steemit-more-info,armandocat/steemit-more-info | src/image-gallery.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nimport * as _ from 'underscore';\nimport * as Backbone from 'backbone';\n\nclass BaseView extends Backbone.View {\n\n constructor(options = {}) {\n super(options);\n this._subviews = null;\n }\n\n registerSubView(view) {\n t... | javascript | edit | 0 | 2 | mit | 144eba59227a600aec09ab549c0be840698d191a | trevormunoz/katherine-anne,trevormunoz/katherine-anne,trevormunoz/katherine-anne | src/js/utils/_base-view.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nchrome.extension.sendMessage({}, function(response) {\n\tvar readyStateCheckInterval = setInterval(function() {\n\t\tif (document.readyState === \"complete\") {\n\t\t\tclearInterval(readyStateCheckInterval);\n\n\t\t\tvar labels = docume... | javascript | edit | 0 | 2 | isc | cbcd01ba33d3d8b4408d97ddbe3aa80eb22984dc | oliverswitzer/wwltw-for-pivotal-tracker,mkenyon/red-labels-for-pivotal-tracker,oliverswitzer/wwltw-for-pivotal-tracker | src/inject/inject.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n'use strict'\n\n// Code thanks to MDN\nexport function storageAvailable (type) {\n try {\n let storage = window[type]\n let x = '__storage_test__'\n storage.setItem(x, x)\n storage.removeItem(x)\n return true\n } catch ... | javascript | edit | 0 | 7 | mit | 6dd03089f29ae7cd357f45a929bed8f7e7d6440b | CrowsVeldt/FreeCodeCamp-Pomodoro-Timer | src/input/storageHandler.js | rejected_duplicate | Near-duplicate of sample 87175 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nimport base from './webpack.base.babel.js';\nimport path from 'path';\nimport webpack from 'webpack';\n\nconst {WDS_PORT, PORT, APP_WEB_BASE_PATH} = process.env;\n\nexport default {\n ...base,\n\n entry: \"./src/app/_client.js\",\... | javascript | edit | 0 | 0 | mit | ccce0d08bd0a43ba10a5b18470095b0c19bfe18c | mdjasper/React-Reading-List,tuxsudo/react-starter | webpack.client.babel.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) {\n res.render('index', { title: 'VoteAnon' });\n});\n\nrouter.route('/create')\n.get(function(req, res) {\n ... | javascript | edit | 0 | 1 | mit | ba816550e509def9d0d4f3f6d500b80402b0a5c2 | Pringley/voteanon | routes/index.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n\nconst Marionette = require('backbone.marionette');\nconst moment = require('moment');\n\nmodule.exports = class IdleView extends Marionette.View {\n template = Templates['idle'];\n\n className() { return 'idle-content'; }\n\n event... | javascript | edit | 0 | 1 | mit | dc731a64f204251143021cdc663ddaea195f3908 | monitron/jarvis-ha,monitron/jarvis-ha | lib/web/scripts/IdleView.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nimport webpack from 'webpack'\nimport baseWebpackConfig from './webpack.base'\nimport UglifyJSPlugin from 'uglifyjs-webpack-plugin'\nimport {BundleAnalyzerPlugin} from 'webpack-bundle-analyzer'\nimport {Plugin as ShakePlugin} from 'webp... | javascript | edit | 0 | 0 | apache-2.0 | 430d0dd3530c83907f9867454fdd3781b05835c9 | Metnew/react-semantic.ui-starter | webpack_config/server/webpack.prod.babel.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\ndefine([\n 'inherits',\n 'streamhub-hot-collections/streams/hot-collections',\n 'streamhub-hot-collections-tests/mocks/clients/mock-hot-collections-client'],\nfunction (inherits, HotCollections, MockHotCollectionsClient) {\n\n ... | javascript | edit | 0 | 3 | mit | 003259602f03821ff6049914d66ecb77692badc2 | gobengo/streamhub-hot-collections | tests/mocks/streams/mock-hot-collections.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nexport default {\n mounted () {\n document.addEventListener('paste', this.handlePaste)\n },\n\n beforeDestroy () {\n document.removeEventListener('paste', this.handlePaste)\n },\n\n computed: {\n isClientPage () {\n r... | javascript | edit | 0 | 4 | mit | 1829b94752a3cf01773d7d360adb2c18e528fcc8 | Kylart/KawAnime,Kylart/KawAnime,Kylart/KawAnime | src/renderer/mixins/global/readMagnet.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n// Export a global module.\nwindow.tangelo = {};\n\n(function (tangelo) {\n \"use strict\";\n\n // Tangelo version number.\n tangelo.version = function () {\n var version = \"0.9.0-dev\";\n return version;\n };... | javascript | edit | 0 | 2 | apache-2.0 | e268600106b19b02a8bcfd72f3aa9c59396f8d3d | Kitware/tangelo,Kitware/tangelo,Kitware/tangelo | js/src/core.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nconst { FileService } = require('./file/file.service')\nconst { BadScriptPermission } = require('./file/bad-script-permission.error')\nconst { ScriptNotExist } = require('./file/script-not-exist.error')\n\nmodule.exports = exports = {\n... | javascript | edit | 0 | 0 | apache-2.0 | 346fa351b6c0c17c486dad3dbd85f974f48fb4aa | Mindsers/configfile | src/services/file.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nexport default window.WeakMap || (function () {\n let index = 0;\n function Wm () {\n this.key = `____weak_map_${index++}`;\n }\n Wm.prototype = {\n delete (obj) {\n if (obj) {\n delete obj[this.key];\n }\n ... | javascript | edit | 0 | 5 | mit | 030c68973913fcf45f259a2f0cdd334955d33dac | skatejs/named-slots | src/util/weak-map.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nimport {offset} from './render-size';\n\nexport default function(view, prevHandler, el, constructor) {\n var handler = new constructor(view.loader(), view.tooltip())\n .scene(view.scenegraph().root)\n .initialize(el, offset(view)... | javascript | edit | 0 | 2 | bsd-3-clause | 2f9e7e2af6539395656c7a1ae0b375f178b1c156 | vega/vega,vega/vega,lgrammel/vega,vega/vega,vega/vega | packages/vega-view/src/initialize-handler.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nHandlebarsIntl.registerWith(Handlebars);\n\n$(function() {\n\twindow.state = {};\n\tvar source = $(\"#stats-template\").html();\n\tvar template = Handlebars.compile(source);\n\trefreshStats(template);\n\n\tsetInterval(function() {\n\t\t... | javascript | edit | 0 | 3 | mit | 1e7dd2c0d1a471092fc1ef6888543d2a4626e237 | sammy007/ether-proxy,sammy007/ether-proxy,sammy007/ether-proxy,sammy007/ether-proxy | www/script.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nvar common = require('../common');\nvar connection = common.createConnection({password: 'INVALID PASSWORD'});\nvar assert = require('assert');\n\nvar err;\nconnection.connect(function(_err) {\n assert.equal(err, undefined);\n ... | javascript | edit | 0 | 1 | mit | 940163051b33e111370fbb292666e4668c519a27 | saisai/node-mysql,wxkdesky/node-mysql,1602/node-mysql,bbito/node-mysql,l371559739/node-mysql,yanninho/node-mysql,linalu1/node-mysql,felixge/node-mysql,tempbottle/node-mysql,shipci/node-mysql,apathyjade/node-mysql,yulongge/node-mysql,XiaoLongW/node-mysql,grooverdan/node-mysql,zhhb/node-mysql,chinazhaghai/node-mysql,Jimb... | test/integration/test-bad-credentials.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n(function (name, definition) {\n\n // AMD\n if (typeof define === 'function') {\n define(definition);\n }\n\n // Node.js\n else if (typeof module !== 'undefined' && module.exports) {\n module.exports = defin... | javascript | edit | 0 | 4 | apache-2.0 | 40c5111ee6fe0b7c670dc28d66d475be2ff030fc | cskeppstedt/null-prune | null-prune.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nimport { ecc_config, hash } from \"../ecc\"\n\necc_config.address_prefix = \"GLS\";\n\nlet chain_id = \"\"\nfor(let i = 0; i < 32; i++) chain_id += \"00\"\n\nmodule.exports = {\n address_prefix: \"GLS\",\n expire_in_secs: 15,\n ... | javascript | edit | 0 | 0 | mit | fa7831b3ab4331c1e617809b520d82deb5711931 | GolosChain/tolstoy,GolosChain/tolstoy,GolosChain/tolstoy | shared/api_client/ChainConfig.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n(function() {\n\t'use strict';\n\n\tif(typeof exports === 'object') {\n\n\t\tvar when = require('../when');\n\n\t\texports.fulfilled = when.resolve;\n\t\texports.rejected = when.reject;\n\n\t\texports.pending = function () {\n\t\t\tvar ... | javascript | edit | 0 | 2 | mit | 520f37fad8789c5e43e59918b84848b1dea3bf06 | caporta/when,caporta/when,ning-github/when,SourcePointUSA/when,stevage/when,frank-weindel/when,tkirda/when,ning-github/when,mlennon3/when,stevage/when,anthonyvia/when,tkirda/when,petkaantonov/when,SourcePointUSA/when,frank-weindel/when,anthonyvia/when,mlennon3/when,DJDNS/when.js | test/when-adapter.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nvar request = require('request');\r\nvar localRoot = 'http://localhost:' + process.env.PORT || 3000;\r\nvar assert = require('assert');\r\n\r\nexports.get = function localGet(url, cb) {\r\n return request({url: localRoot + url, encodin... | javascript | edit | 0 | 4 | mit | 7eeebd090769ed1bcf8013b6f0306b5531ba3e86 | chatphrase/caress | test/util/localrq.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n/* ajax_windows.js. Support for modal popup windows in Umlaut items. */\njQuery(document).ready(function($) {\n var populate_modal = function(data, textStatus, jqXHR) {\n data = $(data);\n var heading = data.find(\"h1, h2, h3, h... | javascript | edit | 0 | 2 | mit | e825b025f3e7e2c96cf73ae669e70161bb1e6b7e | team-umlaut/umlaut,team-umlaut/umlaut,team-umlaut/umlaut | app/assets/javascripts/umlaut/ajax_windows.js | accepted | null | true |
[
{
"role": "user",
"content": "Write javascript code for the following: Add JSDoc documentation to string/startsWith"
},
{
"role": "assistant",
"content": "/**\nDoes a string start with another string?\n\n@module string/startsWith\n@param {string} str The string to search through.\n@param {string... | javascript | new_file | 0 | 1 | mit | 5b15efa2a01ccdb6ed4c92128df362e585bbd868 | EvanHahn/lildash | string/startswith.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nvar RCTDeviceEventEmitter = require('RCTDeviceEventEmitter');\nvar ReactNative = require('react-native');\n\nfunction CordovaPluginAdapter() {\n this.nativeInterface = ReactNative.NativeModules.CordovaPluginAdapter;\n this._callba... | javascript | edit | 0 | 5 | isc | 6cdc555485a9fba147558341eed8a11b2a63efd7 | axemclion/react-native-cordova-plugin,axemclion/react-native-cordova-plugin | lib/CordovaPluginAdapter.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nbeforeEach(function() {\n\n function genViewHTML(id, view) {\n\n var html = '';\n var clazz = 'ns-view-' + id;\n if (view.async) {\n clazz += ' ns-async';\n }\n if (view.collection) {\n ... | javascript | edit | 0 | 5 | mit | 2cef9ebfa7c747e96db3a8d8e2a3dce9a3e74c82 | yandex-ui/noscript,Rebulus/noscript,mishk0/noscript | test/stub/ns.tmpl.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n(function() {\n /* globals define, Intercom */\n\n function generateModule(name, values) {\n define(name, [], function() {\n 'use strict';\n\n return values;\n });\n }\n\n function setupIntercom(config) {\n var ic... | javascript | edit | 0 | 3 | mit | 476629c71af2137a81c276d93abaa87946e6ccbc | levanto-financial/ember-intercom-io,seawatts/ember-intercom-io,mike-north/ember-intercom-io,levanto-financial/ember-intercom-io,mike-north/ember-intercom-io,seawatts/ember-intercom-io | vendor/ember-intercom-io.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nvar _gaq = _gaq || [];\n_gaq.push(['_setAccount', '{ANALYTICS_CODE}']);\n_gaq.push(['_trackPageview']);\n\n(function() {\n\tvar ga = document.createElement('script');\n\tga.type = 'text/javascript';\n\tga.async = true;\n\tga.src = ('htt... | javascript | edit | 0 | 2 | mit | 9fcd1742f83e9759d0b8d7fd4338cd6149a19a07 | phpgt/webengine | PageTool/Analytics/Include/Analytics.tool.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n'use strict';\n\nimport React, { Component } from 'react';\nimport ReactCSS from 'reactcss';\n\nclass EncryptKeyListItem extends Component {\n classes() {\n return {\n 'default': {\n\n },\n };\n }\n\n render() {\n ... | javascript | edit | 0 | 1 | mit | c7ff1ef3550c46c3ee97740c97ca1d47a3914217 | henryboldi/felony,tobycyanide/felony,henryboldi/felony,tobycyanide/felony | src/components/encrypt/EncryptKeyListItem.js | rejected_duplicate | Near-duplicate of sample 100839 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nimport debugModule from 'debug';\nimport Joi from 'joi';\nimport xhr from 'xhr';\n\nconst debug = debugModule('csra');\n\nconst schema = Joi.array().items(\n Joi.object({\n id: Joi.number(),\n nomisId: Joi.string().optional(),\n ... | javascript | edit | 0 | 4 | mit | 07927b0770d543f49028de8a4f1ebb5ead627e94 | noms-digital-studio/csra-app,noms-digital-studio/csra-app,noms-digital-studio/csra-app | client/javascript/services/getAssessments.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nconst {join} = require(\"path\")\n\nmodule.exports = {\n plugins: [\n [\"module-resolver\", {\n cwd: __dirname,\n root: [\"src\"],\n alias: {\n \"package.json\": join(__dirname, \"package.json\")\n }\n ... | javascript | edit | 0 | 0 | mit | 99abf608ea6e19c83a3f4e564ea31f7749fc48be | octet-stream/ponyfiction-js,octet-stream/ponyfiction-js | .babelrc.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n'use strict';\nvar angular = require('angular');\n\nvar traefikCoreProvider = 'traefik.core.provider';\nmodule.exports = traefikCoreProvider;\n\nangular\n .module(traefikCoreProvider, ['ngResource'])\n .factory('Providers', Providers)... | javascript | edit | 0 | 6 | mit | 2d0d320d058b08703a1c4ce746c6cd5e0c976acb | containous/traefik,aantono/traefik,vdemeester/traefik,FriggaHel/traefik,aantono/traefik,ldez/traefik,vdemeester/traefik,containous/traefik,aantono/traefik,dtomcej/traefik,mmatur/traefik,FriggaHel/traefik,aantono/traefik,ldez/traefik,mmatur/traefik,mmatur/traefik,dtomcej/traefik,vdemeester/traefik,mmatur/traefik,SantoDE... | webui/src/app/core/providers.resource.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n#!/usr/bin/env node\n\n/*\n * Copyright 2013-2015, All Rights Reserved.\n *\n * Code licensed under the BSD License:\n * https://github.com/node-gh/gh/blob/master/LICENSE.md\n *\n * @author Eduardo Lundgren <<EMAIL>>\n */\n\n'use strict... | javascript | edit | 0 | 1 | bsd-3-clause | f5cdb43607f9894f915e266b634a88e3577cbe05 | oouyang/gh,tomzx/gh,henvic/gh,modulexcite/gh,TomzxForks/gh,tomzx/gh,dustinryerson/gh,oouyang/gh,henvic/gh,modulexcite/gh,TomzxForks/gh,dustinryerson/gh | bin/gh.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n$(function () {\n $('#spending-averages').highcharts({\n chart: {\n type: 'bar'\n },\n title: {\n text: 'Historic World Population by Region'\n },\n subtitle: {\n te... | javascript | edit | 0 | 1 | mit | d28e387391f8ea3aa46932e6ec0ae75f28f2f4ae | nyc-cicadas-2015/Can-I-Afford-This,nyc-cicadas-2015/Can-I-Afford-This,nyc-cicadas-2015/Can-I-Afford-This | app/assets/javascripts/spending_averages.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n// @flow\n\nimport type { SectionType } from \"../enums/Section.js\";\n\nimport { ReduceStore } from \"flux/utils\";\nimport UniversalDispatcher from \"./UniversalDispatcher.js\";\nimport { Record } from \"immutable\";\nimport Section f... | javascript | edit | null | null | mit | 7afc12f3526dd6ff2dcfc6d57b2838d59c557994 | DemocracyLab/CivicTechExchange,DemocracyLab/CivicTechExchange,DemocracyLab/CivicTechExchange,DemocracyLab/CivicTechExchange | common/components/stores/NavigationStore.js | rejected_syntax | Syntax error detected by tree-sitter | false |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nvar AppRouter = Backbone.Router.extend({\n routes: {\n 'topics/:topicId': 'showResults',\n\n '*actions': 'defaultAction'\n },\n\n\n showResults: function(topicId) {\n if ($('#topics-container').length === 0) {\n this.de... | javascript | edit | 0 | 2 | mit | f1f97709aaed83b7cc3bac30d795650519d417aa | Jasmine-Feldmann/pollarity,Jasmine-Feldmann/pollarity,zebogen/pollarity,Jasmine-Feldmann/pollarity,zebogen/pollarity,zebogen/pollarity,zebogen/pollarity,Jasmine-Feldmann/pollarity | app/assets/javascripts/controller/router.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n/**\n * Helper functions that are used in the other modules to reduce the number of times\n * that code for common tasks is rewritten\n *\n * (c) 2013, Greg Malysa <<EMAIL>>\n * Permission to use granted under the terms of the MIT Licen... | javascript | edit | 0 | 3 | mit | 83fed674f7b436cb4c1ba2d91346d15a2b05ad7a | gmalysa/flux-link | lib/helpers.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\njQuery(function($) {\n\n /* tab insertion handling */\n $('#code').keydown(function(e) {\n if (e.keyCode == 9 && !e.ctrlKey && !e.altKey) {\n if (this.setSelectionRange) {\n var start = this.selectionStart;\n... | javascript | edit | 0 | 7 | mit | 42500591eb8048396af67dac18e155e28ba6de03 | gdamjan/paste-couchapp | _attachments/script/paste.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nmodule.exports = {\n // Don't try to find .babelrc because we want to force this configuration.\n babelrc: false,\n presets: [\n [\n require.resolve('babel-preset-env'),\n {\n targets: {\n browsers: ['las... | javascript | edit | 0 | 0 | mit | 292eab2125b76d48c175559e8cbd1198ef53510c | storybooks/storybook,rhalff/storybook,kadirahq/react-storybook,rhalff/storybook,storybooks/storybook,storybooks/react-storybook,rhalff/storybook,storybooks/storybook,rhalff/storybook,rhalff/storybook,storybooks/storybook,storybooks/storybook,rhalff/storybook,storybooks/react-storybook,storybooks/storybook,storybooks/re... | app/polymer/src/server/config/babel.prod.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nmodule.exports = {\n resolve: {\n alias: {\n // Use non-compiled version of the following libraries\n 'reselect': 'reselect/src/index.js',\n\n // Use non-compiled version of the following react libraries\n 'react... | javascript | edit | 0 | 0 | mit | 79019f506fe1fef40d1edb4e79ab4ca732403d1a | jsse-2017-ph23/web-frontend,jsse-2017-ph23/web-frontend,jsse-2017-ph23/web-frontend | webpack-cfg/alias.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n$( function() {\n\tif ( !mw.pageTriage ) {\n\t\tmw.pageTriage = {};\n\t}\n\tmw.pageTriage.viewUtil = {\n\t\t// fetch and compile a template, then return it.\n\t\t// args: view, template\n\t\ttemplate: function( arg ) {\n\t\t\tapiRequest... | javascript | edit | 0 | 3 | mit | 7df460bdc5be6aadb2a0d20bddf6c2648652639c | wikimedia/mediawiki-extensions-PageTriage,wikimedia/mediawiki-extensions-PageTriage,wikimedia/mediawiki-extensions-PageTriage | modules/ext.pageTriage.util/ext.pageTriage.viewUtil.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n\nrequirejs.config({\n\tpaths: {\n\t\t'jquery': './lib/components/jquery/dist/jquery.min'\n\t}\n});\n\nrequire( [ 'src/graph' ] , function( Graph ) {\n\n\tvar functions = [\n\nfunction( domGraph, domSource ) {\n\n\tvar g1 = new Graph( d... | javascript | edit | 0 | 2 | mit | 13893fdda355e822af305b3863c07ceeba88a13a | NPellet/jsGraph,andcastillo/graph,NPellet/jsGraph,andcastillo/graph | init.js | rejected_duplicate | Near-duplicate of sample 95844 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n// Program that identifies common element(s) that exist within both two arrays\n\nfunction intersection(firstArray, secondArray) {\n\tvar hashMap = {};\n\tvar commonElements = [];\n\n\t// create hashmap with elements of first array as k... | javascript | edit | 0 | 2 | mit | 2569ab19ab1ae516451a8018b8911fd82c72e100 | derekmpham/interview-prep,derekmpham/interview-prep | array/common-elements-two-arrays.js | rejected_duplicate | Near-duplicate of sample 78560 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n$(function(){\n $(\".tablesorter\").tablesorter();\n $(\"tr[data-link]\").click(function() {\n window.location = $(this).data(\"link\")\n });\n console.log('Scripts loaded.');\n});\n\n```\n\nApply this change: Load js on turbolin... | javascript | edit | 0 | 1 | mit | 5cfea2ffb89d3f81e20bb36dd5341b281fa78ada | greenvault/wahlbezirke,greenvault/wahlbezirke,greenvault/wahlbezirke | app/assets/javascripts/scripts.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nimport DS from 'ember-data';\n\nimport OsfModel from './osf-model';\n\n/**\n * @module ember-osf\n * @submodule models\n */\n\n/**\n * Model for OSF APIv2 file versions. Primarily used in relationship fields.\n * This model is used for ... | javascript | edit | 0 | 0 | apache-2.0 | 324b5aba5334b203ce1a622471b41427d0b0afa6 | jamescdavis/ember-osf,binoculars/ember-osf,crcresearch/ember-osf,baylee-d/ember-osf,CenterForOpenScience/ember-osf,binoculars/ember-osf,jamescdavis/ember-osf,chrisseto/ember-osf,baylee-d/ember-osf,chrisseto/ember-osf,CenterForOpenScience/ember-osf,crcresearch/ember-osf | addon/models/file-version.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nangular\n .module('app')\n .factory('MetaMachine', function($rootScope) {\n var MetaMachine = {\n title: function(pageTitle, baseTitle) {\n baseTitle = typeof baseTitle != 'undefined' ? baseTitle : \"Rootstrikers\";\n ... | javascript | edit | 0 | 3 | mit | 870d438d162750d7b3b0586702ec551352200c10 | brettshollenberger/rootstrikers,brettshollenberger/rootstrikers | client/app/scripts/services/meta-machine.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n/* eslint-disable import/prefer-default-export */\nimport React from 'react';\n\n/**\n * Hook to simplify the use of the native date picker component by unwrapping\n * the callback event and firing the callback only when the date is cha... | javascript | edit | 0 | 3 | mit | 9ee00c1b2b9bb79e664d5f7ce0b9ce78478d7c1d | sussol/mobile,sussol/mobile,sussol/mobile,sussol/mobile | src/hooks/useDatePicker.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nRouter.configure({\n layoutTemplate: 'layout',\n loadingTemplate: 'loading',\n notFoundTemplate: 'notFound',\n waitOn: function() {\n return Meteor.subscribe('notifications');\n }\n});\n\nRouter.route('/posts/:_id', {\n name: '... | javascript | edit | null | null | mit | ff6e324be00554374a57e068519e40d62b9664dd | Bennyz/microscope,Bennyz/microscope | lib/router.js | rejected_syntax | Syntax error detected by tree-sitter | false |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n// Based on \"Continous Redrawing of Objects\"\n// http://emberjs.com/guides/cookbook/working_with_objects/continuous_redrawing_of_views/\n//\n// #pulse is updated every ~15-seconds\n//\nvar ClockService = Ember.Object.extend({\n pulse... | javascript | edit | 0 | 2 | mit | 083e928a4b8260b92646fe2ce14a34b6e67c8bb4 | substantial/substantial-dash-client | app/initializers/clock-service.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nimport _ from 'lodash'\nimport postcss from 'postcss'\n\nfunction buildMediaQuery(breakpoint) {\n if (_.isString(breakpoint)) {\n breakpoint = {min: breakpoint}\n }\n return _(breakpoint).map((value, feature) => {\n feature =... | javascript | edit | 0 | 3 | mit | 6eed7ab4ff7ec2b9834153874d3b8813d0eda54f | tailwindlabs/tailwindcss,tailwindlabs/tailwindcss,tailwindcss/tailwindcss,tailwindlabs/tailwindcss | src/lib/addCustomMediaQueries.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nimport { createSelector } from 'reselect';\nimport { denormalize } from 'normalizr';\nimport mapValues from 'lodash/mapValues';\n\nimport teamSchema from './schema';\n\nconst selectPlayers = state => state.data.players;\n\nexport const ... | javascript | edit | 0 | 2 | mit | e186fce706c2b219bc3c5451ee8910baaf98400c | m-mik/tactic-editor,m-mik/tactic-editor | src/data/teams/selectors.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nmodule.exports = {\n rules: {\n // require trailing comma in multilines\n 'comma-dangle': [2, 'always-multiline'],\n // require function expressions to have a name\n 'func-names': 0,\n // require or disallow use of semic... | javascript | edit | 0 | 0 | mit | eb13bf4ff0d9b2f74e1de34418f0d7250fd537cc | rentpath/eslint-config-rentpath | rules/style.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nvar log4js = require('log4js');\nvar logger = log4js.getLogger();\nvar express = require('express');\nvar favicon = require('serve-favicon');\nvar bodyParser = require('body-parser');\nvar port = process.env.OPENSHIFT_NODEJS_PORT || 300... | javascript | edit | 0 | 1 | mit | cd03e20f518ade3d7875a32c040dd47cedbef360 | jimmyangel/rikitrakiws,jimmyangel/rikitrakiws | rikitrakiws.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n// Download the helper library from https://www.twilio.com/docs/python/install\n\n// Your Account Sid and Auth Token from twilio.com/console\nconst accountSid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX';\nconst authToken = 'your_auth_token';... | javascript | edit | 0 | 1 | mit | f1ae689d7dcffb5187b61f78dbed65d54322cbfe | TwilioDevEd/api-snippets,TwilioDevEd/api-snippets,TwilioDevEd/api-snippets,TwilioDevEd/api-snippets,TwilioDevEd/api-snippets,TwilioDevEd/api-snippets,TwilioDevEd/api-snippets,TwilioDevEd/api-snippets,TwilioDevEd/api-snippets,TwilioDevEd/api-snippets,TwilioDevEd/api-snippets,TwilioDevEd/api-snippets | quickstart/node/autopilot/query-task/query_task.3.x.js | rejected_duplicate | Near-duplicate of sample 101913 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nfunction sortIconsBySize(icons) {\n return icons.sort((a, b) => {\n if (a.data.size < b.data.size) {\n return 1;\n } else {\n return -1;\n }\n });\n}\n\nfunction findBestIcon(icons) {\n ... | javascript | edit | 0 | 2 | mit | cc8f8d2f523a0c440bbd819610d860f86ba9d383 | jiahaog/page-icon | src/modules/findBestIcon.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nbrowser.storage.local.get( [ 'bgcolor', 'textcolor', 'messages' ] ).then( function ( r ) {\n\tvar m = r.messages.split( '\\n' );\n\tm = m[ Math.floor( Math.random() * m.length ) ];\n\n\tdocument.querySelector( 'h1' ).textContent = m;\n... | javascript | edit | 0 | 4 | mit | f4f275c057152f37855e6eb23945d07509cb2af0 | prtksxna/breathe,prtksxna/breathe | res/loader.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nfunction Population(size) {\n\tvar agents = new Array(size);\n\tvar genomes = new Array(size);\n\tfor (i = 0; i < size; i++) {\n\t\tvar prob = Math.random();\n\t\tif (prob <= 0.33) {\n\t\t\tgenomes[i] = new Genome(1,0,0);\n\t\t}\n\t\tel... | javascript | edit | 0 | 6 | mit | b9fa1633356d88a60e39b7e29f612d6f0a2901b0 | Moorkopsoesje/natural-computing,Moorkopsoesje/natural-computing,Moorkopsoesje/natural-computing | js/population.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n// @flow\n\nimport { connect } from 'lib/utils/redux-utils';\nimport * as React from 'react';\nimport { ActivityIndicator } from 'react-native';\n\nimport type { AppState } from '../redux/redux-setup';\nimport type { Colors } from '../t... | javascript | edit | 0 | 1 | bsd-3-clause | 6f3cd5a14d32b86bec9c0892a75d367e89420a05 | Ashoat/squadcal,Ashoat/squadcal,Ashoat/squadcal,Ashoat/squadcal,Ashoat/squadcal,Ashoat/squadcal,Ashoat/squadcal | native/components/list-loading-indicator.react.js | accepted | null | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.