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\nconst plugins = require('./webpack.plugins')\nconst webpack = require('webpack')\n\nmodule.exports = {\n /**\n * This is the main entry point for your application, it's the first file\n * that runs in the main process.\n */\n en... | javascript | edit | 0 | 0 | apache-2.0 | e8b81efc0799f24d099ac7073da35a4ece27d615 | stencila/stencila,stencila/stencila,stencila/stencila,stencila/stencila,stencila/stencila,stencila/stencila,stencila/stencila | desktop/webpack.main.config.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n// jquery.linkem.js\n// Copyright Michael Hanson\n// https://github.com/mybuddymichael/jquery-linkem\n\n(function( $ ) {\n\n $.fn.linkem = function() {\n var linked = this;\n this.on( \"keydown keyup mousedown mouseup\", function... | javascript | edit | 0 | 1 | mit | 9413f0cb3b4bd6545d29e79e9b656469b209a417 | mybuddymichael/jquery-linkem | jquery.linkem.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nvar util = require('util');\nvar Socket = require('net').Socket;\n\n/* Make sure we choose the correct build directory */\nvar directory = process.config.default_configuration === 'Debug' ? 'Debug' : 'Release';\nvar bindings = require(_... | javascript | edit | 0 | 4 | isc | a966513e6677626454f550bd81cd50efce79c86f | santigimeno/node-unix-stream,santigimeno/node-unix-stream,santigimeno/node-unix-stream | src/unix_stream.js | rejected_duplicate | Near-duplicate of sample 68995 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n/**\n * Simple initializer that implements the mutationObserverMixin \n * in all the Components. It uses a flag defined in the app \n * environment for it.\n */\n\nimport Ember from 'ember';\nimport mutationObserver from '../mixins/muta... | javascript | edit | 0 | 5 | mit | ada006bbcee7e855f9ee44acbd777928a0c58d1b | zzarcon/ember-cli-Mutation-Observer,zzarcon/ember-cli-Mutation-Observer | addon/initializers/mutation-observer.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nimport React, { Component } from 'react';\n\n/* global styles for app */\nimport './styles/app.scss';\n\n/* application components */\nimport { Header } from '../../components/Header';\nimport { Footer } from '../../components/Footer';\... | javascript | edit | 0 | 1 | mit | 74386ac41257a7ea865aefd09631ff87815c23a5 | dramich/Chatson,badT/twitchBot,badT/Chatson,badT/twitchBot,dramich/Chatson,dramich/twitchBot,TerryCapan/twitchBot,TerryCapan/twitchBot,dramich/twitchBot,badT/Chatson | src/components/App/index.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n// npm dependencies\nconst mongoose = require('mongoose');\n\n// defines Product model\n// contains 3 fields (title, description, and price)\nlet Product = mongoose.model('Product', {\n title: {\n type: String,\n required: true,\... | javascript | edit | 0 | 0 | mit | 47b311db68aa5343f66e3f5a5fd77602bd3e2e9e | dshaps10/full-stack-demo-site,dshaps10/full-stack-demo-site | server/models/products.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n/**\n * Created by mgab on 14/05/2017.\n */\nimport React,{ Component } from 'react'\nimport Title from './common/styled-components/Title'\n\nimport Lottery from './Lottery'\n\n\nexport default class Lotteries extends Component {\n\n r... | javascript | edit | 0 | 2 | mit | 1f13a1254fbf5303a58bf75b14b160e11d7dd30e | mihailgaberov/lottoland-react-demo,mihailgaberov/lottoland-react-demo | src/components/Lotteries.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nimport { getColor } from './helpers';\nimport { StyleSheet, View, Text } from 'react-native';\nimport { TYPO, THEME_NAME } from './config';\nimport React, { Component, PropTypes } from 'react';\n\nconst styles = StyleSheet.create({\n ... | javascript | edit | 0 | 2 | mit | fc9bdc4a183ea90c596603bdc5cdc62e2902c1ce | xotahal/react-native-material-ui,mobileDevNativeCross/react-native-material-ui,xvonabur/react-native-material-ui,blovato/sca-mobile-components,ajaxangular/react-native-material-ui,kenma9123/react-native-material-ui | lib/Subheader.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nimport handleAdapter from '../handleAdapter'\n\nexport default (config) => {\n\tif ( ! config.enabled) return (req, res, next) => { next() }\n\n\tvar verifyHeader = ( !! config.header)\n\tvar header = (config.header || 'Authorization').... | javascript | edit | 0 | 5 | mit | 28c89588650841686f1c0c515360686a5ac0afd8 | kukua/concava | src/middleware/authenticate.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nimport History from '../../../src/history'\n\ndescribe('History::setLimit', function() {\n const action = n => n\n\n it('sets the correct size given Infinity', function() {\n const history = new History()\n history.setLimit(Infi... | javascript | edit | 0 | 1 | mit | edbcdb75813fdd8149c147f0c7dc5138e06307e6 | vigetlabs/microcosm,vigetlabs/microcosm,vigetlabs/microcosm | test/unit/history/setLimit.test.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nphoxy._ClickHook =\n{\n _: {},\n};\n\nphoxy._ClickHook._.click =\n{\n InitClickHook: function()\n {\n document.querySelector('body').addEventListener('click', function(event)\n {\n var target = event.target;\n ... | javascript | edit | 0 | 7 | apache-2.0 | 2990ed3071a0969145e0a76beae6ad057e6e14f9 | phoxy/phoxy,phoxy/phoxy | subsystem/click.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\ndefine([\n\n 'Backbone',\n\n //Collection\n 'app/collections/games'\n\n], function(\n\n Backbone,\n\n Games\n\n){\n\n var GameController = Backbone.View.extend({\n\n events: {\n 'keyup .js-create-game' : 'create'\n },\n... | javascript | edit | 0 | 2 | mit | 819345213938c7b6df4eaeb2dac2c39b2078e1d0 | tangosource/pokerestimate,tangosource/pokerestimate | public/javascripts/app/views/gameController.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\ndefine(function () {\n return [\n {\n \"default\": {\n name: \"TestForm\",\n label: \"TestForm\",\n _elements: [\n {\n \"default\": {\n name: \"Name\",\n type: ... | javascript | edit | 0 | 1 | bsd-3-clause | e29974b1adcb91af1a65ac474fcb36d7a0e24098 | blinkmobile/forms,blinkmobile/forms | test/17_image/definitions.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n/*jshint node:true*/\n\nvar existsSync = require('exists-sync');\n\nmodule.exports = {\n description: 'Install telling-stories dependencies',\n\n normalizeEntityName: function() {},\n\n afterInstall: function() {\n // Register shu... | javascript | edit | 0 | 2 | mit | 7bfa2357a3764c9979d078a459759bcfd94f8e46 | mvdwg/telling-stories,mvdwg/telling-stories | blueprints/telling-stories/index.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nvar studentSignUp = function(timeslot_id){\n var data = {};\n data.subject = $(\"#subject-input\").val();\n $(\"#modal_remote\").modal('hide');\n $.ajax({\n data: data,\n type: \"PATCH\",\n url: \"/api/timeslots/\" + ... | javascript | edit | 0 | 1 | mit | 82344afed3636343877719fa3aa03377ec6c4159 | theresaboard/theres-a-board,theresaboard/theres-a-board,theresaboard/theres-a-board | app/assets/javascripts/student_signup.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n// import {replace} from 'react-router-redux'\nimport {authExpired} from 'shared/actions/auth'\nimport {publishNotification as notify} from 'shared/actions/notifications'\n\nimport {HTTP_FORBIDDEN} from 'shared/constants'\n\nconst notif... | javascript | edit | 0 | 7 | mit | 56c2e6b543e51ec44a5bcb133ef9511c50d0f4ff | mark-rushakoff/influxdb,influxdb/influxdb,li-ang/influxdb,mark-rushakoff/influxdb,influxdata/influxdb,influxdb/influxdb,influxdb/influxdb,nooproblem/influxdb,mark-rushakoff/influxdb,influxdb/influxdb,mark-rushakoff/influxdb,li-ang/influxdb,influxdb/influxdb,nooproblem/influxdb,nooproblem/influxdb,influxdata/influxdb,ma... | ui/src/shared/middleware/errors.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nmodule.exports = function() {\n console.log(\"Maintaining Structures... \" + Game.getUsedCpu());\n var newCandidates = [],\n links = [],\n spawns = [];\n Object.keys(Game.structures).forEach(function(structureId) ... | javascript | edit | 0 | 3 | mit | 675134d0bb49567fade2501538dc088b21cdab64 | pmaidens/screeps,pmaidens/screeps | StructureMaintainer.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nconst Backbone = require('backbone');\nrequire('backbone.marionette');\nconst Repository = require('../../domain/repository');\nconst TeamItemViewTemplate = require('../template/team-item-view-template.hbs');\nconst Template = require('... | javascript | edit | 0 | 1 | mit | 2825711cff4a32829bfa94afb00ec5168f524382 | hagifoo/gae-pomodoro,hagifoo/gae-pomodoro,hagifoo/gae-pomodoro | webapp/src/ui/view/sidenav-view.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n(function () {\n 'use strict';\n\n define(\n [\n 'lodash',\n 'jquery'\n ],\n function (_, $) {\n return function (baseUrl, ajaxOptions, noCache, logErrors) {\n v... | javascript | edit | 0 | 5 | mit | 00e9721fef7c4438a6fae92ace89fbd59397912d | rwahs/research-frontend,rwahs/research-frontend | public/app/services/searchService.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nvar _ = require('underscore');\n\n_.extend(Array.prototype, {\n //deprecated! -> forEach (ist auch ein JS-Standard!)\n each: function(fn, scope) {\n _.each(this, fn, scope);\n },\n\n //to use array.forEach directly\n ... | javascript | edit | 0 | 3 | bsd-2-clause | 49dfd4fea21ee7868a741c770db551c6e3bcdf5b | kaufmo/koala-framework,kaufmo/koala-framework,koala-framework/koala-framework,kaufmo/koala-framework,koala-framework/koala-framework | commonjs/frontend-core.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nimport Base from './base';\nimport * as CONST from '../constants/pieceTypes';\n\nexport default class NullPiece extends Base {\n constructor({ type, x, y, movable = false, isPlaced = false }) {\n super({ type, x, y, movable, isPlac... | javascript | edit | 0 | 1 | mit | dfd8429c117fa2bf0af2a336807d40296b68ab84 | mgi166/usi-front,mgi166/usi-front | frontend/src/shogi/pieces/nullPiece.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nmodule.exports = function(grunt) {\n\n grunt.config.init({\n pkg: grunt.file.readJSON('package.json')\n });\n\n grunt.loadNpmTasks('grunt-eslint');\n grunt.config('eslint', {\n dist: {\n options: {\n configFile: '.... | javascript | edit | 0 | 1 | mit | eb05d0a5b3b2fd16b1056d23118f1bfc093cb00f | Tyriar/touchtap-event,Tyriar/touchtap-event | GruntFile.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nvar PI = require(\"../lib\");\n\n// Two decimals\nconsole.log(PI(3));\nconsole.log(PI(16));\n\n// 100 decimals\nconsole.log(PI(100));\n\n```\n\nApply this change: Prepend \"3.\" since the function returns the decimals."
},
{
"ro... | javascript | edit | 0 | 0 | mit | 66deb115264bfccba20ce5daac9ee252febd245d | IonicaBizau/pi-number | test/index.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n/*!\n * React Native Autolink\n *\n * Copyright 2016-2019 Josh Swan\n * Released under the MIT license\n * https://github.com/joshswan/react-native-autolink/blob/master/LICENSE\n */\n\nimport Adapter from 'enzyme-adapter-react-16';\nimp... | javascript | edit | 0 | 0 | mit | 5af9b4617fd2f0fc3e613d6695ec876814deb793 | joshswan/react-native-autolink,joshswan/react-native-autolink | test/setup.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nimport { useReducer, useCallback } from 'react';\nimport getReducer from '../pages/dataTableUtilities/reducer/getReducer';\nimport getColumns from '../pages/dataTableUtilities/columns';\nimport { debounce } from '../utilities/index';\n\... | javascript | edit | 0 | 1 | mit | 5f328870bf71aecd4f6621263474b3feda9c0729 | sussol/mobile,sussol/mobile,sussol/mobile,sussol/mobile | src/hooks/usePageReducer.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nconst serverEndpoints = require('./server')\n\nmodule.exports = function(config) {\n config.set({\n basePath: '..',\n frameworks: ['detectBrowsers', 'mocha', 'chai'],\n detectBrowsers: {\n preferHeadless: true,\n use... | javascript | edit | 0 | 3 | mit | 66768e0aae1eeb622d0a901ee376d3f4d108f765 | github/fetch,aleclarson/fetch | test/karma.config.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nvar GradientStop = Base.extend({\n\tbeans: true,\n\n\t// TODO: support midPoint? (initial tests didn't look nice)\n\tinitialize: function(color, rampPoint) {\n\t\tthis.color = Color.read([color]);\n\t\tthis.rampPoint = rampPoint !== nul... | javascript | edit | 0 | 2 | mit | 484d74160b829a5e75011c62224cbb149f0b236e | EskenderDev/paper.js,baiyanghese/paper.js,li0t/paper.js,nancymark/paper.js,luisbrito/paper.js,iconexperience/paper.js,luisbrito/paper.js,fredoche/paper.js,JunaidPaul/paper.js,superjudge/paper.js,lehni/paper.js,ClaireRutkoske/paper.js,baiyanghese/paper.js,0/paper.js,ClaireRutkoske/paper.js,legendvijay/paper.js,superjudg... | src/color/GradientStop.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nexport default `import { h, app } from \"hyperapp\"\n\napp({\n init: 0,\n view: state =>\n h(\"div\", {}, [\n h(\"h1\", {}, state),\n h(\"button\", { onclick: state => state - 1 }, \"subtract\"),\n h(\"button\", { on... | javascript | edit | 0 | 0 | mit | 48acd862586847ef3d9310c5be4467aa3481744f | jbucaran/hyperapp,hyperapp/hyperapp,hyperapp/hyperapp | docs/src/pages/Home/counterCode.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n//= require ./core\n//= require ./config\n//= require_self\n//= require_tree ./routers\n//= require_tree ./views\n//= require_tree ./models\n\n(function () {\n\n\tvar Drop = window.Drop;\n\n\t_.extend(Drop, Marbles.Events, {\n\t\tModels... | javascript | edit | 0 | 6 | bsd-3-clause | 386fbab3484a3bec5c2dcb538825c17979c0233e | cupcake/files-web,cupcake/files-web | lib/assets/javascripts/drop.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nmodule.exports = {\n normalizeEntityName: function() {},\n\n afterInstall: function() {}\n};\n\n```\n\nApply this change: Add bower package to project\n\nBelieve this will fix issue #3, plus is desired behaviour anyway because you nee... | javascript | edit | 0 | 1 | mit | 74c191b2f5058ecff0755b44eb55f79953e13808 | Tonkpils/ember-sweetalert,Tonkpils/ember-sweetalert | blueprints/ember-sweetalert/index.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n\"use babel\";\n\nimport { Emitter } from 'atom'\nexport default class EventHandlerHelper\n{\n constructor()\n {\n this.emitter = new Emitter();\n }\n\n onClose(callback)\n {\n this.emitter.on(\"maperwiki-wordcount-close\",ca... | javascript | edit | 0 | 1 | mit | 1a55b57d10c44c0e036cf1a5d0ee35ab3b79a90e | rkaradas/MaPerWiki,rkaradas/MaPerWiki | lib/Helper/EventHandlerHelper.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nvar Vue = require('vue');\n\nvar CommentService = require('./services/comment-service.js');\n\nvar template = require('./list.html');\n\nnew Vue({\n el: '#platon-comment-thread',\n render: template.render,\n staticRenderFns: te... | javascript | edit | 0 | 2 | apache-2.0 | dd2b6eb07efe252559f82dde5eb5a6e084f0d859 | pvorb/platon,pvorb/platon,pvorb/platon | src/main/javascript/list.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n\nvar App = Ember.Application.create();\n\nApp.Boards = ['common', 'intermediate', 'advanced'];\n\nApp.Host = \"http://localhost:5984\";\n\n```\n\nApply this change: Revert \"reverted change of couchdb host\"\n\nThis reverts commit 6d60... | javascript | edit | 0 | 0 | mit | 1c97af1dba133a014295c692135c2c194b500435 | Zatvobor/ember-couchdb-kit,ValidUSA/ember-couch,Zatvobor/ember-couchdb-kit,ValidUSA/ember-couch | example/src/app.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nconst debug = require('debug')\nconst log = debug('app:media:fileScanner:getFiles')\nconst { promisify } = require('util')\nconst { resolve } = require('path')\nconst fs = require('fs')\nconst readdir = promisify(fs.readdir)\nconst stat... | javascript | edit | 0 | 2 | isc | 48992018fc9bb6fa38bac553fe2132ce84a50a8a | bhj/karaoke-forever,bhj/karaoke-forever | server/Media/FileScanner/getFiles.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n/**\n A tree structure for assembling a list of render calls so they can be grouped and displayed nicely afterwards.\n\n @class ProfileNode\n**/\nvar ProfileNode = function(start, payload, parent) {\n this.start = start;\n this.time... | javascript | edit | 0 | 7 | mit | 0ef64c70248efaf7cd051d7d3d4db619cdae5589 | karthiick/ember-inspector,Patsy-issa/ember-inspector,jryans/ember-inspector,knownasilya/ember-inspector,chrisgame/ember-inspector,chrisgame/ember-inspector,jayphelps/ember-inspector,Patsy-issa/ember-inspector,jayphelps/ember-inspector,sly7-7/ember-inspector,teddyzeenny/ember-inspector,pete-the-pete/ember-inspector,embe... | ember_debug/models/profile_node.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nimport * as PIXI from 'pixi.js';\nimport PlaceTool from './placetool';\nimport {createLogDepositGraphics} from '../game/logdeposit';\n\nexport default class DepositTool extends PlaceTool {\n constructor(stage, level) {\n super(stage... | javascript | edit | 0 | 1 | mit | 1029d50240901af797ee62816b02afaafb9b5ec2 | gaviarctica/forestry-game-frontend,gaviarctica/forestry-game-frontend | src/editor/deposittool.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n(function () {\n 'use strict';\n describe('directives module', function () {\n var $compile,\n $rootScope,\n DropletMock;\n beforeEach(module('directives'));\n beforeEach(inject(function ... | javascript | edit | 0 | 1 | mit | 1e9c3b9c669c78e42fa9b6636ae72f5499b2175e | DojoGeekRA/DigitalOcean,DojoGeekRA/DigitalOcean | tests/directivesSpec.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nmodule.exports = {\n build: {\n vendor: ['vue-apollo', 'apollo-client']\n },\n router: {\n middleware: 'apollo'\n },\n plugins: [\n // Will inject the plugin in the $root app and also in the context as `i18n`\n { src: '... | javascript | edit | 0 | 0 | mit | 756929079aaf1dbef8b869d917e0fc8a0f4f3a10 | jfroffice/nuxt.js,mgesmundo/nuxt.js,mgesmundo/nuxt.js,jfroffice/nuxt.js | examples/vue-apollo/nuxt.config.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n'use strict';\n\nimport React, { PropTypes, Component } from 'react';\nimport { InteractionManager } from 'react-native';\nimport SkeletonNameHOC from './skeleton-name.hoc.js';\n\nexport default class FierySkeletonName extends Component... | javascript | edit | 0 | 1 | mit | 056be57007a61135c167b4474bca96b015e8b34b | igemnace/vim-config,igemnace/my-vim-config,igemnace/vim-config,igemnace/vim-config | cfg/.vim/templates/react-native/fire.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nimport Ember from \"ember\";\nimport config from \"../config/environment\";\n\nexport default Ember.Service.extend({\n session: Ember.inject.service(),\n rollbar: Ember.inject.service(),\n\n getReason(reason) {\n return reason ins... | javascript | edit | 0 | 5 | mit | 239bc0fe0eeae2c309902e2b56dafbd2298cb3aa | crossroads/shared.goodcity,crossroads/shared.goodcity | app/services/logger.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n/*global CodeMirror*/\nimport mobileUtils from 'ghost/utils/mobile-utils';\nimport createTouchEditor from 'ghost/assets/lib/touch-editor';\n\nvar setupMobileCodeMirror,\n TouchEditor,\n init;\n\nsetupMobileCodeMirror = function se... | javascript | edit | 0 | 4 | mit | 4dfc102903b19333a92d1180d58596179d0104ff | JohnONolan/Ghost-Admin,dbalders/Ghost-Admin,airycanon/Ghost-Admin,kevinansfield/Ghost-Admin,kevinansfield/Ghost-Admin,acburdine/Ghost-Admin,TryGhost/Ghost-Admin,dbalders/Ghost-Admin,airycanon/Ghost-Admin,acburdine/Ghost-Admin,JohnONolan/Ghost-Admin,TryGhost/Ghost-Admin | utils/codemirror-mobile.js | rejected_duplicate | Near-duplicate of sample 74851 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n/* jslint node: true */\n'use strict';\n\nvar AUTHORIZED_URLS = [\n '/index.html'\n];\nvar HOST = '0.0.0.0';\nvar PORT = 9917;\n\nfunction handleIo(socket) {\n socket.on('slide-update', function(msg) {\n socket.broadcast.emit(\"sli... | javascript | edit | 0 | 3 | mit | 4471d6844864cb28e5ddd883781b690a48490089 | mbasanta/bespoke-remote-server,mbasanta/bespoke-remote-server | public/app.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n'use strict'\n\nmodule.exports = {\n\taritGeo: function(numlist) {\n\t\tif (!Array.isArray(numlist)) {\n\t\t\treturn null;\n\t\t}\n\n\t\tif (numlist.length === 0) {\n\t\t\treturn 0;\n\t\t}\n\n\t\tif (numlist.length === 1 || numlist.leng... | javascript | edit | 0 | 6 | mit | 63b38bdb6b304d495ed17ae2defa1f7512491c5c | princess-essien/andela-bootcamp-slc | aritgeo/src/aritgeo.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n/* @flow strict-local */\nimport differenceInSeconds from 'date-fns/difference_in_seconds';\n\nimport type { Dispatch, GetState, Narrow } from '../types';\nimport * as api from '../api';\nimport { PRESENCE_RESPONSE } from '../actionCons... | javascript | edit | null | null | apache-2.0 | 66037a236a0f1b099c8e06f094a7070ab37be363 | vishwesh3/zulip-mobile,vishwesh3/zulip-mobile,vishwesh3/zulip-mobile,vishwesh3/zulip-mobile | src/users/usersActions.js | rejected_syntax | Syntax error detected by tree-sitter | false |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n'use strict';\n\n(function() {\n\n angular.module('ncsaas')\n .factory('ncUtilsFlash', ['Flash', ncUtilsFlash]);\n\n function ncUtilsFlash(Flash) {\n return {\n success: function(message) {\n this.flashMessage('succe... | javascript | edit | 0 | 2 | mit | a8e892e298630309646cd9f6f3862d17c680f80d | opennode/waldur-homeport,opennode/waldur-homeport,opennode/waldur-homeport,opennode/waldur-homeport | app/scripts/utils.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nFactoryBoy = {};\nFactoryBoy._factories = [];\n\nFactory = function (name, collection, attributes) {\n this.name = name;\n this.collection = collection;\n this.attributes = attributes;\n};\n\nFactoryBoy.define = function (name, colle... | javascript | edit | 0 | 2 | mit | 80dbd6b199ab4a8a014150731303d31e7f7ba529 | sungwoncho/factory-boy | lib/factory-boy.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nimport moment from 'moment';\n\nimport { Posts } from '../../api/collections';\n\nconst seedPosts = () => {\n const postCount = Posts.find().count();\n\n if (postCount === 0) {\n for (let i = 0; i < 50; i++) {\n Posts.insert({... | javascript | edit | 0 | 3 | apache-2.0 | 150f734f4aae7a73a9fd3a6e6dd6017fc07cdd4d | evancorl/portfolio,evancorl/skate-scenes,evancorl/portfolio,evancorl/skate-scenes,evancorl/skate-scenes,evancorl/portfolio | imports/server/seed-data/seed-posts.js | rejected_duplicate | Near-duplicate of sample 102020 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nconst ForkTsCheckerWebpackPlugin = require('fork-ts-checker-webpack-plugin');\nconst { NewLineKind } = require('typescript');\n\nmodule.exports = {\n transpileDependencies: ['vuetify'],\n outputDir: './nest_desktop/app',\n // https:/... | javascript | edit | 0 | 1 | mit | 00d756fce1fc1f4baa3a0698fcba18421027b119 | babsey/nest-desktop,babsey/nest-desktop,babsey/nest-desktop,babsey/nest-desktop,babsey/nest-desktop | vue.config.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nimport Base from './base';\nimport process from 'reddit-text-js';\n\nclass Comment extends Base {\n _type = 'Comment';\n\n constructor(props) {\n super(props);\n\n var comment = this;\n\n this.validators = {\n body: func... | javascript | edit | 0 | 1 | mit | f93e268e7b5a809b28061ff2815121950c896cb4 | reddit/node-api-client,curioussavage/snoode,reddit/snoode,schwers/snoode,curioussavage/snoode | src/models/comment.es6.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n// Forest tables\n\n$(document).on('mouseenter', '.forest-table tbody tr', function() {\n var $row = $(this);\n\n $row.addClass('active');\n\n $(document).one('turbolinks:before-cache.forestTables', function() {\n $row.removeClass... | javascript | edit | 0 | 7 | mit | 9b5908c0bd5bd35a092b7a3b6400f90a73ff38b7 | dylanfisher/forest,dylanfisher/forest,dylanfisher/forest | app/assets/javascripts/forest/admin/partials/forest_tables.js | rejected_duplicate | Near-duplicate of sample 110901 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nvar standardPageTypes = {\n\t'event': /^(19|20)[0-9]{2}\\//\n};\n\nvar resolveUrl = function(urlFragment) {\n\treturn (/^http:\\/\\//).test(urlFragment) ? urlFragment : 'http://lanyrd.com/' + urlFragment.replace(/^\\//, '');\n};\n\nvar ... | javascript | edit | 0 | 3 | mit | 53990bb3625947fc37c643b33842e7f3ba8340f7 | markdalgleish/node-lanyrd-scraper | lib/urlresolver.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nimport createLogger from 'redux-logger';\nimport thunk from 'redux-thunk';\nimport transactionReducer from './reducers'\nimport { applyMiddleware, createStore } from 'redux';\nimport { render } from 'react-dom';\n\nimport React from 're... | javascript | edit | 0 | 0 | mit | e29490acfc65d15e3cf641516a97877c8442193e | hwaterke/inab,hwaterke/inab,hwaterke/inab,hwaterke/inab | client/src/app.js | rejected_duplicate | Near-duplicate of sample 93951 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n/**\n * Client entry point\n */\n\n// Polyfills\nimport 'babel-polyfill'\n\n// Styles\nimport 'components/styles/resets.css'\n\n// Modules\nimport { browserHistory } from 'react-router'\nimport React from 'react'\nimport ReactDOM from '... | javascript | edit | 0 | 1 | apache-2.0 | c0a1c31d1b49fddcdb790897176d9e5802da117e | cesarandreu/bshed,cesarandreu/bshed | client/config/bootstrap.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n$('#task').on('change', function() {\n if ( $(this).val() == 'custom') {\n $('#custom_videos').removeClass('hidden');\n } else {\n $('#custom_videos').addClass('hidden');\n }\n});\n\n```\n\nApply this change: Make sure UI is co... | javascript | edit | 0 | 2 | mit | 88a806cb56dadead5f48eb1a7cdec6a26fc4d166 | mdinger/awcy,tdaede/awcy,tdaede/awcy,mdinger/awcy,mdinger/awcy,mdinger/awcy,tdaede/awcy,tdaede/awcy,mdinger/awcy,tdaede/awcy,tdaede/awcy | www/submit.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n/* eslint-disable import/no-commonjs */\n\nconst webpack = require('webpack')\n\nconst baseConfig = {\n entry: './src/index.js',\n module: {\n rules: [\n {\n test: /\\.js$/,\n use: 'babel-loader',\n exclud... | javascript | edit | 0 | 0 | mit | af2827c0ce2fdca4c095fb160d3fa1437fb400a6 | joshburgess/redux-most | webpack.config.babel.js | rejected_duplicate | Near-duplicate of sample 92189 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n// priceDiscount function\n// Discounts sale price by 15% is price is > $8,000\nmodule.exports.priceDiscount = (price) => {\n\tif (price > 8000) {\n\t\treturn price * .15\n\t}\n\treturn price;\n};\n```\n\nApply this change: Fix function... | javascript | edit | 0 | 2 | mit | a8ad29163c1021ccc7055f06745d8b1a43623f3e | dshaps10/full-stack-demo-site,dshaps10/full-stack-demo-site | helper_functions/price_discount.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n/* eslint global-require: 0 */\n/* eslint import/no-dynamic-require: 0 */\n\nconst Environment = require('./environment')\nconst { existsSync } = require('fs')\n\nfunction createEnvironment() {\n const path = `./environments/${process.... | javascript | edit | 0 | 2 | mit | df21faead2b427c56152eca744f12ce8fcc1e0ca | gauravtiwari/webpacker,gauravtiwari/webpacker,usertesting/webpacker,rossta/webpacker,rossta/webpacker,rails/webpacker,usertesting/webpacker,rails/webpacker,rossta/webpacker,rossta/webpacker,usertesting/webpacker,gauravtiwari/webpacker | package/index.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nangular.module('ngIdle.countdown', ['ngIdle.idle'])\n .directive('idleCountdown', ['Idle', function(Idle) {\n return {\n restrict: 'A',\n scope: {\n value: '=idleCountdown'\n },\n link: function($scope) {\... | javascript | edit | 0 | 1 | mit | 86b19d7030564176a56d2c1ab20ebe16df33066f | dgoncalves1/ng-idle,JCherryhomes/ng-idle,HackedByChinese/ng-idle,koitoer/ng-idle,MasterFacilityList/ng-idle,JCherryhomes/ng-idle,koitoer/ng-idle,karthilxg/ng-idle,MasterFacilityList/ng-idle,karthilxg/ng-idle,msuresu/ng-idle,seegno-forks/ng-idle,jpribesh/ng-idle,dgoncalves1/ng-idle,seegno-forks/ng-idle,msuresu/ng-idle,j... | src/countdown/countdown.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nimport WebpackDevServer from 'webpack-dev-server';\nimport config from './webpack.config.js';\nimport gulp from 'gulp';\nimport gutil from 'gulp-util';\nimport webpack from 'webpack';\n\ngulp.task('default', ['webpack-dev-server']);\n\n... | javascript | edit | 0 | 2 | mit | d36c1654f985684fc798cb703f1c5b24f10f102d | wincent/hextrapolate,cpojer/hextrapolate,wincent/hextrapolate,cpojer/hextrapolate,cpojer/hextrapolate,wincent/hextrapolate | gulpfile.babel.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n'use strict';\n\nvar tmpl = require('blueimp-tmpl').tmpl;\nvar path = require('path');\nvar readTemplate = require('../../utils/read-template');\nvar projectName = require('project-name');\n\n\nfunction buildProjectWebpackConfig(options... | javascript | edit | 0 | 5 | mit | d377b7d8bfaf88408fdf3ef3182fb15df4689924 | mikechau/js-config-gen,mikechau/js-config-gen | src/configs/webpack/project-config.js | accepted | null | true |
[
{
"role": "user",
"content": "Write javascript code for the following: Update ElevateZoom uses class .zoom"
},
{
"role": "assistant",
"content": "$(function() {\n $('#zoom_01').elevateZoom();\n\n $('.zoom').each(function(element) {\n $(this).elevateZoom()\n });\n});\n"
}
] | javascript | new_file | 0 | 1 | mit | 55474b5c3cb32f1cc53fe56b82d21c04a98a560e | gouf/test_elevate_zoom,gouf/test_elevate_zoom | app/assets/javascripts/evZoom.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\ndefine([\"sugar-web/graphics/icon\"], function (icon) {\n describe(\"icon\", function () {\n var wasLoaded;\n var iconUrlResult;\n\n it(\"should be able to change icon more than once\", function () {\n ... | javascript | edit | 0 | 1 | apache-2.0 | 8fd75333771f1fd3170c0796740c730b2f0eb807 | godiard/sugar-web,sugarlabs/sugar-web | test/graphics/iconSpec.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n// Write a function arrayToList that builds up a data structure like the previous one when given [1, 2, 3] as argument, and write a listToArray function that produces an array from a list. Also write the helper functions prepend, which ... | javascript | edit | 0 | 2 | mit | 37a73986d3d36353a30e661b3989dcd8a646bc39 | OperationCode/eloquent-js | 04/jjhampton-ch4-list.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nvar assert = require('chai').assert;\nvar http = require('http');\nvar mathServer = require('../lib/mathServer.js');\nvar request = require('supertest');\n\nprocess.env.NODE_ENV = 'test';\n\ndescribe('Acceptance test', function () {\n ... | javascript | edit | 0 | 1 | mit | 4a189c3a3dd1f0304a788c280d1839d94c40dc47 | antonleykin/InteractiveShell,fhinkel/InteractiveShell,fhinkel/InteractiveShell,antonleykin/InteractiveShell,fhinkel/InteractiveShell,antonleykin/InteractiveShell,fhinkel/InteractiveShell | tests/acceptance.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nvar assert = require('assert')\n // , expresso = require('expresso')\n , dustx = require('dust-x')\n \nmodule.exports = {\n 'test 1': function(end) {\n assert.ok(true, 'pre-test')\n \n end(function() {\n ... | javascript | edit | 0 | 1 | mit | 338634c1d6baeb464d3f723452427a8cd0d60929 | laurie71/dust-x | test/smoke-tests.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n// Karma configuration\n\n// base path, that will be used to resolve files and exclude\nbasePath = '';\n\n// list of files / patterns to load in the browser\nfiles = [\n JASMINE,\n JASMINE_ADAPTER,\n 'test/components/angular/angular.... | javascript | edit | 0 | 0 | mit | 61f824798c65b00721bda812228c5357e83bbcd7 | Malkiat-Singh/angular-snap.js,kzganesan/angular-snap.js,jtrussell/angular-snap.js,Malkiat-Singh/angular-snap.js,kzganesan/angular-snap.js,jtrussell/angular-snap.js | karma.conf.js | rejected_duplicate | Near-duplicate of sample 90924 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nexport const SPECIFICATION = 'spec';\nexport const MDN = 'mdn';\nexport const VIDEO = 'video';\nexport const ARTICLE = 'article';\nexport const DOCS = 'docs';\nexport const ANNOUNCEMENT = 'announcement';\nexport const BOOK = 'book';\nex... | javascript | edit | 0 | 0 | mit | 1060df09e87e63a0a14e5cfa9d206721fa6d14cf | tddbin/katas,tddbin/katas,tddbin/katas | katas/tags.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nvar Q = require(\"../vendor/q/q\");\n\nexports.post = function (url, data) {\n console.log('posting to', url);\n var defer = Q.defer();\n\n var xhr = new XMLHttpRequest();\n xhr.onerror = function(err) {\n console.log('XMLHttpReq... | javascript | edit | 0 | 6 | apache-2.0 | 9fe0c1a5abd33fdbf4e2c90dd60874ec56b1e58c | kitt-browser/pocket,kitt-browser/pocket | src/js/xhr.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nimport types from '../constants/ActionTypes'\nimport utils from '../../shared/utils'\n\nfunction replaceUserInfo(userInfo) {\n return {\n type: types.REPLACE_USER_INFO,\n userInfo\n }\n}\n\nfunction fetchUserInfo() {... | javascript | edit | 0 | 1 | mit | 3f1b7263c9f33ff205ac5ca3fa1466532906b3d1 | chikara-chan/react-isomorphic-boilerplate,qiuye1027/screenInteraction,qiuye1027/screenInteraction,chikara-chan/react-isomorphic-boilerplate | client/common/actions/index.js | rejected_duplicate | Near-duplicate of sample 103766 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nvar app = require('ridge');\n\nmodule.exports = require('ridge/view').extend({\n\tevents: {\n\t\t'click button': function(e) {\n\t\t\te.preventDefault();\n\t\t\te.stopPropagation();\n\t\t},\n\t\t'click button[data-command=\"publish\"]':... | javascript | edit | 0 | 2 | mit | e5ce6180efaea8382a8514501ebb7bae88c3b541 | thecodebureau/ridge | views/crud-model.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nlet Path = require('path');\nlet Hapi = require('hapi');\nvar Good = require('good');\n\nlet server = new Hapi.Server({\n connections: {\n routes: {\n files: {\n relativeTo: Path.join(__dirname, 'public')\n }\n }... | javascript | edit | 0 | 2 | mit | e033d945329bb146ee82fc9d51f04665b950aa6b | bbondy/brianbondy.node,bbondy/brianbondy.node,bbondy/brianbondy.node | src/server.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nvar helper = exports;\nvar copyDir = helper.copyDir = function (source, target) {\n var fs = require('fs');\n var dir = fs.readdirSync(source);\n dir.forEach(function(item){\n var s = fs.statSync(source + '/' + item);\n if(s.is... | javascript | edit | 0 | 3 | mit | fa60bd7e2d0eec674595bff231c05d364f4d4aa1 | bigcompany/resource | lib/helper.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nvar Gificiency = (function() {\n 'use strict';\n\n var search = function(filter) {\n $('a').each(function() {\n var elem = $(this);\n if (elem.text().search( new RegExp(filter, 'i') ) < 0) {\n elem.hide();\n }... | javascript | edit | 0 | 2 | mit | 185e50fb0d94bbde6abb94c47e36046746912306 | drewbarontini/gificiency,drewbarontini/gificiency,drewbarontini/gificiency | .gificiency/.gificiency.js | rejected_duplicate | Near-duplicate of sample 76694 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n/**\n * @flow\n */\n\nimport {default as Sound} from 'react-native-sound'\n\nexport default class SoundsManager {\n constructor (onChangeCallback) {\n this.muted = false\n this.sounds = {}\n this.onChangeCallback = onChangeCal... | javascript | edit | 0 | 4 | mit | 3dcafb57bbc59709e5722fbdac07ad9493db4949 | antonfisher/game-calcuman,antonfisher/game-calcuman,antonfisher/game-calcuman | CalcuMan/src/classes/SoundsManager.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n/** @jsx React.DOM */\n\nvar React = require('react');\nvar Loader = require('../../lib/react-loader');\nvar expect = require('chai').expect;\n\nvar loader;\n\ndescribe('Loader', function () {\n describe('before loaded', function () {\... | javascript | edit | 0 | 4 | mit | cc5aa2d5902750420cb9dfde1acec0893e22df40 | CarLingo/react-loader,gokulkrishh/react-loader,alengel/react-loader,aparticka/react-loader,CarLingo/react-loader,quickleft/react-loader,CognizantStudio/react-loader,CognizantStudio/react-loader,aparticka/react-loader,quickleft/react-loader,gokulkrishh/react-loader,dallonf/react-loader,insekkei/react-loader,dallonf/reac... | test/spec/react-loader-test.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nimport React from 'react'\nimport ReactDOM from 'react-dom'\nimport getRoutes from './config/routes'\nimport { createStore, applyMiddleware } from 'redux'\nimport { Provider } from 'react-redux'\nimport users from 'redux/modules/users'\... | javascript | edit | 0 | 5 | mit | 64038fb9752955742180bc734fb8686dede22662 | StuartPearlman/duckr,StuartPearlman/duckr | app/index.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n$.fn.productAutocomplete = function (options) {\n 'use strict';\n\n // Default options\n options = options || {};\n var multiple = typeof(options.multiple) !== 'undefined' ? options.multiple : true;\n\n this.select2({\n minimumI... | javascript | edit | 0 | 3 | bsd-3-clause | b353bbdba0c80a6c82586c40e9402601d7f96a18 | keatonrow/spree,keatonrow/spree,azclick/spree,keatonrow/spree,azclick/spree,keatonrow/spree,azclick/spree,azclick/spree | backend/app/assets/javascripts/spree/backend/product_picker.js | rejected_duplicate | Near-duplicate of sample 73943 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nimport { getQueryStringParam, substanceGlobals, platform } from 'substance'\nimport { TextureWebApp } from 'substance-texture'\n\nwindow.addEventListener('load', () => {\n substanceGlobals.DEBUG_RENDERING = platform.devtools\n let app... | javascript | edit | 0 | 4 | mit | 90dd6b7b21c519c7c8fffd9833992e9de4cf8d95 | substance/texture,substance/texture | web/editor.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nimport privateInfo from \"../../../../../credentials/token.json\";\n\n/**\n * Fetches translated text using the Google Translate API\n */\nexport function getTranslation(term, fromLang, toLang) {\n const response = fetch(\"/translation... | javascript | edit | 0 | 2 | apache-2.0 | 09e3525e15e891760bcb737c9948d774aa12f061 | google/step197-2020,google/step197-2020,google/step197-2020,google/step197-2020 | frontend/src/sub-components/translate.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nTemplate.mybilltable.created = function(){\n Session.set('message', '');\n};\n\nTemplate.mybilltable.helpers({\n onReady: function(){\n //Meteor.subscribe(\"mybills\");\n\n },\n bill: function(){\n\n return bills.find({ regist... | javascript | edit | 0 | 2 | mit | bf669b035df93e5e27b5683ad59c3b68e0ac5fdb | celsom3/undocumoney,celsom3/undocumoney | client/partials/mybilltable.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nimport test from 'tape-async'\nimport helper from 'tipsi-appium-helper'\n\nconst { driver, select, idFromXPath } = helper\n\ntest('<StarRating />', async (t) => {\n const starsAndTextId = select({\n ios: idFromXPath(`//\n XCUIE... | javascript | edit | 0 | 2 | mit | 89180adaf71fda52a3879cace74c66a7fb8677fd | tipsi/tipsi-ui-kit,tipsi/tipsi-ui-kit,tipsi/tipsi-ui-kit,tipsi/tipsi-ui-kit | __tests__/e2e/01_StarRating.test.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nimport Ember from 'ember';\nimport { defer } from 'rsvp';\nimport { Environment } from './external/environment';\nimport { assert } from '@ember/debug';\nimport { join, next, once } from '@ember/runloop';\n\nexport class EmberEnvironmen... | javascript | edit | 0 | 2 | mit | 959ab8d9aa78c7fc931a25d94c3721585368d6f5 | machty/ember-concurrency,machty/ember-concurrency,machty/ember-concurrency,machty/ember-concurrency | addon/-private/ember-environment.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n// Test that loading SQL files for PostgreSQL works.\n'use strict';\n\nvar Code = require('code');\nvar Lab = require('lab');\nvar Querious = require('../index');\nvar path = require('path');\n\nvar lab = module.exports.lab = Lab.script... | javascript | edit | 0 | 1 | isc | 30f098e5baab15c95a111050d02ec4e9a16ffcbe | mikl/querious | test/postgres-sql-loader.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n// @flow\n\n// Recursively remove undefined, null, empty objects and empty arrays\nexport const compact = (obj: any): any => {\n if (obj === null) {\n return undefined;\n }\n\n if (Array.isArray(obj)) {\n const compacted = obj.... | javascript | edit | null | null | apache-2.0 | 62081fa8127cce340675fb462a83ee9c457e13a3 | contactlab/contacthub-sdk-nodejs | src/utils.js | rejected_syntax | Syntax error detected by tree-sitter | false |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n/* eslint-env node, jest */\n\nconst shogi = require('./index.js');\nconst Slack = require('../lib/slackMock.js');\n\njest.mock('../achievements/index.ts');\n\nlet slack = null;\n\nbeforeEach(() => {\n\tslack = new Slack();\n\tprocess.e... | javascript | edit | 0 | 1 | mit | 42a38b012ae01477845ef926d4620b12f0a418f6 | tsg-ut/slackbot,tsg-ut/slackbot,tsg-ut/slackbot,tsg-ut/slackbot,tsg-ut/slackbot,tsg-ut/slackbot | prime/index.test.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n//= require jquery-1.8.3.min\n//= require_tree .\n\njQuery(function($) {\n $('.letter-opener').on('click', 'tr', function() {\n var $this = $(this);\n $('iframe').attr('src', $this.find('a').attr('href'));\n $this.parent().fin... | javascript | edit | 0 | 1 | mit | c690ddf5bbcbc0fd9bedfe547d924f1621dcd76c | ProctorU/letter_opener_web,sergey-verevkin/letter_opener_web,fgrehm/letter_opener_web,sergey-verevkin/letter_opener_web,fgrehm/letter_opener_web,fgrehm/letter_opener_web,ProctorU/letter_opener_web,fgrehm/letter_opener_web,sergey-verevkin/letter_opener_web,ProctorU/letter_opener_web,ProctorU/letter_opener_web | app/assets/javascripts/letter_opener_web/application.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nbeforeEach(function() {\n this.addMatchers({\n toBePlaying: function(expectedSong) {\n var player = this.actual;\n return player.currentlyPlayingSong === expectedSong\n && player.isPlaying;\n }\n })\n});\n\n``... | javascript | edit | 0 | 2 | mit | 5b9aca9656e2456b7060d5cdbb62226d7b8d1ea0 | mavenlink/jasmine-gem,tjgrathwell/jasmine-gem,mavenlink/jasmine-gem,kapost/jasmine-gem,brigade/jasmine-gem,amandamholl/jasmine-gem,amandamholl/jasmine-gem,brigade/jasmine-gem,mavenlink/jasmine-gem,kapost/jasmine-gem,amandamholl/jasmine-gem,brigade/jasmine-gem,tjgrathwell/jasmine-gem | lib/generators/jasmine/examples/templates/spec/javascripts/helpers/SpecHelper.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nmodule.exports = function (paginator, filter) {\n const iterator = paginator[Symbol.asyncIterator]()\n\n let done = false\n\n return {\n [Symbol.asyncIterator]: function () {\n return this\n },\n ... | javascript | edit | 0 | 5 | mit | 5443aa9f1a393557af8dc833d10a051b631c7e79 | bigeasy/dilute,bigeasy/dilute | dilute.js | rejected_duplicate | Near-duplicate of sample 96278 | true |
[
{
"role": "user",
"content": "Write javascript code for the following: Add HTTP json api logic"
},
{
"role": "assistant",
"content": "var http = require('http');\nvar url = require('url');\n\n// return a JSON object with the hour minute and second\nfunction parseTime(time){\n return {\n ... | javascript | new_file | 0 | 4 | mit | a52733b4a7396ac1f8da75abd3ce0a49e4f89f8a | BrianLusina/JS-Snippets | NodeJS/HttpJsonApi/httpjsonapi.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nimport template from './expert-contract-form.html';\n\nconst expertContract = {\n template,\n bindings: {\n model: '=',\n form: '<',\n contractTemplate: '<',\n expert: '<',\n errors: '<',\n },\n controller: class Expe... | javascript | edit | 0 | 4 | mit | 920d357a257d13cec80f227d1637a437070d7557 | opennode/waldur-homeport,opennode/waldur-homeport,opennode/waldur-homeport,opennode/waldur-homeport | app/scripts/components/experts/requests/create/expert-contract-form.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nself.addEventListener('push', function(event) {\n event.waitUntil(clients.matchAll().then(function(clientList) {\n var focused = false;\n for (var i = 0; i < clientList.length; i++) {\n if (clientList[i].focused) {\n ... | javascript | edit | 0 | 5 | mit | 62c0a2cde5383d927fa8d45a26b04f5237030818 | TimAbraldes/serviceworker-cookbook,mozilla/serviceworker-cookbook,mozilla/serviceworker-cookbook,TimAbraldes/serviceworker-cookbook | push-clients/service-worker.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n// @flow\n\n/* Transform a Promise-returning function into a function that can optionally\n * take a callback as the last parameter instead.\n *\n * @param {Function} fn a function that returns a Promise\n * @param {Obje... | javascript | edit | 0 | 4 | mit | ea1907a5efc980997dde8b34bff7557a106ad9cd | DimensionSoftware/optional-callback | src/index.js | rejected_duplicate | Near-duplicate of sample 71489 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nimport { createActions, handleActions } from 'redux-actions'\nimport { takeEvery } from 'redux-saga/effects'\n\nexport const createModule = (moduleName, definitions, defaultState) => {\n\n const identityActions = []\n const actionMap ... | javascript | edit | 0 | 6 | mit | bed927e07e502c94127a2e2646294bb5bb64f5ca | moducks/moducks | src/index.js | rejected_duplicate | Near-duplicate of sample 69385 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nanyware_config = {\n DEBUG: {\n status: true, // Persistent status icons\n debugView: true, // Show game debug view\n console: false, // Javascript console debug output\n },\n\n // The sequence of the games to be r... | javascript | edit | 0 | 0 | mit | 6b01912d1aea129a28262435ff1d1700a257a4d8 | anyWareSculpture/sculpture-client,anyWareSculpture/sculpture-client,anyWareSculpture/sculpture-client | configs/fast-config.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nimport fs from \"fs\";\nimport InputStream from \"./InputStream\";\n\nexport function isGreyspace(string) {\n if (string === \"\" ||\n string === \" \" ||\n string === \"\\n\" ||\n /^\\s*$/.test(string)) {\n ... | javascript | edit | 0 | 11 | mit | 9246a44a065a046293492edeccafc376a9aa628f | Mark-Simulacrum/pretty-generator,Mark-Simulacrum/attractifier | src/utils.js | rejected_complexity | Cyclomatic complexity too high: 11 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n// This is a manifest file that'll be compiled into application.js, which will include all the files\n// listed below.\n//\n// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,\n// or a... | javascript | edit | 0 | 1 | mit | 15c69f68a85e0bffca04e8c67b81b7260198f1c8 | bdisney/eShop,bdisney/eShop,bdisney/eShop | app/assets/javascripts/application.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nvar git = require(\"./git\");\nvar hostname = require(\"./hostname\");\n\nexports.load = function(root) {\n var manifest = require(root + \"/package.json\");\n manifest.revision = \n manifest.revision ||\n git.getHea... | javascript | edit | 0 | 3 | bsd-3-clause | 00f48eb9ab3f99883fea421afab2ddd875f32cf3 | humberto-garza/VideoJuegos,humberto-garza/VideoJuegos | node_modules/c9/manifest.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n//= require libs/jquery/jquery-ui-1.8.16.custom.min\n//= require libs/jquery/plugins/jquery.base64\n//= require libs/jquery/plugins/jquery.mustache.js\n//= require core\n//= require devolution\n//= require popup\n//= require geo-locator... | javascript | edit | 0 | 0 | mit | de7309b150f877e59c8303748f84fd9a9e96c472 | alphagov/static,tadast/static,tadast/static,kalleth/static,robinwhittleton/static,kalleth/static,tadast/static,robinwhittleton/static,alphagov/static,tadast/static,alphagov/static,robinwhittleton/static,kalleth/static,robinwhittleton/static,kalleth/static | app/assets/javascripts/application.js | rejected_duplicate | Near-duplicate of sample 88052 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n// view engine setup\nnunjucks.configure('views', {\n autoescape: true,\n express: app\n});\n\n```\n\nApply this change: Set default extension (html) for nunjucks"
},
{
"role": "assistant",
"content": "\n// view engine set... | javascript | edit | 0 | 0 | mit | b1e3644c1eb0f68ec02325fca257198a276c4133 | sahat/boilerplate,sahat/megaboilerplate,sahat/megaboilerplate,sahat/megaboilerplate,sahat/boilerplate | generators/template-engine/modules/nunjucks/nunjucks-express.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nexport default {};\n\nvar Twitter = require('twit-stream');\nvar keys =require('./authentication.js');\n\n\nvar stream = new Twitter(keys).stream('statuses/sample');\n\n/// connection configuration for stream object to connect to API\n\... | javascript | edit | 0 | 1 | isc | ea82d61def4d3e9be56cc4a3c8f2b01c5ff4c3e1 | edwardpark/d3withtwitterstream,edwardpark/d3withtwitterstream | server/app.js | accepted | null | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.