messages listlengths 2 2 | language stringclasses 8
values | prompt_type stringclasses 2
values | lint_errors int64 0 129 ⌀ | cyclomatic_complexity int64 0 32 ⌀ | license stringclasses 7
values | commit stringlengths 40 40 | repos stringlengths 5 116k | new_file stringlengths 4 220 | status stringclasses 6
values | error stringlengths 26 74 ⌀ | is_valid_syntax bool 2
classes |
|---|---|---|---|---|---|---|---|---|---|---|---|
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nimport React, { PropTypes } from 'react';\nimport { createStyleSheet } from 'stylishly';\nimport Paper from 'material-ui/Paper';\n\nconst styleSheet = createStyleSheet('FlatButtons', (theme) => {\n return {\n root: theme.mixins.gutt... | javascript | edit | 0 | 2 | mit | 25d93309a325fdd5f06036c2849321618add3ee2 | kybarg/material-ui,dsslimshaddy/material-ui,und3fined/material-ui,callemall/material-ui,Kagami/material-ui,cherniavskii/material-ui,cherniavskii/material-ui,cherniavskii/material-ui,cherniavskii/material-ui,oliviertassinari/material-ui,AndriusBil/material-ui,oliviertassinari/material-ui,lgollut/material-ui,rscnt/materi... | docs/site/src/demos/paper/PaperSheet.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nexport function up(knex) {\n return knex.schema.table('comments', (table) => {\n table.integer('hide_type').defaultTo(0).notNullable();\n table.index('hide_type', 'comments_hide_type_idx', 'btree');\n });\n}\n\nexport function d... | javascript | edit | 0 | 2 | mit | 2ce824eddd24b3cecd9f32bd39e69d5c8ae79eeb | FreeFeed/freefeed-server,FreeFeed/freefeed-server | migrations/20170218174938_hidden_comment.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nimport Ember from 'ember';\n\nconst { trim } = Ember.$;\n\nexport function cleanQuery(query) {\n return trim(query).replace(/[\\-,?~!@#$%&*+\\-'=\"]/, '');\n}\n\n```\n\nApply this change: Replace bad chars with a space when cleaning up... | javascript | edit | 0 | 1 | mit | 8e47460a0312168977dee7307cdf845451b704c1 | thecoolestguy/frontend,dartajax/frontend,gabycampagna/frontend,stopfstedt/frontend,gboushey/frontend,jrjohnson/frontend,djvoa12/frontend,dartajax/frontend,djvoa12/frontend,stopfstedt/frontend,gboushey/frontend,thecoolestguy/frontend,ilios/frontend,jrjohnson/frontend,gabycampagna/frontend,ilios/frontend | app/utils/query-utils.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nimport React from 'react';\nimport { Link } from 'react-router';\n\nimport Icon from '../widgets/Icon';\nimport Avatar from '../widgets/Avatar';\n\nimport './UserList.scss';\n\nexport default class UserList extends React.Component {\n ... | javascript | edit | 0 | 1 | mit | f9bbfaba64e58e3ef1b4819aecb0647ad91e4ed0 | Sekhmet/busy,busyorg/busy,Sekhmet/busy,busyorg/busy,ryanbaer/busy,ryanbaer/busy | src/user/UserList.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n$('#tiny_inner_image').bind('change', function (event) {\n formElement = document.getElementById(\"tinymce_file_uploader\");\n data = new FormData(formElement);\n ed = tinymce.get('news_type_text');\n\n var tmpMsg = flashes.... | javascript | edit | 0 | 2 | mit | e1c24951c1edd7e94ca0fbde51ce8ed8c9cf4576 | tielitz/TinymceFastloadBundle,tielitz/TinymceFastloadBundle,tielitz/TinymceFastloadBundle | Resources/public/js/tinymce-image-upload.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n'use strict';\n\n/* global Connector */\n\nif (location.href === 'http://bandzone.cz/' || location.href === 'https://bandzone.cz/') {\n\tConnector.playerSelector = '#stats';\n\n\tConnector.getArtist = function () {\n\t\tvar text = $('.s... | javascript | edit | 0 | 2 | mit | bc00f71a2c2a1996647837a305f3aff859973b73 | fakelbst/Chrome-Last.fm-Scrobbler,inverse/web-scrobbler,inverse/web-scrobbler,galeksandrp/web-scrobbler,alexsh/web-scrobbler,carpet-berlin/web-scrobbler,alexesprit/web-scrobbler,fakelbst/Chrome-Last.fm-Scrobbler,Paszt/web-scrobbler,Paszt/web-scrobbler,carpet-berlin/web-scrobbler,galeksandrp/web-scrobbler,ex47/web-scrob... | connectors/v2/bandzone.cz.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nimport Ember from 'ember';\n\nexport default Ember.ArrayController.extend({\n persistedCats: function() {\n return this.filterBy('id');\n }.property('@each.id'),\n\n actions: {\n createCat: function() {\n var _this = this;... | javascript | edit | 0 | 1 | unlicense | b47e60362be6928da979ad61df384a092933748b | beerlington/cats-ui | app/controllers/cats.js | accepted | null | true |
[
{
"role": "user",
"content": "Write javascript code for the following: Add top level error handler."
},
{
"role": "assistant",
"content": "var http = require('http');\nhttp.createServer(require('./lrdata').urls).listen(8080);\nconsole.log(\"Server running\");\n\nprocess.on('uncaughtException',fu... | javascript | new_file | 0 | 1 | bsd-3-clause | d75dd5a17a22acac7db01b9264f7a63b33bb3a0a | alnorth/listening-room-add-ons-site | server.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nvar PluginPage = require(\"./PluginPage\");\n\nvar page = new PluginPage(\"Badge\", \"de.appplant.cordova.plugin.badge\", function(parent) {\n\n cordova.plugins.notification.badge.promptForPermission();\n\n var input = tabris.create(\... | javascript | edit | 0 | 1 | bsd-3-clause | 06ce56e58ffe5334ff6bc368d56052326c03cc50 | mkostikov/tabris-js,softnep0531/tabrisjs,moham3d/tabris-js,mkostikov/tabris-js,moham3d/tabris-js,pimaxdev/tabris,softnep0531/tabrisjs,eclipsesource/tabris-js,eclipsesource/tabris-js,eclipsesource/tabris-js,pimaxdev/tabris | examples/cordova/modules/BadgePage.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nimport express from 'express';\nimport { apolloServer } from 'graphql-tools';\nimport Schema from './data/schema';\nimport Mocks from './data/mocks';\n\nconst GRAPHQL_PORT = 8080;\n\nconst graphQLServer = express();\ngraphQLServer.use('... | javascript | edit | 0 | 1 | mit | a6993e586d3af137de24f832ac7d477e67a3a501 | vincentfretin/assembl-graphql-js-server,misas-io/misas-server,misas-io/misas-server,a1528zhang/graphql-mock-server | server.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nvar twilio = require('twilio'),\n express = require('express'),\n orderPizza = require('orderpizza'),\n sendText = require('sendText');\n\nvar app = express();\n\nvar textResponse = function(request, response) {\n console.lo... | javascript | edit | 0 | 2 | mit | 3456bc941ab1bc051d0113497b6d7942a2ac81e9 | sagnew/PizzaKeg | server.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n\"use strict\";\n\nvar ResourceReferenceView = require('../resource_reference').View;\n\nvar InlineFormulaView = function(node, viewFactory) {\n ResourceReferenceView.call(this, node, viewFactory);\n};\n\nInlineFormulaView.Prototype = ... | javascript | edit | 0 | 1 | bsd-2-clause | 25f168eb3f1ae59f2e97729498790c602a20d486 | elifesciences/lens-article | nodes/inline_formula/inline_formula_view.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nimport { initOptions, keycloak } from \"keycloak\"\n;(async() => {\n keycloak.onTokenExpired = () =>\n keycloak\n .updateToken()\n .then(() => {\n console.info(\"Token refreshed\")\n })\n .catch(error => {... | javascript | edit | 0 | 5 | mit | 35e70f4b3c5db4998faeec2d83dd711e694b5c72 | NCI-Agency/anet,NCI-Agency/anet,NCI-Agency/anet,NCI-Agency/anet,NCI-Agency/anet | client/src/index-auth.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nvar React = require('react-native');\nvar deviceScreen = require('Dimensions').get('window');\n\nvar {\n StyleSheet,\n} = React;\n\nmodule.exports = StyleSheet.create({\n container: {\n flex: 1,\n justifyContent: 'center',\n ... | javascript | edit | 0 | 0 | mit | 30b3a712de3c0b3edd23c55f65fb5d19175e83b7 | linjson/react-native-side-menu,michaelcontento/react-native-side-menu,brentvatne/react-native-side-menu,rollick/react-native-side-menu,jeffreywescott/react-native-side-menu,Kureev/react-native-side-menu,thstarshine/react-native-side-menu,IVaE-Consultants/react-native-side-menu,skv-headless/react-native-side-menu,heliel... | styles.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n/*jshint node:true*/\nmodule.exports = {\n \"framework\": \"qunit\",\n \"test_page\": \"tests/index.html?hidepassed\",\n \"disable_watching\": true,\n \"launch_in_ci\": [\n \"PhantomJS\"\n ],\n \"launch_in_dev\": [\n \"Phant... | javascript | edit | 0 | 0 | mit | 0ec82fa259232c513992d0f8077017b897b0096a | workmanw/ember-string-ishtmlsafe-polyfill,workmanw/ember-string-ishtmlsafe-polyfill | testem.js | rejected_duplicate | Near-duplicate of sample 73693 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n\"use strict\";\n\nvar program = require('commander');\nvar path = require('path');\nvar os = require('os');\n\nvar newCommand = require('./commands/new');\nvar pkg = require(path.resolve(__dirname, '..', 'package.json'));\n\n... | javascript | edit | 0 | 2 | mit | 3faadff682d0b92b8ef27063eab1f27da1090323 | cartridge/cartridge-cli,code-computerlove/slate-cli,code-computerlove/quarry | bin/programBuilder.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n'use strict';\n\n/**\n * Module dependencies.\n */\nvar mongoose = require('mongoose'),\n City = mongoose.model('City');\n\n\n/**\n * Find city by id\n */\nexports.city = function(req, res, next, id) {\n City.load(id, function(err... | javascript | edit | 0 | 3 | mit | b7ea3fcccb2e1a21a59f6dbe47d92ee27250c535 | debona/Respirez,debona/Respirez | packages/atmos/server/controllers/cities.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n'use strict';\n\nvar db = require('../../../db')\n , assign = require('es5-ext/object/assign')\n , getCostsPrintController = require('eregistrations/server/routes/business-process-costs-print');\n... | javascript | edit | 0 | 0 | mit | f037cb8ba7b6ccb68f3f46b54088cae336a4a096 | egovernment/eregistrations-demo,egovernment/eregistrations-demo | apps/business-process-demo/server/routes.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nSystem.config({\n map : {\n 'app': 'app',\n 'rxjs': 'https://unpkg.com/rxjs@5.0.0-beta.6',\n '@angular/common': 'https://unpkg.com/@angular/common@2.0.0',\n '@angular/compiler': 'https://unpkg.com/@angular... | javascript | edit | 0 | 0 | mit | 02268d91722422b9a2cdcf7d69a1cd5713e4a9c8 | chandermani/angular2byexample,chandermani/angular2byexample,chandermani/angular2byexample | guessthenumber/systemjs.config.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nangular.module( 'app' )\n.controller( 'ApplicationCtrl', function( $scope, UserSvc, jwtHelper ) {\n $scope.$on( 'login', function( _, user ) {\n $scope.currentUser = user\n })\n if (window.localStorage.token) {\n ... | javascript | edit | 0 | 2 | mit | 84c01b7cee7676442c1a628241560d5c2593118a | Driftologist/texturepot,Driftologist/texturepot | ng/application.ctrl.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n\"use strict\";\n\n// Third Party\nconst curry = require(\"lodash/fp/curry\");\nconst find = require(\"lodash/fp/find\");\nconst flow = require(\"lodash/fp/flow\");\nconst get = require(\"lodash/fp/get\");\nconst startsWith = require(\"... | javascript | edit | 0 | 2 | mit | 08f071e06f518e2b0726a8838acdcd60d05b1abd | jlmorgan/node-commit-from | src/jira/customFieldToKey.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n/*global module:false*/\nmodule.exports = function(grunt) {\n grunt.initConfig({\n watch: {\n reload: {\n files: ['src/*', 'src/js/*.js', 'src/css/*.css', 'grunt.js'],\n tasks: 'tinylr-... | javascript | edit | 0 | 1 | mit | 0c097dfeeedf90de1b01642eb1bc5ab4e988829f | elovalo/webide,elovalo/webide,elovalo/webide,elovalo/webide,elovalo/webide | grunt.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nimport { inject as service } from '@ember/service';\nimport Component from '@ember/component';\nimport layout from './template';\nimport LazyIcon from 'shared/mixins/lazy-icon';\n\nexport default Component.extend(LazyIcon, {\n scope: ... | javascript | edit | 0 | 1 | apache-2.0 | 7957b713c9f860e67abd2aefb1a87099777e404b | rancher/ui,rancherio/ui,westlywright/ui,vincent99/ui,vincent99/ui,rancherio/ui,westlywright/ui,vincent99/ui,rancherio/ui,rancher/ui,westlywright/ui,rancher/ui | app/components/namespace-app/component.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n/**\n * Configuration for Herald\n */\n{\n\t/*\n\t * Herald core bundles\n\t */\n\t\"bundles\" : [ {\n\t\t\"name\" : \"org.cohorte.herald.api\"\n\t}, {\n\t\t\"name\" : \"org.cohorte.herald.core\"\n\t} ]\n}\n\n```\n\nApply this change: A... | javascript | edit | 0 | 0 | apache-2.0 | 3b9fbbb662b75df65378b8e80ada1382de715001 | gattazr/cohorte-platforms,isandlaTech/cohorte-platforms,gattazr/cohorte-platforms,gattazr/cohorte-platforms,isandlaTech/cohorte-platforms,isandlaTech/cohorte-platforms,ahmadshahwan/cohorte-platforms,gattazr/cohorte-platforms,ahmadshahwan/cohorte-platforms,ahmadshahwan/cohorte-platforms,isandlaTech/cohorte-platforms,ahm... | conf/herald/java-core.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nangular.module('app').directive('ngCepValidator', function() {\n return {\n restrict: 'A',\n require: 'ngModel',\n link: function($scope, $element, $attrs, ngModel) {\n $scope.$watch($attrs.ngModel, function(value) {\n ... | javascript | edit | 0 | 3 | mit | 0b5f7ab427ca80a13444824024f0a16882cfac02 | fabriciofmsilva/labs,fabriciofmsilva/labs,fabriciofmsilva/labs,fabriciofmsilva/labs,fabriciofmsilva/labs,fabriciofmsilva/labs,fabriciofmsilva/labs,fabriciofmsilva/labs,fabriciofmsilva/labs,fabriciofmsilva/labs,fabriciofmsilva/labs,fabriciofmsilva/labs,fabriciofmsilva/labs,fabriciofmsilva/labs | courses/angular/ng-cep-validator.directive.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nimport React, { Component } from 'react';\nimport Dialog from 'material-ui/lib/dialog';\nimport FlatButton from 'material-ui/lib/flat-button';\nimport RaisedButton from 'material-ui/lib/raised-button';\n\n// NOTE: For emit `onTouchTap` ... | javascript | edit | 0 | 1 | mit | a335a690609598137793b9c9f933b27475109062 | mgi166/usi-front,mgi166/usi-front | frontend/components/modals/promoteModal.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nvar http = require('http');\nvar server = http.createServer().listen(8005);\nvar io = require('socket.io')(server);\nvar cookie = require('cookie');\nvar querystring = require('querystring');\n\n\nio.use(function (socket, next) {\n if ... | javascript | edit | 0 | 2 | mit | 6d911721b8939a37e032b5d344c9d7e9d6f517d6 | ministryofjustice/cla_frontend,ministryofjustice/cla_frontend,ministryofjustice/cla_frontend,ministryofjustice/cla_frontend | cla_socketserver/app.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n#!/usr/bin/env node\n\n'use strict';\n\nprocess.logging = function() {\n return console.log;\n};\n\nprocess.logStream = process.stdout;\n\nvar dictator = require('..');\nvar fs = require('fs');\n\nvar filename = process.argv[2] || 'dic... | javascript | edit | 0 | 1 | mit | 1ce9822e8ef990983a87f344ec218b799f4ab173 | ehd/dictator | bin/dictator.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n/**\n * Production environment settings\n *\n * This file can include shared settings for a production environment,\n * such as API keys or remote database passwords. If you're using\n * a version control solution for your Sails app, t... | javascript | edit | 0 | 0 | mit | b131b891fc22a69129c0484e7a20a43c2243c45b | SneakSpeak/sp-server | config/env/production.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nvar fs = require('fs')\n\nvar contents = fs.readFileSync(process.argv[2])\nvar lines = contents.toString().split('\\n').length - 1\nconsole.log(lines)\n\n// メモ:'utf8'を'readFileSync'に二つ目の関数として渡すと'.toString'なくて\n// も動いていますよ!\n// fs.readFi... | javascript | edit | 0 | 0 | mit | 6d474b013b38f62a06e14ee41f4a31f74c0f54ee | PibeDx/learnyounode,soujiro27/learnyounode,chechiachang/learnyounode,JonnyCheng/learnyounode,Yas3r/learnyounode,Gtskk/learnyoupython,amandasilveira/learnyounode,walhs/learnyounode,CNBorn/learnyounode,zpxiaomi/learnyounode,ralphtheninja/learnyounode,RoseTHERESA/learnyounode-1,michaelgrilo/learnyounode,piccoloaiutante/le... | exercises/my_first_io/solution_ja/solution.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n'use strict';\n\nvar utils = require('../utils');\n\n\nfunction createColumnsObj(lists) {\n var columns = {};\n\n for(var list in lists) {\n lists[list].forEach(function(column) {\n columns[column.name] = 0;\n });\n }\n\n ... | javascript | edit | 0 | 3 | mit | fee30930076542f4ba30f308f42700e316275043 | safv12/trello-metrics,safv12/trello-metrics | server/api/controllers/chart-metrics/index.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nimport * as Backbone from 'backbone';\nimport SearchBoxView from '../views/searchBox-view';\nimport SearchResultsView from '../views/searchResults-view';\nimport dispatcher from '../helpers/dispatcher';\n\nclass AppRouter extends Backbo... | javascript | edit | 0 | 1 | mit | a2d9e7b8dcc8e68885ea1b6eacf796f6bddbd093 | trevormunoz/katherine-anne,trevormunoz/katherine-anne,trevormunoz/katherine-anne | src/js/routers/app-router.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nimport {\n Component,\n h\n} from 'skatejs';\nimport styles from './styles';\n\nconst deleteCode = 8;\n\ncustomElements.define('sk-tags', class extends Component {\n static get props() {\n return {\n delimiter: {\n att... | javascript | edit | 0 | 3 | mit | 6a5dfa8de6298db875f8bf2da4c1c56ab8ee6c23 | zzarcon/skatepark.js,zzarcon/skatepark.js,zzarcon/skatepark.js | packages/tags/src/index.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n// Function to load and initiate the Analytics tracker\nfunction gaTracker(id){\n $.getScript('//www.google-analytics.com/analytics.js'); // jQuery shortcut\n window.ga=window.ga||function(){(ga.q=ga.q||[]).push(arguments)};ga.l=+new ... | javascript | edit | 0 | 2 | mit | 1c4d7d94cff79b852fdcb55239cc9fcd50c09315 | gregoiredierendonck/Rapsodie,gregoiredierendonck/Rapsodie,gregoiredierendonck/Rapsodie | source/assets/javascripts/analytics.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nimport React, { Component } from 'react'\nimport PropTypes from 'prop-types'\nimport QuizInput from './QuizInput'\nimport styled from 'styled-components'\nimport IconButton from 'material-ui/IconButton'\nimport ActionDelete from 'materi... | javascript | edit | 0 | 1 | mit | 73df15ee4bb481a0952a5a8e8dd74b6a789275a1 | QuizChatbot/quiz-chatbot,QuizChatbot/quiz-chatbot-server,QuizChatbot/quiz-chatbot,QuizChatbot/quiz-chatbot,QuizChatbot/quiz-chatbot-server,QuizChatbot/quiz-chatbot-server | client/src/components/protected/QuizItem.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n(function() {\n\t\"use strict\";\n\t\n\tvar ContentEditableUtils = function() {\n\t};\n\n\tContentEditableUtils.prototype.getTextFromContentEditable = function(contentEditable) {\n\t\tvar pre = $(\"<pre/>\").html(contentEditable.html())... | javascript | edit | 0 | 2 | mit | a6d3a1e865777eee85a660a54e54e50281bcbfbb | zaknelson/hike.io,zaknelson/hike.io,zaknelson/hike.io,zaknelson/hike.io | client/js/utils/content-editable-utils.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nimport {helper} from '@ember/component/helper';\n\nexport const DEFAULT_QUERY_PARAMS = {\n posts: {\n type: null,\n visibility: null,\n author: null,\n tag: null,\n order: null\n },\n pages: {... | javascript | edit | 0 | 1 | mit | b5d1d5918c2b66b832ea2c903bbc16f69025ae5e | TryGhost/Ghost,TryGhost/Ghost,TryGhost/Ghost | ghost/admin/app/helpers/reset-query-params.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nfunction AppRun(AppConstants, $rootScope, $timeout, Wallet, Alert, $transitions) {\n 'ngInject';\n\n // Change page title based on state\n $transitions.onSuccess({ to: true }, (transition) => {\n $rootScope.setPageTitle... | javascript | edit | 0 | 3 | mit | 6b744f8d6a04f2126b51a671cea350ee989184fb | mizunashi/NanoWallet,mizunashi/NanoWallet | src/app/config/app.run.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n'use strict';\nvar $ = require('jquery'),\n React = require('react');\n\nif (typeof window !== 'undefined') {\n var _gaq = window._gaq || undefined;\n var FB = window.FB || undefined;\n}\n\nmodule.exports = React.createClass({\n ... | javascript | edit | 0 | 3 | mit | e56982312bbb51e95e6aac4db502cff1efff8fc4 | Hivebeat/LoginSignup,Hivebeat/LoginSignup | src/scripts/components/FBLoginBtn.react.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n$(document).ready(function() {\n Sortable.init();\n \n //Initialize Tables\n for(var i = 0; i < $('table').length; i++){\n $($('table')[i]).attr(\"data-sortable-initialized\", false);\n Sortable.initTable($('table')[i]);\n ... | javascript | edit | 0 | 2 | cc0-1.0 | 4e8f59445f0fb77c7c0b1271156a9ed59cfdf680 | USGS-R/repgen,mhines-usgs/repgen,thongsav-usgs/repgen,thongsav-usgs/repgen,mhines-usgs/repgen,lindsaycarr/repgen,dpattermann-usgs/repgen,dpattermann-usgs/repgen,thongsav-usgs/repgen,dpattermann-usgs/repgen,zmoore-usgs/repgen,lindsaycarr/repgen,mhines-usgs/repgen,USGS-R/repgen,lindsaycarr/repgen,USGS-R/repgen,zmoore-usg... | inst/templates/timeseriessummary/custom.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nvar todoList = {\n todos: ['item 1', 'item 2', 'item 3'],\n displayTodos: function() {\n console.log('My Todos', this.todos);\n },\n addTodo: function(todo) {\n this.todos.push(todo);\n this.displayTodos();\n },\n changeT... | javascript | edit | 0 | 1 | mit | ab3f5c263b9a97d5fb7c0d4b5e50437dbecb7bb2 | aaronang/todos,aaronang/todos | script.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nvar ipc = require('ipc')\nvar fs = require('fs')\n\nvar userData\n\ndocument.addEventListener('DOMContentLoaded', function (event) {\n ipc.send('getUserDataPath')\n\n ipc.on('haveUserDataPath', function (path) {\n updateIndex('./da... | javascript | edit | 0 | 3 | bsd-2-clause | 5cf56d09b7459f5e324436aa7183bc0a1c841a14 | countryoven/git-it-electron,IonicaBizauKitchen/git-it-electron,rets5s/git-it-electron,IonicaBizauKitchen/git-it-electron,dice/git-it-electron,countryoven/git-it-electron,vongola12324/git-it-electron,shiftkey/git-it-electron,dice/git-it-electron,vongola12324/git-it-electron,shiftkey/git-it-electron,jlord/git-it-electron... | challenges-completed.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n/*!\n * to-clipboard <https://github.com/jonschlinkert/to-clipboard>\n *\n * Copyright (c) 2015, Jon Schlinkert.\n * Licensed under the MIT License.\n */\n\n'use strict';\n\nvar cp = require('child_process');\n\nvar program = {\n darwi... | javascript | edit | 0 | 2 | mit | 1dd2da65ab30c32f06792169605161a1eebc7b5d | jonschlinkert/to-clipboard | index.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nimport React from 'react';\nimport {connect} from 'react-redux';\nimport NewPaula from './new-paula';\n\nclass MainComponent extends React.Component {\n\trender() {\n\t\treturn <div>\n\t\t\t<h1>React/Redux demo</h1>\n\t\t\t<p>This is wh... | javascript | edit | 0 | 1 | mit | 77d1ec2caed058709edd612e00f000c7664f5f31 | alexpoe22/fuzzyFinder,alexpoe22/fuzzyFinder | client/main-component.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n'use strict';\n\nvar regexExec = RegExp.prototype.exec;\n\nmodule.exports = function isRegex(value) {\n\ttry {\n\t\tregexExec.call(value);\n\t\treturn true;\n\t} catch (e) {\n\t\treturn false;\n\t}\n};\n\n\n```\n\nApply this change: Imp... | javascript | edit | 0 | 2 | mit | 5ab76322a348487fa8b16761e83f6824c3c27d11 | ljharb/is-regex | index.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n'use strict'\n\nvar window = require('global/window')\nvar Struct = require('observ-struct')\nvar Observ = require('observ')\nvar minimumViewport = require('minimum-viewport')\nvar orientation = require('screen-orientation')\n\nvar MOBI... | javascript | edit | 0 | 1 | mit | 1c462dea1bf795e52d609e5560fceb6b72c16e1b | bendrucker/observ-mobile | index.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n'use strict';\n\nvar app = require('app');\nvar dribbbleapi = require('./dribbbleapi');\n\nvar mainWindow = null;\nvar dribbbleData = null;\n\nvar menubar = require('menubar')\n\nvar mb = menubar({\n frame: true,\n index: 'file://' + ... | javascript | edit | 0 | 1 | cc0-1.0 | 7c5b8e7be3a444d32b799f9da912823e71f25f61 | andrewnaumann/hotshot,andrewnaumann/hotshot | main.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n'use strict';\n\nvar app = angular.module('ProductsApp');\n\napp.controller('editmodeController', ['$scope', function($scope) {\n var ctrl = this;\n \n ctrl.enterEvent = function(event) {\n if (event.which === 13){\n... | javascript | edit | 0 | 2 | mit | 61ec484d8dc9f2bfe8116146c9703540e506df34 | Tribu-Anal/Product-Management,Tribu-Anal/Product-Management | js/controllers.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n'use strict';\n\nvar app = angular.module('ProductsApp');\n\napp.controller('editmodeController', ['$scope', function($scope) {\n var ctrl = this;\n \n ctrl.save = function () {\n $scope.$parent.main.data.visible = false... | javascript | edit | 0 | 2 | mit | c7c0e86d53dd81e89222cfeb94bca1135c4d4f28 | Tribu-Anal/Product-Management,Tribu-Anal/Product-Management | js/controllers.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nPlugin.registerSourceHandler('i18n.json', function (compileStep) {\n compileStep.addJavaScript({\n path: compileStep.inputPath + '.js',\n sourcePath: compileStep.inputPath,\n data: ['if(Meteor.isServer) i18n.add(', ')'].join(c... | javascript | edit | 0 | 1 | mit | 753c93bfbdbe795692c077b43b3777c14ba4de21 | halunka/meteor-i18n | i18n.build.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n/*\n * Biodiversity Heritage Library\n * A backend for collecting OCR corrections from BHL games.\n * Copyright 2015 Tiltfactor\n */\n\n(function() {\n global.requireLocal = function(name) {\n return require(__dirname + '/' + name);... | javascript | edit | 0 | 1 | mit | b07efe7f3095aecfeb1bf41a0554825ca49536af | tiltfactor/SmorballBeanstalk-Backend | server.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n'use strict';\n\nvar fs = require('fs');\n\nmodule.exports = function isEmberCliProject() {\n var originalCwd = process.cwd();\n var inside = false;\n\n while(process.cwd() !== '/') { // is it windows safe?\n if(!fs.existsSync('pa... | javascript | edit | 0 | 4 | mit | 46abed8ad975187bde147f47a7e12edafaf59102 | kategengler/ember-cli,lazybensch/ember-cli,blimmer/ember-cli,felixrieseberg/ember-cli,princeofdarkness76/ember-cli,lazybensch/ember-cli,mohlek/ember-cli,ef4/ember-cli,johanneswuerbach/ember-cli,selvagsz/ember-cli,romulomachado/ember-cli,makepanic/ember-cli,Restuta/ember-cli,marcioj/ember-cli,jrjohnson/ember-cli,pixelha... | lib/utilities/is-ember-cli-project.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nconst path = require('path');\nconst config = require('config');\nconst webpack = require('webpack');\n\nmodule.exports = {\n name : 'client',\n target : 'web',\n devtool: config.compiler.devtool,\n\n entry : path.join(config.stru... | javascript | edit | 0 | 0 | mit | d8662e4a6d1207376d60f7c58847a48f088a42b5 | Picta-it/barebare,Picta-it/barebare | config/webpack/index.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nvar gImageForward = {\n\n onLoad: function() {\n if ('undefined' == typeof gBrowser) {\n return;\n }\n window.removeEventListener('load', gImageForward.onLoad, false);\n window.addEventListener(... | javascript | edit | 0 | 2 | mit | f06eafd5dbe7750775ed189cd54f94296f934680 | sblask/firefox-image-forward,sblask/firefox-image-forward | content/imageforward.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nconst express = require('express');\nconst path = require('path');\nconst fs = require('fs');\nconst formidable = require('formidable');\nconst createTorrent = require('create-torrent');\n\nconst app = express();\nconst port = parseInt(... | javascript | edit | 0 | 1 | mit | fb51f0370cd8d0f59773799dd48da2e672fced72 | derekmiranda/nile.js,jpmitchellpierson/nile.js,gitsummore/nile.js,gitsummore/nile.js,derekmiranda/nile.js,jpmitchellpierson/nile.js | server.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n'use strict';\n\nvar _ = require('underscore');\n\nmodule.exports = (function() {\n\n\tvar attic = function(prefix) {\n\t\tthis.prefix = prefix;\n\t};\n\n\tattic.prototype = {\n supported: function(){\n var test = 'tes... | javascript | edit | 0 | 3 | mit | 942b1a92e447544ab4ff6e54ca5352473d1bacab | tamarasaurus/atticjs | index.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n'use strict';\n\nvar\n\tplatform = require('enyo/platform'),\n\tdispatcher = require('enyo/dispatcher'),\n\tgesture = require('enyo/gesture');\n\nexports = module.exports = require('./lib/options');\nexports.version = '2.6.0-pre';\n\n//... | javascript | edit | 0 | 0 | apache-2.0 | 82e2da9af5ede26f48ef94973d5b03ff8618d1cd | enyojs/moonstone | index.js | rejected_duplicate | Near-duplicate of sample 82889 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nvar osa = require('osa2')\n\nfunction play(uri) {\n if (uri)\n return playTrack(uri)\n return osa(() => Application('Spotify').play())()\n}\n\nfunction playTrack(uri) {\n return osa((uri) => Application('Spotify').playTr... | javascript | edit | 0 | 2 | mit | 39745ed71146055bf7b70a378642ec404a4210e1 | wtfaremyinitials/osa-spotify | index.js | rejected_duplicate | Near-duplicate of sample 77256 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nimport { moduleForModel, test } from 'ember-qunit';\n\nmoduleForModel('event', 'Unit | Serializer | application', {\n needs: [\n 'serializer:application',\n 'model:event',\n 'model:event-type',\n 'model:event-topic',\n '... | javascript | edit | 0 | 1 | apache-2.0 | 99cf901d5725ffa20ceaf86bb92e0ae87e30d1b2 | geekyd/open-event-frontend,ritikamotwani/open-event-frontend,ritikamotwani/open-event-frontend,CosmicCoder96/open-event-frontend,harshitagupta30/open-event-frontend,ritikamotwani/open-event-frontend,geekyd/open-event-frontend,harshitagupta30/open-event-frontend,harshitagupta30/open-event-frontend,geekyd/open-event-fron... | tests/unit/serializers/application-test.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nfunction isObject(whoAmI) {\n return (!!whoAmI) && (whoAmI.constructor === Object);\n}\n\nfunction isArray(whoAmI) {\n return (!!whoAmI) && (whoAmI.constructor === Array);\n}\n\nfunction isNumber(whoAmI) {\n return !isNaN(whoAm... | javascript | edit | 0 | 7 | mit | 8334a54d0144e22e6340d0c65f443fc0a74b2d37 | raymondborkowski/4loop | index.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n\n'use strict';\n\nvar through = require('through2');\nvar glob = require('glob');\n\nmodule.exports = function() {\n\n var transform = function(file, env, cb) {\n\n // find all instances matching\n var contents = file.... | javascript | edit | 0 | 2 | mit | b92d437545ece5e223fa6d4864f5000642b381e0 | mathisonian/gulp-sass-bulk-import,bleuarg/gulp-sass-glob-import | index.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n// Crockford's Base32\n// https://en.wikipedia.org/wiki/Base32\nconst ENCODING = \"0123456789ABCDEFGHJKMNPQRSTVWXYZ\"\nif (ENCODING.length !== 32) throw new Error('ENCODING')\n\n// Current Version of SUID\nconst VERSION = 1\n\nfunction ... | javascript | edit | 0 | 2 | mit | ec1a44d68960c27d3d40ba2df5ad275f8865b841 | alizain/ulid,alizain/ulid | index.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nvar Promise = require('bluebird');\nvar mapValues = require('lodash.mapvalues');\nvar assign = require('lodash.assign');\nvar curry = require('lodash.curry');\n\nfunction FileWebpackPlugin(files) {\n this.files = files || {};\n}\n\nFil... | javascript | edit | 0 | 2 | mit | c57af5560e129ff357b0c888e6c8b67879c86e7b | markdalgleish/file-webpack-plugin | index.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n/* globals require */\n\nfunction initEnv(projectConfig) {\n let defaults = _.get(projectConfig, 'env.default', {});\n\n _.forIn(projectConfig.env, function (vars, env) {\n let envVars = _.defaultsDeep(projectConfig.env[env], defau... | javascript | edit | 0 | 3 | mit | 4e67648433ea0d0ac70e4f3e6a1f6eb778ae2ba1 | fourkitchens/project-gulp | index.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nmodule.exports = {\n website: {\n assets: \".\",\n html: {\n \"body:start\": function(current, output) {\n var fs = require(\"fs\");\n var path = require(\"path\");\n \n var filePath = path.join(t... | javascript | edit | 0 | 3 | apache-2.0 | 9858ac20b24d98ca17260f07664c51c22e11ba4b | Simran-B/gitbook-plugin-add-header | index.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n'use strict';\n\nconst choo = require('choo');\nconst html = require('choo/html');\nconst app = choo();\n\n\napp.model({\n state: {\n todos: [\n { title: 'Buy milk' },\n { title: 'Call Samantha'},\n ],\n },\n});\n\ncon... | javascript | edit | 0 | 1 | mit | c2377a4a14c86394fdf15e8bf94e63e6c99ffb81 | fernandocanizo/choodo | index.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nfunction KeyboardShortcutAlert(alertHandler) {\n var self = {\n 'clickCount': {}\n };\n var MINIMUM_CLICKS_BEFORE_ALERT = 5;\n\n function modeSwitchButtonClicked(labelType) {\n if(labelType == 'Walk')\n ... | javascript | edit | 0 | 6 | mit | b96c64bd08e6c344d12105a99eb1b5a95a3f7065 | ProjectSidewalk/SidewalkWebpage,ProjectSidewalk/SidewalkWebpage,ProjectSidewalk/SidewalkWebpage,ProjectSidewalk/SidewalkWebpage,ProjectSidewalk/SidewalkWebpage,ProjectSidewalk/SidewalkWebpage | public/javascripts/SVLabel/src/SVLabel/alert/KeyboardShortcutAlert.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n\n/**\n The openstreetmap importer provides a way of parsing, mapping and\n augmenting OSM data in to elasticsearch.\n**/\n\nvar elasticsearch = require('pelias-dbclient'),\n adminLookup = require('pelias-admin-lookup'),\n sugge... | javascript | edit | 0 | 2 | mit | 4d8182cbee86c39dcf0b0c5841057e8e8337e33a | hannesj/openstreetmap,pelias/openstreetmap,hannesj/openstreetmap,pelias/openstreetmap | index.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n'use strict';\nvar chalk = require('chalk');\n\nvar main = {\n\tinfo: chalk.blue('ℹ'),\n\tsuccess: chalk.green('✔'),\n\twarning: chalk.yellow('⚠'),\n\terror: chalk.red('✖')\n};\n\nvar win = {\n\tinfo: chalk.blue('i'),\n\tsuccess: chalk.... | javascript | edit | 0 | 0 | mit | 661a6575d07fb2c6cf3556b5e27dcfd1f59db0c1 | sterpe/log-symbols | index.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n'use strict';\nvar fs = require('fs');\nvar isDocker;\n\nfunction check() {\n\ttry {\n\t\tfs.statSync('/.dockerinit');\n\t\treturn true;\n\t} catch (err) {\n\t\treturn false;\n\t}\n}\n\nmodule.exports = function () {\n\tif (isDocker ===... | javascript | edit | 0 | 2 | mit | f04e27574b115ee07c30fd12a07fe54c315a7974 | sindresorhus/is-docker,sindresorhus/is-docker | index.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n'use strict';\r\n\r\nmodule.exports.DropdownMenu = require('./dist/dropdownMenu');\r\nmodule.exports.MenuList = require('./dist/menuList');\r\nmodule.exports.MenuItem = require('./dist/MenuItem');\r\n\n```\n\nApply this change: Fix modu... | javascript | edit | 0 | 0 | apache-2.0 | c016198f8100532c0c87928b1796431a3e049390 | Brightspace/react-valence-ui-dropdown | index.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nvar fs = require('fs')\n\nmodule.exports = function (path, opts) {\n if (!path) throw new Error('Path must be provided')\n\n return function (err, src) {\n if (!opts) opts = {}\n if (err) throw err\n\n fs.writeFileSync(path, ... | javascript | edit | 0 | 4 | mit | 0d4be5e11459c0c5c78b79ecac8d1f032423fb7b | bclinkinbeard/write-to-path | index.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n#!/usr/bin/env node\nconst inquirer = require('inquirer')\nconst Listr = require('listr')\n\nconst steps = [{\n type: 'input',\n name: 'userName',\n message: 'Whats your name?'\n}]\n\n\nconst tasks = [{\n title: 'Preparing',\n task... | javascript | edit | 0 | 2 | mit | 02047887490d6facd4c426f49a5ef958a6478be3 | entwicklerstube/jscraftcamp-my-name-is | index.js | rejected_duplicate | Near-duplicate of sample 72677 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n/* jshint node: true */\n'use strict';\n\nvar Funnel = require('broccoli-funnel');\nvar mergeTrees = require('broccoli-merge-trees');\n\nmodule.exports = {\n name: 'ember-google-publisher-tags',\n\n contentFor: function(type, config) ... | javascript | edit | 0 | 3 | mit | 17e20db1746e88f15e1ab04ad71be9fef3ff4e9a | brewingcode/ember-google-publisher-tags,brewingcode/ember-google-publisher-tags | index.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nvar _ = require('underscore');\nvar async = require('async');\nvar request = require('request');\nvar linters = require('./linters');\n\nvar repoURL = 'https://api.github.com/repos/nicolasmccurdy/repos';\nvar githubRequest = request.def... | javascript | edit | 0 | 1 | mit | 957366ae9443facafd83c8dcdaf3852d95b6f0f4 | nicolasmccurdy/ghlint | index.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nimport Ember from 'ember';\n\nconst { get, set, guidFor, merge, getOwner } = Ember;\n\nfunction updateTitle(tokens) {\n set(this, 'title', tokens.toString());\n}\n\nexport default Ember.Helper.extend({\n pageTitleList: Ember.inject.se... | javascript | edit | 0 | 3 | mit | ac09e2c81f4c143991c3bdb2754e5a9a58dd5f49 | paddle8/ember-document-title,tim-evans/ember-page-title,paddle8/ember-document-title,tim-evans/ember-page-title | addon/helpers/page-title.js | rejected_duplicate | Near-duplicate of sample 85152 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nconst fs = require('fs');\nconst passport = require('passport');\nconst JWTStrategy = require('passport-jwt').Strategy;\nconst extractors = require('./extractors');\nconst services = require('../../services');\n\nmodule.exports = functi... | javascript | edit | 0 | 5 | apache-2.0 | e788711b4899cd3cc68365355dd5097ae7dbd106 | ExpressGateway/express-gateway | lib/policies/jwt/jwt.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n//Require Module\nvar log4js = require('log4js');\nvar logger = log4js.getLogger('sendNotification');\nvar promise = require('promised-io');\nvar mailer = require('emailjs');\n\n/**\n *\n * Send notification mail.\n *\n * @param {object... | javascript | edit | null | null | apache-2.0 | ea6b3ea02a800e954712152705373d47705ac72b | dollars0427/SQLwatcher | notification.js | rejected_syntax | Syntax error detected by tree-sitter | false |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nvar embeddedRegexp = /data:(.*?);base64,/;\nvar commentRegexp = /\\/\\*([\\s\\S]*?)\\*\\//g;\nvar urlsRegexp = /((?:@import\\s+)?url\\s*\\(['\"]?)(\\S*?)(['\"]?\\s*\\))|(@import\\s+['\"]?)([^;'\"]+)/ig;\n\nfunction isEmbedded (src) {\n\... | javascript | edit | 0 | 0 | mit | 4ca9dc6c82b3cd50cb343a5dd7088e78679d4e9f | s0ph1e/node-css-url-parser | lib/css-parser.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nvar nodegit = require('nodegit'),\n cred = nodegit.Cred;\n\nmodule.exports = function(url, userName) {\n // return cred.sshKeyFromAgent(userName);\n return cred.sshKeyNew(userName, '/home/build/github_id_rsa.pub', '/home/build/g... | javascript | edit | 0 | 1 | mit | 1541cc1d7002976387f2db55937a745a3ccce0ee | strarsis/docker-golang-nightly,strarsis/docker-golang-nightly | generate/config.example/github-repo-auth.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nvar subscriptions = new SubsManager();\n\nRouter.configure({\n\tlayoutTemplate: 'layout',\n\tloadingTemplate: 'loading',\n\tnotFoundTemplate: 'notFound'\n});\n\nRouter.route('/', {\n\tname: 'home',\n\twaitOn: function() {\n\t\treturn [s... | javascript | edit | 0 | 1 | mit | b1cfe715de2998744d4ad681e266ee37387009c4 | dexterneo/ping_pong_wars,dexterneo/ping_pong_wars | lib/router.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n'use strict';\n\nvar all;\nvar cache = {};\n\nfunction getCache(room) {\n if (room === undefined) {\n if (all === undefined) {\n all = [];\n for (var i in Game.rooms) {\n all = all.concat(g... | javascript | edit | 0 | 6 | mit | 4f20e1b09561d29ca12f9d380de815966bef18d9 | avdg/screeps | extensions/tools/targets/droppedEnergy.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\npublicAccessible = FlowRouter.group({});\n\nsignInRequired = FlowRouter.group({\n triggersEnter: [AccountsTemplates.ensureSignedIn]\n});\n\nsignInRequired.route('/', {\n name: 'feed',\n action: () => {\n BlazeLayout.render('layout... | javascript | edit | 0 | 1 | mit | 4d249e9556bf7ec58b55aa892365960b57e0d6fd | mattvella07/gravity,mattvella07/gravity,GravityProject/gravity,GravityProject/gravity,zaverichintan/gravity,zaverichintan/gravity | lib/router.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nimport Ember from 'ember';\nimport DS from 'ember-data';\nimport ENV from 'public/config/environment';\n\nexport default DS.RESTAdapter.extend({\n fastboot: Ember.inject.service(),\n\tnamespace: 'cablecastapi/v1',\n host: Ember.comput... | javascript | edit | 0 | 6 | mit | 00e352982fdb25e2b1065a2fcaf40a4b0ae1e581 | trms/cablecast-public-site,trms/cablecast-public-site | app/adapters/application.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nvar nodegit = require('nodegit'),\n cred = nodegit.Cred;\n\nmodule.exports = function(url, userName) {\n // return cred.sshKeyFromAgent(userName);\n return cred.sshKeyNew(userName, '/home/build/.ssh/github_id_rsa.pub', '/home/bu... | javascript | edit | 0 | 1 | mit | d7605d58a8622d62033fdd3bf93e6e765ace3d16 | strarsis/docker-golang-nightly,strarsis/docker-golang-nightly | generate/config.example/github-repo-auth.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nimport DS from 'ember-data';\n\nexport default DS.Model.extend({\n slug: DS.attr('string'),\n});\n\n```\n\nApply this change: Add description to category slug ember model"
},
{
"role": "assistant",
"content": "import DS f... | javascript | edit | 0 | 0 | apache-2.0 | 65b97d339fa41737cd04a4c3ee2245fd20228483 | rust-lang/crates.io,rust-lang/crates.io,rust-lang/crates.io,rust-lang/crates.io | app/models/category-slug.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nimport SubmissionError from '../error/SubmissionError'\nimport { ENTRYPOINT } from '../config/entrypoint';\n\nconst MIME_TYPE = 'application/ld+json'\n\nexport default function (id, options = {}) {\n if (typeof options.headers === 'und... | javascript | edit | 0 | 7 | mit | 271700f87923e08a6d8ce2712c29ab319ab699c3 | api-platform/generate-crud,api-platform/generate-crud | templates/vue/utils/fetch.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nvar packageName = document.title;\n\nvar runkitLinkNode = document.querySelector('[href*=runkit]');\nrunkitLinkNode.innerText = 'Test ' + packageName + ' on 2runkit';\n\nvar replitLinkListNode = document.createElement('li');\nreplitLink... | javascript | edit | 0 | 0 | mit | 1bf17f6a788bdf868b16417ed6800e90bcffd4c2 | masad-frost/replit-npm-chrome,masad-frost/replit-npm-chrome | link-generator.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n\"use strict\";\n\nvar stream = require(\"stream\");\nvar util = require(\"util\");\n\nvar Transform = stream.Transform;\n\nvar NL = 10;\n\nfunction WholeLineStream(prefix) {\n Transform.call(this);\n this.prefix = prefix ? Buffer... | javascript | edit | 0 | 8 | apache-2.0 | 24f85305697e38685c2692e6733c87ef40a0a617 | CindyJS/CindyJS,wursterje/CindyJS,CindyJS/CindyJS,kortenkamp/CindyJS,wursterje/CindyJS,gagern/CindyJS,gagern/CindyJS,montaga/CindyJS,wursterje/CindyJS,kranich/CindyJS,gagern/CindyJS,gagern/CindyJS,kranich/CindyJS,strobelm/CindyJS,strobelm/CindyJS,wursterje/CindyJS,CindyJS/CindyJS,kortenkamp/CindyJS,kranich/CindyJS,kran... | make/WholeLineStream.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nApplication.Services.factory(\"mcFlow\", mcFlowService);\nfunction mcFlowService() {\n var self = this;\n self.flow = new Flow(\n {\n target: \"/api/upload/chunk\",\n testChunks: false\n }\n ... | javascript | edit | 0 | 8 | mit | 2cd56e920a88b927406feec8ec844c111b6d7c5d | materials-commons/materialscommons.org,materials-commons/materialscommons.org,materials-commons/materialscommons.org,materials-commons/materialscommons.org,materials-commons/materialscommons.org | website/app/application/services/mc-flow.js | rejected_duplicate | Near-duplicate of sample 89630 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nuser_pref(\"beacon.enabled\", false);\nuser_pref(\"browser.contentblocking.enabled\", false);\nuser_pref(\"browser.library.activity-stream.enabled\", false);\nuser_pref(\"browser.safebrowsing.downloads.enabled\", false);\nuser_pref(\"br... | javascript | edit | 0 | 0 | mit | 6dff6290a58b0025899672e983588e1f98686f69 | lnicola/dotfiles,lnicola/dotfiles,GrayShade/dotfiles | user.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n$(document).on('click', 'a', function(event) {\n var lnk = event.currentTarget;\n\n //for backwards compatibility\n var rels = lnk.rel.split(' ');\n $.each(rels, function() {\n if (this.match(/^popup/)) {\n ... | javascript | edit | 0 | 3 | bsd-2-clause | f49c6526c3d755692dfaed2d4dff4ca4210a74b2 | kaufmo/koala-framework,koala-framework/koala-framework,kaufmo/koala-framework,koala-framework/koala-framework,kaufmo/koala-framework | Kwc/Basic/LinkTag/Extern/Component.defer.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nmodule.exports = {\n 'Does Chat Exist' : function (browser) {\n browser\n .url(browser.launchUrl)\n .waitForElementVisible('body', 1000)\n .waitForElementVisible('iframe#drift-widget', 1000)\n .frame('iframe#drif... | javascript | edit | 0 | 1 | mit | c664c1d86419dd356a83385b5122e3863f8fbc72 | TheLocust3/Drift-Nightwatch | tests/basic_functionality.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n'use strict';\n\nvar Visit = require('../models/visit-model');\nvar Domain = require('../models/domain-model');\n\n/**\n * Read all visits to a given domain (authenticated)\n */\n\nmodule.exports = function(app, jwtAuth) {\n\tapp.get('/... | javascript | edit | 0 | 2 | mit | 32abeb8e859bf583ca855f9f7d8f504763248563 | Sextant-WDB/sextant-ng | routes/visit-routes.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n\"use strict\";\nlet map;\n\nvar init = function(options) {\n\tmap = setupMap(options);\n}\n\nvar commands = function(bot, options, action) {\n\tconst message = action.message;\n\tconst words = message.split(\" \");\n\n\tlet args = word... | javascript | edit | 0 | 3 | mit | ab9401513e5253c347778516064f6707de4cf838 | thelounge/lounge-bot | modules/lounge.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n/* global moment */\n\n(function($) {\n 'use strict';\n\n var dateRangePicker = {\n init: function() {\n this.$picker = $('.js-date-range-picker');\n\n this.$picker.daterangepicker({\n ranges: {\n 'Today':... | javascript | edit | 0 | 2 | mit | 64de5656a5660337be70cfb2f867d921926e39ca | guidance-guarantee-programme/planner,guidance-guarantee-programme/planner,guidance-guarantee-programme/planner | app/assets/javascripts/date-range-picker.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nimport chai, { expect } from 'chai';\nimport chaiAsPromised from 'chai-as-promised';\nchai.use(chaiAsPromised);\n\nimport ScheduledCommand from '../src/commandScheduling/scheduledCommand.js';\n\ndescribe('Scheduled Command', () => {\n ... | javascript | edit | 0 | 2 | mit | a26621ad6f53ff142fc67c8964e52c71bcdcc1cd | AttackPattern/node-cqrs-lib | tests/commandHandler.spec.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nconst m = require('mithril');\n\nconst User = module.exports = function (data) {\n this.id = m.prop(data.userId);\n this.username = m.prop(data.username);\n this.platform = m.prop(data.platformType);\n this.alias = m.prop(data.alias... | javascript | edit | 0 | 1 | mit | 6d4735083c520175f2cbba1998e6f7799719df12 | nus-mtp/worldscope,nus-mtp/worldscope,nus-mtp/worldscope,nus-mtp/worldscope | app_server/public/js/modules/models/user.js | accepted | null | true |
[
{
"role": "user",
"content": "Write javascript code for the following: Create images FS.Collection and a GridFS store."
},
{
"role": "assistant",
"content": "var imageStore = new FS.Store.GridFS('images')\n\nImages = new FS.Collection('images', {\n stores: [imageStore]\n});"
}
] | javascript | new_file | 0 | 0 | mit | 9b9144f9eacf08fb8291e22f4e3248a690eb5eab | nmmascia/webet,nmmascia/webet | lib/collections/betImages.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n#!/usr/bin/env node\nlet path = require('path'),\n Map = require('./index'),\n World = Map.World;\n\nlet home = process.env[\"HOME\"];\nlet saves = path.join(home, \"Library\", \"Application Support\", \"minecraft\", \"saves\");\n... | javascript | edit | 0 | 0 | bsd-3-clause | d71148f85e880943a7958366a612b6834fe0a7df | thelonious/kld-mc-world | test.js | accepted | null | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.