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 jsonMask = require('json-mask')\n\nmodule.exports = function (opt) {\n opt = opt || {}\n\n function partialResponse(obj, fields) {\n if (!fields) return obj\n return jsonMask(obj, fields)\n }\n\n function wrap(orig) {\n ... | javascript | edit | 0 | 5 | mit | 3f1019a71b7dc636390bffe96bf6a93354739b10 | nemtsov/express-partial-response | index.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nvar express = require('express');\nvar Connection = require('./lib/backend/connection').Connection;\nvar restAdaptor = require('./lib/frontend/rest-adaptor');\nvar socketIoAdaptor = require('./lib/frontend/socket.io-adaptor');\nvar dash... | javascript | edit | 0 | 5 | mit | 6b7f738fd598b50d3fd021597f3f78e6282a79ce | droonga/express-droonga,KitaitiMakoto/express-droonga,droonga/express-droonga,KitaitiMakoto/express-droonga | index.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n\"use strict\";\n\n\n// stdlib\nvar Fs = require('fs');\n\n\n// nodeca\nvar NLib = require('nlib');\n\n\n// 3rd-party\nvar StaticLulz = require('static-lulz');\nvar FsTools = NLib.Vendor.FsTools;\nvar Async = NLib.Vendor.Async;\n\n\nmod... | javascript | edit | 0 | 1 | mit | da7718cb9914f268e62200ab21c8f4a62e9d5899 | nodeca/nodeca.core,nodeca/nodeca.core | index.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nvar gulp = require('gulp'),\n gutil = require('gulp-util');\n\nfunction loadTasks(config) {\n var tasks = Object.keys(config);\n tasks.forEach(function (name) {\n var taskConfig = config[name],\n task = requir... | javascript | edit | 0 | 2 | mit | 92f8cb2850d9e5148aa309c76b4c87cf1fc18652 | gulp-boilerplate/gulp-boilerplate | index.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nfunction neymar(type, props, ...children) {\n props = props || {}\n return {\n type,\n props,\n children: Array.prototype.concat.apply([], children)\n }\n}\n\nfunction createElement(node) {\n if (typeof ... | javascript | edit | 0 | 2 | mit | 818624b20d08020c5f0ac8f2f8059d2ec7fd1ee0 | lucasfcosta/vdom-example,lucasfcosta/vdom-example | index.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nvar window = require('global/window');\nvar nodeCrypto = require('crypto');\n\nfunction getRandomValues(buf) {\n if (window.crypto && window.crypto.getRandomValues) {\n window.crypto.getRandomValues(buf);\n }\n else if (typeof win... | javascript | edit | 0 | 7 | mit | 462cae04fb596a3cd8c05f8a6c472796adbc710b | KenanY/get-random-values | index.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nconst RunPluginScriptCommand = require('./src/commands/runPluginScript')\nconst CreateProjectCommand = require('./src/commands/createProject')\nconst AddPluginsCommand = require('./src/commands/addPlugins')\nconst RemovePluginsCommand =... | javascript | edit | 0 | 2 | mit | aab3854d6cfee4ee909cb79fc333cda60da850af | rispa-io/rispa-cli | index.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nvar excludeMethods = [\n /^constructor$/, \n /^render$/, \n /^component[A-Za-z]+$/\n];\n\nvar displayNameReg = /^function\\s+([a-zA-Z]+)/;\n\nfunction isExcluded(methodName) {\n return excludeMethods.some(function (reg) {\n retur... | javascript | edit | 0 | 4 | mit | 4b68f23939190a878e3a8e45bad2145b0cbf285f | nemisj/react-bind-to-class | index.js | rejected_duplicate | Near-duplicate of sample 81325 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n'use strict'\nconst http = require('http')\nconst express = require('express')\nconst bodyParser = require('body-parser')\nconst Bot = require('messenger-bot')\n\nlet bot = new Bot({\n token: process.env.PAGE_TOKEN,\n verify: 'VERIFY_... | javascript | edit | 0 | 2 | mit | 8adef8bff6e8a192a0a06388f3f4213bbf0e13a0 | nikolay-radkov/ebudgie-server,nikolay-radkov/ebudgie-server | index.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n(function() {\n var Dependument = require('dependument').Dependument;\n\n var d = new Dependument({\n source: 'package.json',\n output: 'DEPENDENCIES.md'\n });\n\n d.process();\n})();\n\n```\n\nApply this change: Add declarati... | javascript | edit | 0 | 1 | unlicense | 162a37b07e9770fb2c5b8893541843495bcdd1df | dependument/dependument-cli | index.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nvar once = require('once');\n\nmodule.exports = function () {\n\n var collections = [].slice.call(arguments);\n\n if(!Array.isArray(collections[0])) {\n\n collections = [ collections ];\n }\n\n return Promise.all(\n\n... | javascript | edit | 0 | 4 | mit | d0643b62badc45f85a358a6bdec4a2408325fe27 | erickmerchant/static-engine | index.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nvar isArray = require('isArray');\n\n/**\n * Returns the maximum array depth of the array, meaning the maximum number of nests in the nested arrays.\n * @param {Anything} array The array to find the dimensionality of\n * @param {Boole... | javascript | edit | 0 | 3 | mit | a1ef61ffd7d55bbbcd5bc3db2dbe50578b09b1a1 | grant/dimensionality | index.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nlet _ = require('underscore');\n\nmodule.exports = function (ldapSettings, userData) {\n let searchDn = ldapSettings.searchDn || 'cn';\n\n // userData.mail may be a string with one mail address or an array.\n // Nevertheless we... | javascript | edit | 0 | 5 | mit | c246eff923c49175bda78b217e86d76371041cf2 | RobNeXX/4minitz,RobNeXX/4minitz,4minitz/4minitz,4minitz/4minitz,Huggle77/4minitz,Huggle77/4minitz,RobNeXX/4minitz,4minitz/4minitz,Huggle77/4minitz | imports/ldap/transformUser.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n'use strict'\n\nvar visit = require('unist-util-visit')\nvar toString = require('nlcst-to-string')\nvar posjs = require('pos')\n\nmodule.exports = pos\n\nvar tagger = new posjs.Tagger()\n\nfunction pos() {\n return transformer\n}\n\nfu... | javascript | edit | 0 | 5 | mit | 475a2c1ed04a08a93196a9d809da3f3181d9d04e | wooorm/retext-pos | index.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n/*jslint indent: 2, vars: true */\nvar es = require('event-stream');\nvar gutil = require('gulp-util');\nvar Buffer = require('buffer').Buffer;\n\nvar cheerio = require('cheerio');\n\nfunction modify(elem, attr, modifier) {\n \"use str... | javascript | edit | 0 | 3 | mit | b411f030dd296756fb77cd50b64ae1a7649dadb7 | othree/gulp-path-modifier | index.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n$('.close-modal').click(function () {\n $('#yt-player').hide();\n $('#yt-player iframe').attr(\"src\", jQuery(\"#yt-player iframe\").attr(\"src\"));\n});\n```\n\nApply this change: fix: Fix issue with 2 embed modals interferring w... | javascript | edit | 0 | 2 | mit | a84b191d71cef5d4a5f68c2da3dcc32c33e10351 | DeltaSpark/deltaspark.github.io,DeltaSpark/deltaspark.github.io | js/yt-player.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n/*! resol-vbus | Copyright (c) 2013-2014, Daniel Wippermann | MIT license */\n'use strict';\n\n\n\nvar _ = require('lodash');\nvar Q = require('q');\n\n\n\nvar testUtils = {\n\n performAsyncTest: function(done, callback) {\n r... | javascript | edit | 0 | 2 | mit | 223d7bfa811075c03ec196e4e14302048ad3919b | danielwippermann/resol-vbus,Thorsten71/resol-vbus | test/specs/test-utils.js | rejected_duplicate | Near-duplicate of sample 83320 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\ndefine([\n\t\"../core\",\n\t\"../selector\",\n\t\"../effects\",\n], function( jQuery ) {\n\tjQuery.expr.filters.animated = function( elem ) {\n\t\treturn jQuery.grep(jQuery.timers, function( fn ) {\n\t\t\treturn elem === fn.elem;\n\t\t}... | javascript | edit | 0 | 1 | mit | 6f4da9a8dfc46f760d9116f53eb137e6554377e9 | quiaro/request-agent,jquery/jquery,rwaldron/jquery,eburgos/jquery,roytoo/jquery,roytoo/jquery,eburgos/jquery,eburgos/jquery,rwaldron/jquery,roytoo/jquery,jquery/jquery,jquery/jquery | src/effects/animated-selector.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n#!/usr/bin/env babel-node\n\nimport assert from 'assert';\n\n\nfunction getObj() {\n return {\n x: 2,\n y: 3\n };\n}\n\nlet {\n x,\n y,\n z = 6\n} = getObj();\n\n\nassert.strictEqual(x, 2);\nassert.strictEqual(y, 3);\nassert.... | javascript | edit | 0 | 1 | mit | d6d356c9382b2bc2efe5e278fc831892f5312983 | kjirou/nodejs-codes | examples/babel/destructuring-assignment/index.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nvar Server = require(\"./server.js\").Server;\nvar Config = require(\"./config.js\").Config;\n\nexports.nails = appRoot => {\n var cfg = new Config(appRoot + \"/config.json\");\n cfg.set('appRoot', appRoot);\n new Server(cfg).run();\... | javascript | edit | 0 | 1 | mit | b7886cf31b0bdcd61bd96540f425a8a2aa8161aa | ArtOfCode-/nails,ArtOfCode-/nails | nails.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nmodule.exports.routes = {\n 'post /register': 'UserController.create',\n 'post /logout': 'AuthController.logout',\n\n 'post /auth/local': 'AuthController.callback',\n 'post /auth/local/:action': 'AuthController.callback',\n\n 'post... | javascript | edit | 0 | 0 | mit | bc21e2861d12c0c4174a68610a1b94bcfb2c0f7d | tjwebb/sails-auth,danielsharvey/sails-auth,onlyurei/sails-auth,langateam/sails-auth | config/routes.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n/**\n * Created by Zack Boman on 1/31/14.\n * http://www.zackboman.com or <EMAIL>\n */\n\n(function(){\n\n var mod = angular.module('routeStyles', ['ngRoute']);\n\n mod.directive('head', ['$rootScope','$compile',\n function... | javascript | edit | 0 | 5 | mit | 382b2099940ec2bf42646ff1f01a9f5005e5d52a | freedomdebug/angular-route-styles,elantion/angular-route-styles,freedomdebug/angular-route-styles,elantion/angular-route-styles,tennisgent/angular-route-styles | route-styles.js | rejected_duplicate | Near-duplicate of sample 85666 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nconst fs = require('fs');\nconst glob = require('glob');\nconst yaml = require('js-yaml');\nconst extendify = require('extendify');\n\nglob(\"templates/*.yml\", function (er, files) {\n const contents = files.map(f => {\n return yam... | javascript | edit | 0 | 3 | mit | 2995bcb5fa948204d2382c2fba1275cdffbff2c9 | buildkite/elastic-ci-stack-for-aws,holmesjr/elastic-ci-stack-for-aws,holmesjr/elastic-ci-stack-for-aws | generate.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n/** @license\n * Copyright 2016 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n\ngoog.provide('shaka.util.MediaReadyState');\n\n\nshaka.util.MediaReadyState = class {\n /*\n * @param {!HTMLMediaElement} mediaElement\n * @pa... | javascript | edit | 0 | 3 | apache-2.0 | afcbfb968f872b2f1462926bcb1956d43cd9cb05 | shaka-project/shaka-player,tvoli/shaka-player,shaka-project/shaka-player,tvoli/shaka-player,tvoli/shaka-player,tvoli/shaka-player,shaka-project/shaka-player,shaka-project/shaka-player | lib/util/media_ready_state_utils.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nimport EventEmitter from 'eventemitter3';\n\nclass FlashesStore extends EventEmitter {\n constructor() {\n super(...arguments);\n this.ERROR = \"error\";\n }\n\n flash(type, message) {\n // See if the message is actually a G... | javascript | edit | 0 | 6 | mit | 8a2de05444524ba913052a1bd838fbb4aa4fbf1d | fotinakis/buildkite-frontend,buildkite/frontend,fotinakis/buildkite-frontend,buildkite/frontend | app/stores/FlashesStore.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n/**\n * Gets whether the AMP story's featured image has the right minimum dimensions.\n *\n * The featured image populates teh AMP story poster image.\n * The 3 minimum dimensions for that are 696px x 928px, 928px x 696px, or 928px x 92... | javascript | edit | 0 | 10 | apache-2.0 | f93e584853de62a3df9da48dbe07786dee3d098c | ampproject/amp-toolbox-php,ampproject/amp-toolbox-php | assets/src/components/has-minimum-story-poster-dimensions.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n/*!\n * Copyright 2012 Sakai Foundation (SF) Licensed under the\n * Educational Community License, Version 2.0 (the \"License\"); you may\n * not use this file except in compliance with the License. You may\n * obtain a copy of the Lice... | javascript | edit | 0 | 3 | apache-2.0 | 563f1a51ca73c8c50d12c8420542965770c6a28f | Orodan/3akai-ux-jitsi-fork,Orodan/3akai-ux-jitsi-fork,nicolaasmatthijs/3akai-ux,timdegroote/3akai-ux,jfederico/3akai-ux,timdegroote/3akai-ux,nicolaasmatthijs/3akai-ux,stuartf/3akai-ux,mrvisser/3akai-ux,Coenego/avocet-ui,stuartf/3akai-ux,stuartf/3akai-ux,jfederico/3akai-ux,Orodan/3akai-ux-jitsi-fork,jfederico/3akai-ux,s... | shared/oae/js/jquery-plugins/jquery.jeditable-focus.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nexport const FETCH_QUEUE = 'FETCH_QUEUE'\nexport const FETCH_QUEUE_DONE = 'FETCH_QUEUE_DONE'\nexport const FETCH_ACCOUNTS = 'FETCH_ACCOUNTS'\nexport const FETCH_TAGS = 'FETCH_TAGS'\nexport const ADD_TAG = 'ADD_TAG'\nexport const REMOVE_... | javascript | edit | 0 | 1 | mit | f3f7541d46624e65ff90022c8ff0e66c5da4e786 | rymdkraftverk/q,rymdkraftverk/q,rymdkraftverk/q | client/src/actions.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n/**\n * Sample React Native Calendar Strip\n * https://github.com/BugiDev/react-native-calendar-strip\n * @flow\n */\n\nimport React, { Component } from 'react';\nimport CalendarStrip from \"react-native-calendar-strip\";\n\nexport defa... | javascript | edit | null | null | mit | 1c528dd7dbe806411b0f2efcdf0e219b6c8c6e21 | BugiDev/react-native-calendar-strip,BugiDev/react-native-calendar-strip,BugiDev/react-native-calendar-strip | example/example/App.js | rejected_syntax | Syntax error detected by tree-sitter | false |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nimport BaseCommand from './BaseCommand';\n\n/**\n * Simple command to ban a uaer by their ID.\n */\nclass IDBanCommand extends BaseCommand {\n constructor(bot) {\n super(bot);\n }\n\n /**\n * This event method we sho... | javascript | edit | 0 | 4 | mit | 418df71223c33559cea3dc822cd16fab8c912dba | ATLauncher/Discord-Bot | src/commands/IDBanCommand.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nconst fetch = require(\"node-fetch\");\nconst qs = require(\"qs\");\nconst { load } = require(\"js-yaml\");\n\nconst { getInstallationToken } = require(\"./installation-token\");\n\n\nmodule.exports.GitHub = class GitHub {\n constructo... | javascript | edit | 0 | 1 | mit | e53197be96bbbad51af8ad91dae000e607076f6d | divmain/maintainerd,divmain/maintainerd | github/index.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n/* eslint-disable global-require */\n\n'use strict';\n\nconst allRules = {\n 'no-unused-styles': require('./lib/rules/no-unused-styles'),\n 'no-inline-styles': require('./lib/rules/no-inline-styles'),\n 'no-color-literals': require('... | javascript | edit | 0 | 3 | mit | ad4e2c92062dfa1ab07510afa217cae83b1866d4 | Intellicode/eslint-plugin-react-native | index.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n// --------------------------------------------------------------------------------------------------------------------\n//\n// metadata-config.js - config for AWS Instance Metadata\n//\n// Copyright (c) 2011, 2012 AppsAttic Ltd - http:... | javascript | edit | 0 | 1 | mit | f0bc01603b491f14e593cc24329c18efc2beaf40 | chilts/awssum | lib/amazon/metadata-config.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nimport m from 'mithril';\nimport attributes from './attributes';\n\nexport let Card = {\n\tview(ctrl, args, ...children) {\n\t\targs = args || {};\n\t\tlet attr = attributes(args);\n\t\tlet {shadow} = args;\n\n\t\tattr.class.push('mdl-c... | javascript | edit | null | null | bsd-3-clause | c074e61d2506f472fedd8810b8e1f188df400b42 | reminyborg/node-mithril-mdl,PaulAvery/node-mithril-mdl,boazy/node-mithril-mdl,PaulAvery/mithril-mdl | src/card.js | rejected_syntax | Syntax error detected by tree-sitter | false |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nimport React, { Component } from 'react'\n\n//class-based component (ES6)\nclass SearchBar extends Component {\n render() { //method definition in ES6\n return <input onChange={event => console.log(event.target.value)} />;\n }\n\n}... | javascript | edit | 0 | 1 | mit | e40c302a81525957b523d07f287dab6bad0d4381 | phirefly/react-redux-starter,phirefly/react-redux-starter | src/components/search_bar.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nconst paths = require('./paths');\nconst fs = require('fs-extra');\nconst glob = require('glob');\n\n/**\n * Build the breakpoint\n *\n * @param {*} breakpoint\n * @param {*} count\n */\nfunction buildBreakpoint(breakpoint, count) {\n\t... | javascript | edit | 0 | 2 | apache-2.0 | 0a256cc090a1577dc9af7574351c1bf76f802c5d | weepower/wee,weepower/wee | build/responsive.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nangular.module('shortly.shorten', [])\n\n.controller('AccountsController', function ($scope, $window, $location, $http, Links) {\n\n // $scope.hasStripeConnectAccount = function() {\n\n // var currentUser = sessionStorage.getItem('u... | javascript | edit | 0 | 2 | mit | 43e31be248938a974944553c0152781f068f5122 | arosenberg01/headcount,kyleshockey/headcount,Illustrious-Dirigble/headcount,kyleshockey/headcount,rockytang/headcount,rockytang/headcount,arosenberg01/headcount,henrymollman/headcount,Za1batsu/FinIt,Za1batsu/FinIt,henrymollman/headcount,Illustrious-Dirigble/headcount | public/app/accounts/accounts.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nmodule.exports = {\n js: {\n lintNatives: true,\n name: '<%= pkg.name %>',\n url: '<%= pkg.homepage %>',\n version: '<%= pkg.version %>',\n description: '<%= pkg.description %>',\n options: {... | javascript | edit | 0 | 0 | mit | b870cb035827f13be864ba7efd4cc7a3476130c5 | Skelware/node-file-parser,Skelware/node-file-parser | grunt/yuidoc.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nimport ActiveModelAdapter from 'active-model-adapter';\nimport ActiveModelSerializer from 'active-model-adapter/active-model-serializer';\n\nexport default {\n name: 'active-model-adapter',\n initialize: function(applicationOrRegistry... | javascript | edit | 0 | 2 | mit | dddef42d59dc3af1cd2a43b311774dc286251d15 | bmac/active-model-adapter,ember-data/active-model-adapter,fivetanley/active-model-adapter,ember-data/active-model-adapter,jcope2013/active-model-adapter,ember-data/active-model-adapter,jcope2013/active-model-adapter,fivetanley/active-model-adapter,fivetanley/active-model-adapter,fivetanley/active-model-adapter,bmac/act... | app/instance-initializers/active-model-adapter.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n\"use strict\";\n\nvar fs = require('fs');\nvar path = require('path');\nvar extend = require('extend');\nvar template = require('lodash/template');\n\nvar errorHandler = require('./errorHandler');\n\nvar _fileNumber = 1;\nvar _config =... | javascript | edit | 0 | 3 | mit | bd7ff400fa44892019ec97cfda1c93f8e0e33d02 | cartridge/cartridge-cli,code-computerlove/quarry,code-computerlove/slate-cli | bin/fileTemplater.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nexport default () => {\n return {\n test: /\\.(png|jpg|gif|svg|eot|ttf|woff|woff2)$/i,\n loader: \"file\",\n query: { name: \"assets/[name]-[hash].[ext]\" }\n };\n}\n\n```\n\nApply this change: Remove svg from file-loader tes... | javascript | edit | 0 | 1 | mit | 76865f1c78009871ea8f0ec2e565f7b462481539 | kiurchv/frontend,mkyurchev/frontend,sunshine-code/frontend-cli,sunshine-code/frontend-cli | lib/bundler/loaders/static.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nmodule.exports = {\n \"replace\": {\n \"_i18n/template.en-US.json\": {\n \"author\": /docprofsky/g,\n \"info-name\": \"info.name\",\n \"info-use\": \"info.use\",\n \"info-detail\": \"info.detail\"\n },\n\n ... | javascript | edit | 0 | 0 | mit | e58cd331e4c5a21d42592d4b48333789ef1cfd50 | docprofsky/robopaint-mode-template,docprofsky/robopaint-mode-template | replace-values.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n\"use strict\";\n\nvar _ = require(\"lodash\"); // devDependency\nvar base = require(\"./webpack.config.dev\");\n\n// Clone our own module object.\nvar mod = _.cloneDeep(base.module);\nvar firstLoader = mod.loaders[0];\n\n// Update load... | javascript | edit | 0 | 0 | mit | f1cd6f85dd6fc7ccd1aa8d259ecdb9f34a149f9f | FormidableLabs/builder-radium-component,FormidableLabs/builder-radium-component,FormidableLabs/builder-victory-component | config/webpack/demo/webpack.config.hot.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nvar gulp = require('gulp')\n , gutil = require('gulp-util')\n , help = require('gulp-help')\n , path = require('path')\n , packageJson = require(path.resolve(__dirname, 'package.json'))\n , noop = ... | javascript | edit | 0 | 1 | mit | 2ccca7dca1b4c6bbdcc5bf3faf408c6f14d388bf | my-archives/cli,martinLE/cli,cogpie/cli,itslenny/cli,sequelize/cli,ataube/cli,martinLE/cli,Americas/cli,timrourke/cli,brad-decker/cli,sequelize/cli,Americas/cli,skv-headless/cli,jteplitz602/cli,xpepermint/cli,brad-decker/cli,brad-decker/cli,martinLE/cli,Americas/cli,sequelize/cli,fundon/cli,cusspvz/sequelize-cli | gulpfile.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nvar _ = require('lodash');\nvar stylelint = require('stylelint');\nvar STYLELINT_CONFIG = require('./config/stylelint');\nvar glob = require('glob');\n\nvar ruleUtils = require('./rule_utils');\n\nvar customRules = {};\n\nvar runLinter ... | javascript | edit | 0 | 3 | mit | 5a695d9e91ba8783e6fe9cbe48ed7544f6642a94 | natecavanaugh/check-source-formatting,natecavanaugh/check-source-formatting,natecavanaugh/check-source-formatting | lib/lint_css.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n/**\n * Checks if 'value' is a number.\n * Note: NaN is considered a number.\n * @param {*} value The value to check.\n * @returns {Boolean} Returns true if 'value' is a number, else false.\n */\nfunction isNumber(value) {\n ... | javascript | edit | 0 | 4 | mit | a701b0fb2bd2008aef1fdb0a56ddccb8f7331f91 | georapbox/smallsJS,georapbox/jsEssentials,georapbox/smallsJS | src/objects/isNumber/isNumber.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nvar gulp = require('gulp'),\n sass = require('gulp-sass'),\n rename = require('gulp-rename'),\n minifyCss = require('gulp-minify-css'),\n autoprefixer = require('gulp-autoprefixer'),\n browserSync = require('browser-sync'... | javascript | edit | 0 | 1 | cc0-1.0 | 13ca3b76cb5d8b9ff6818b13308f979f82f2a4b2 | FatecSorocaba/semana-da-tecnologia,FatecSorocaba/semana-da-tecnologia | gulpfile.js | rejected_duplicate | Near-duplicate of sample 76654 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nvar express = require('express');\n\nvar bodyParser = require('body-parser');\n\nvar app = express();\n\n// host static client files on server\n// app.use(express.static(__dirname + '/client'/* TODO: insert/change client folder path her... | javascript | edit | 0 | 1 | mit | 8b2cad5472e9aef24e3848e77a661ef04e16c468 | hr-memories/TagMe,BillZito/greenfield,hr-memories/greenfield,hr-memories/greenfield,BillZito/greenfield,hr-memories/TagMe | server/index.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nlet argv = require('yargs').argv;\n\nclass Paths {\n /**\n * Create a new Paths instance.\n */\n constructor() {\n if (argv['$0'].includes('ava')) {\n this.rootPath = path.resolve(__dirname, '../');\n ... | javascript | edit | 0 | 3 | mit | c29d2f92456d35b5f92e521f551e089c7f8c94f8 | JeffreyWay/laravel-mix | src/Paths.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nimport {List} from 'immutable';\nimport {CompiledProject} from '../records';\n\nconst initialState = new List();\n\nfunction trimRight(list, maxLength) {\n if (list.size <= maxLength) {\n return list;\n }\n\n return list.splice(0,... | javascript | edit | 0 | 8 | mit | 31269953529541f7c0d65dd6a9d2107867c190d2 | jwang1919/popcode,outoftime/learnpad,popcodeorg/popcode,outoftime/learnpad,popcodeorg/popcode,popcodeorg/popcode,jwang1919/popcode,jwang1919/popcode,jwang1919/popcode,popcodeorg/popcode | src/reducers/compiledProjects.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n'use strict';\n\nvar gulp = require( 'gulp' );\nvar g = require( 'gulp-load-plugins' )();\n\nvar allTestFiles = './tests/**/*.js';\n\ngulp.task( 'assets', function() {\n gulp.src([\n 'node_modules/gulp-mocha/node_modules/mocha/mocha... | javascript | edit | 0 | 1 | mit | 415925e578d732aa584d84282fbf62edd873d164 | Ibanheiz/ajax,negherbon/ajax,denis-itskovich/ajax,ggviana/ajax,felipegtx/ajax,caiocutrim/ajax,afgoulart/ajax | gulpfile.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nvar elixir = require('laravel-elixir');\n\n/*\n |--------------------------------------------------------------------------\n | Elixir Asset Management\n |--------------------------------------------------------------------------\n |\n ... | javascript | edit | 0 | 1 | mit | f0e6d9a889711086a581afe731c6916325343198 | UCCNetworkingSociety/NetsocAdmin,UCCNetworkingSociety/NetsocAdmin,UCCNetworkingSociety/NetsocAdmin,UCCNetworkingSociety/NetsocAdmin | gulpfile.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n/* @flow */\n\nconst useLSP = atom.config.get('flow-ide.useLSP')\n\n// possible improvement: check if flow really supports lsp\n\nif (useLSP === true) {\n // eslint-disable-next-line global-require\n const { FlowLanguageClient } = req... | javascript | edit | 0 | 1 | mit | 485cb7a0aff21ab4f8dd28db86935774a1fbf1b7 | steelbrain/flow-ide | lib/main.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nexport default class ColumnLayout {\n constructor (options) {\n this._options = {\n columns: 5\n };\n Object.assign(this._options, options);\n\n this._tileWidth = 0;\n this.height = 0;\n ... | javascript | edit | 0 | 3 | mit | 5304671a6aff5a08b33464e8ff181766d00f6acd | frigus02/silky-tiles | src/layouts/column-layout.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nimport {exec} from 'node-promise-es6/child-process';\nimport fs from 'node-promise-es6/fs';\n\nasync function run() {\n const {linkDependencies = {}} = await fs.readJson('package.json');\n for (const dependencyName of Object.keys(link... | javascript | edit | 0 | 3 | mit | 492b9d78a6a16daa3a9059b7bd24769c97d0443b | vinsonchuong/npm-integration | src/bin/commit-link-dependencies.js | rejected_duplicate | Near-duplicate of sample 79861 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nvar NwBuilder = require(\"node-webkit-builder\");\nvar asap = require(\"pdenodeify\");\nvar path = require(\"path\");\nvar rimraf = require(\"rimraf\");\n\nmodule.exports = function(options, buildResult){\n\tvar nwOptions = {};\n\n\t// ... | javascript | edit | 0 | 7 | mit | c0f7f3373ed393ea22f44ee65c39ba411300db1e | stealjs/steal-nw,stealjs/steal-nw | lib/main.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n// Common configuration for RequireJS\nvar require = {\n baseUrl: \"/scripts\",\n paths: {\n \"jquery\": \"bower_components/jquery/dist/jquery.min\",\n \"knockout\": \"bower_components/knockout/dist/knockout\",\n ... | javascript | edit | 0 | 0 | apache-2.0 | f43e339602f096e781d5a9c82e3befc94c73bcf3 | LukeTillman/killrvideo-csharp,LukeTillman/killrvideo-csharp,rustyrazorblade/killrvideo-csharp,LukeTillman/killrvideo-csharp,rustyrazorblade/killrvideo-csharp,rustyrazorblade/killrvideo-csharp | src/KillrVideo/scripts/requirejs-config.js | rejected_duplicate | Near-duplicate of sample 89983 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n/* jshint devel:true */\n/* global exports, require, URI */\n\nexports.parser = function(url, callbacks) {\n if (url) {\n var queryMap = new URI(url).search(true);\n if (queryMap.CFTemplateURL && callbacks.onTemplate) {... | javascript | edit | 0 | 4 | mit | b7613e8983281c1549a3c69e8c75698a45f00309 | dmgress/cloudgrapher,dmgress/cloudgrapher | app/scripts/queryparser.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nimport { Map as map } from 'immutable';\nimport React from 'react';\nimport PropTypes from 'prop-types';\nimport Editable from '../../../editable';\nimport { formatCurrency } from '../../../../misc/format';\n\nexport default function Ov... | javascript | edit | 0 | 3 | mit | 568d969199234703fd987407f5ba438abd8e0eba | felamaslen/budget,felamaslen/budget,felamaslen/budget,felamaslen/budget,felamaslen/budget,felamaslen/budget | web/src/containers/page/overview/table/cell-inner.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nimport { genKey } from './key';\n\nexport default class RouteHandler {\n\tconstructor(conf) {\n\t\tthis.id = genKey();\n\t\tthis.init = conf.init;\n\t\tthis.beforeInit = conf.beforeInit || null;\n\t\tthis.beforeUpdate = conf.beforeUpdat... | javascript | edit | 0 | 6 | apache-2.0 | 5ce651027d342ada2e4162f0f1d1f9e6bbcf51b3 | weepower/wee-core | scripts/routes/route-handler.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nvar express = require('express');\nvar Git = require(\"nodegit\");\nvar router = express.Router();\nvar token = process.env.GITHUB_TOKEN;\n\nrouter.post('/issues', function(req, res, next) {\n Git.Clone(\"https://\" + token + \":<EMAIL... | javascript | edit | 0 | 1 | mit | 49b3fb5255e9234d7817ce73a7b448372090bd17 | kewang/information-people,kewang/information-people | routes/index.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nvar algoliaComponents = require('algolia-frontend-components');\nvar fs = require('fs');\n\nimport {rootPath} from './path';\n\nconst prod = process.env.NODE_ENV === 'production';\nconst docsDist = process.env.DOCS_DIST;\n\nvar content ... | javascript | edit | 0 | 1 | mit | c14b51de61fac64aa8e1d05634885d00903fcca1 | algolia/instantsearch.js,algolia/instantsearch.js,algolia/instantsearch.js | docgen/config.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nmodule.exports = {\n db: {\n qrest_api:{\n $filter: 'env',\n $base: {\n options: {}\n },\n production: {\n url: 'mongodb://mongodb:27017/qrest_api'\n ... | javascript | edit | 0 | 0 | apache-2.0 | 584226c87cc41d09b28932972a55a22c74e420d2 | jgrenon/qrest-api-server | config/db.config.js | accepted | null | true |
[
{
"role": "user",
"content": "Write javascript code for the following: feat: Add in base CLI interface"
},
{
"role": "assistant",
"content": "#!/usr/bin/env node\n\nvar program = require('commander');\nvar prompt = require('inquirer');\nvar path = require('path');\n\nvar pkg = require(path.resol... | javascript | new_file | 0 | 1 | mit | 86fd65dddd74cc679ca1dea3fcdbb36c3ed7e723 | code-computerlove/quarry,code-computerlove/slate-cli,cartridge/cartridge-cli | bin/cli.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nconst assert = require('assert')\nconst choo = require('../../../')\n\nmodule.exports = function (params, state, send) {\n const serverMessage = state.message.server\n const clientMessage = state.message.client\n\n assert.equal(typeo... | javascript | edit | 0 | 2 | mit | ec81364906306227b9e4d40160c3a4921c458ea3 | yoshuawuyts/choo,antiBaconMachine/choo,antiBaconMachine/choo | examples/server-rendering/views/main.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nvar express = require('express');\nvar router = express.Router();\n\nimport encryptUtils from '../utilities/encrypt';\nimport userUtils from '../utilities/users_service.js';\n\nimport { userAuth, adminAuth } from '../utilities/auth';\n\... | javascript | edit | 0 | 1 | mit | 59120a3e1cd6fa2024d587af0655a0269f161211 | davidlamt/antfinder-api | routes/users.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nmodule.exports = {\n all: {\n options: {\n separator: ';',\n },\n files: {\n 'dist/js/binary.js': [\n 'src/javascript/lib/jquery.js',\n 'src/javascript/lib/high... | javascript | edit | 0 | 0 | apache-2.0 | 964abe02bbcfa8db34d6886feb79088397da5700 | junbon/binary-static-www2,junbon/binary-static-www2 | build/concat.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nanol.geocoder.Base = function(_options) {\n if(_options === undefined) {\n return;\n }\n this.url = _options.url;\n this.options = _options;\n};\n\nanol.geocoder.Base.prototype = {\n CLASS_NAME: 'anol.geocoder.Base... | javascript | edit | 0 | 2 | mit | 1a420d9d243983fad908021fc13e90a101f8e58b | omniscale/anol,omniscale/anol | src/anol/geocoder/base.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n/**\n * WordPress dependencies\n */\nimport { __, sprintf } from '@wordpress/i18n';\n\n/**\n * External dependencies\n */\nimport { sanitizeHTML } from 'assets/js/util';\n\nexport const settingsDetails = () => {\n\tconst { dashboardPerm... | javascript | edit | 0 | 1 | apache-2.0 | 3209c40ebe0070a4430009f6f703cf3fcf95e6f8 | google/site-kit-wp,google/site-kit-wp,google/site-kit-wp,google/site-kit-wp | assets/js/modules/pagespeed-insights/settings/index.js | rejected_duplicate | Near-duplicate of sample 87859 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nfunction renderDeliciousLinks(items) {\n var output = '<ul class=\"divided\">';\n for (var i = 0, l = items.length; i < l; i++) {\n output += '<li><a href=\"' + items[i].u + '\" title=\"Tags: ' + (items[i].t == \"\" ? \"\" ... | javascript | edit | 0 | 3 | mit | f0c7e9ae7ee156ddce2ab5c715b0f281deb3e8b8 | coogie/oscailte,coogie/oscailte | source/javascripts/octopress.js | accepted | null | true |
[
{
"role": "user",
"content": "Write javascript code for the following: Split out error dialog into component"
},
{
"role": "assistant",
"content": "import React from 'react';\n\nimport Dialog from 'material-ui/lib/dialog';\nimport FlatButton from 'material-ui/lib/flat-button';\n\nexport default ... | javascript | new_file | 0 | 1 | cc0-1.0 | ecd6381d3fa70c393aa8892ed696093600583111 | ksmithbaylor/emc-license-summarizer,ksmithbaylor/emc-license-summarizer,ksmithbaylor/emc-license-summarizer | src/App/Body/ErrorDialog.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nimport { compose } from 'redux';\nimport { connect } from 'react-redux';\nimport prepare from 'app/utils/prepare';\nimport {\n joinGroup,\n leaveGroup,\n fetchGroup,\n fetchMemberships,\n} from 'app/actions/GroupActions';\nimport In... | javascript | edit | 0 | 1 | mit | 1d5fade0858d0c95b89dacd6db51c14250755f27 | webkom/lego-webapp,webkom/lego-webapp,webkom/lego-webapp | app/routes/interestgroups/InterestGroupDetailRoute.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nimport { debug, context } from './utils'\n\nconst version = require('../package.json').version\n\nimport config from './config/config'\nimport setup from './config/setup'\nimport groups from './registry/registry'\nimport { create, load ... | javascript | edit | null | null | mit | e9cd59b69ecd25a80a71fdbbfdf2b96bcc1ff677 | spirit/spirit | src/index.js | rejected_syntax | Syntax error detected by tree-sitter | false |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nimport uglify from 'rollup-plugin-uglify';\nimport commonjs from 'rollup-plugin-commonjs';\nimport resolve from 'rollup-plugin-node-resolve';\n\nexport default {\n name: 'KeyCode',\n input: 'index.js',\n output: {\n form... | javascript | edit | 0 | 0 | mit | c190d2d5317b6075a2a923bd6b61764c25fbd099 | kabirbaidhya/keycode-js,kabirbaidhya/keycode-js,kabirbaidhya/keycode-js,kabirbaidhya/keycode-js | rollup.config.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nvar routeList = require('../config/routeList');\nvar router = require('koa-router'); \nvar controllers = require('./controllers')\nvar views = require('./views'); \n\nmodule.exports = function(app){\n app.use(views('./views', {\n ma... | javascript | edit | 0 | 3 | bsd-2-clause | cecc6b4c8ce022b874b63450005d2e52ddc9cde7 | Tombert/frameworkey | guts/router.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nimport {Vector3} from 'three';\nimport {ThreeOrbitControls} from './lib/ThreeOrbitControls';\n\nexport class OrbitModule {\n constructor(params = {}) {\n this.params = Object.assign({\n target: new Vector3(0, 0, 0),\n foll... | javascript | edit | 0 | 2 | mit | 8a856c3abacefad6dd5679baa714fe7bc24446ee | WhitestormJS/whitestorm.js,WhitestormJS/whitestorm.js | src/modules/controls/OrbitModule.js | rejected_duplicate | Near-duplicate of sample 76828 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nimport babel from 'rollup-plugin-babel';\nimport resolve from 'rollup-plugin-node-resolve';\nimport commonjs from 'rollup-plugin-commonjs';\nimport { terser } from 'rollup-plugin-terser';\n\nimport pkg from './package.json';\n\nconst in... | javascript | edit | 0 | 2 | mit | 6a619aa2629dc6bc049e7209265d8ee2cb9b72b2 | perrin4869/react-stay-scrolled | rollup.config.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nimport React, { Component } from 'react';\n\nimport GBox from 'grommet/components/Box';\nimport GParagraph from 'grommet/components/Paragraph';\nimport GHeading from 'grommet/components/Heading';\n\nimport CLineList from '../containers/... | javascript | edit | 0 | 1 | mit | ed3ec4d2b860c259bb4d50dc972a891f8e1492c8 | rjbernaldo/lines,rjbernaldo/lines | src/components/Sidebar.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nconst logger = require('../logging');\nconst passport = require('passport');\nconst { setupOIDC } = require('./oidc');\nconst { deserializeUser } = require('./user');\n\nmodule.exports = async (app) => {\n await setupOIDC();\n\n passp... | javascript | edit | 0 | 1 | mit | 29ecf0322654ac415df36802f403dad414bc5afe | dotkom/super-duper-fiesta,dotkom/super-duper-fiesta,dotkom/super-duper-fiesta | server/auth/index.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n// Loaded ready states\nconst loadedStates = ['interactive', 'complete'];\n\n// Return Promise\nmodule.exports = (cb, doc) => new Promise(resolve => {\n\t// Use global document if we don't have one\n\tdoc = doc || document;\n\n\t// Hand... | javascript | edit | 0 | 5 | mit | 7a47a3665290f18a51a13fb183e3c388bff83691 | lukechilds/when-dom-ready | src/index.js | rejected_duplicate | Near-duplicate of sample 102002 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nvar exec = require('child_process').exec\n\nmodule.exports.asyncIterate = function(array, callback, done) {\n function iterate(idx) {\n var current = array[idx]\n\n if (current) {\n callback(current, function... | javascript | edit | 0 | 4 | mit | eff5178476db5a6326312b5c4f6026d86c1546e5 | mnylen/pig,mnylen/pig | lib/helpers.js | rejected_duplicate | Near-duplicate of sample 103328 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n'use babel'\n\nconst COLOR_EXTRACTION_REGEXP = /rgb\\(\\d+, \\d+, \\d+\\)|\\#[0-9a-f]{3,6}/\n\nexport function isColor(textEditor, bufferPosition) {\n const lineText = textEditor.getTextInRange([[bufferPosition.row, 0], [bufferPosition... | javascript | edit | 0 | 3 | mit | d9b87491c95c1caaf6e14f31723ae3978babc918 | steelbrain/intentions-colorpicker | lib/helpers.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nimport React from \"react\";\nimport { View } from \"react-native\";\nimport { withRouter } from \"react-router\";\n\nimport ListingProvider from \"../app/ListingProvider\";\nimport PostListSort from \"../components/PostListSort\";\nimp... | javascript | edit | 0 | 1 | mit | 8675d11a8aafe341e3146bd42c90c8b794d61243 | yanglinz/reddio-next,yanglinz/reddio-next,yanglinz/reddio-next | packages/reddio-ui/src/screens/ListingResolver.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n/**\n * General test runner\n */\n\nvar fs = require('fs');\nvar files = fs.readdirSync(fs.realpathSync('./test'));\n\nconsole.log(files);\n\nfor (var i in files) {\n var pattern = /^(test)\\w*\\.js$/;\n if (files.hasOwnProperty(i)) {... | javascript | edit | 0 | 0 | mit | c10cab06a2115995e818e4e7f8fde6882c554bed | jay-depot/turnpike,jay-depot/turnpike | test/all.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n'use strict'\n\nlet sass = require('node-sass')\n\n/*\n * Transform SASS to CSS.\n * @public\n * @param {string} folderPath - Path to the folder containing the SASS file.\n * @param {string} str - SASS.\n * @param {Object} opts - Option... | javascript | edit | 0 | 2 | mit | e99b789a7086f889355edea3ab293640c3f719be | electerious/rosid-handler-sass,electerious/rosid-handler-scss | src/sass.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nexport default function createDevToolsStore(onDispatch) {\n let currentState = {\n committedState: {},\n stagedActions: [],\n computedStates: [],\n skippedActions: {},\n currentStateIndex: 0\n };\n let listeners = [];\... | javascript | edit | 0 | 2 | mit | 0e6cd321da81c54b173eb685f96d4cf964126997 | zalmoxisus/redux-devtools-extension,zalmoxisus/redux-devtools-extension | src/app/store/createDevStore.js | rejected_duplicate | Near-duplicate of sample 87424 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nvar speculation = function speculation (fn) {\n // Don't cancel by default:\n var cancel = (\n arguments.length > 1 &&\n arguments[1] !== undefined\n ) ? arguments[1] : Promise.reject();\n\n return new Promise(function (resolv... | javascript | edit | 0 | 2 | mit | f0c0b33c3e7c69bc8e1b704a18f8e206e346cb57 | ericelliott/speculation | src/index.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nmodule.exports = {\n\ttransform: {\n\t\t\".(ts|tsx)\": \"ts-jest\"\n\t},\n\t\"testEnvironment\": \"node\",\n\t\"testRegex\": \"(/__tests__/.*|\\\\.(test|spec))\\\\.(ts|tsx|js)$\",\n\t\"moduleFileExtensions\": [\n\t\t\"ts\",\n\t\t\"tsx\"... | javascript | edit | 0 | 0 | mit | 1e6590e401dc544e7c6e3c608216124e240ee6ce | aholstenson/transitory,aholstenson/transitory | jest.config.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n/**\n * Sample React Native App\n * https://github.com/facebook/react-native\n * @flow\n */\n\nimport React, { Component } from 'react';\nimport {\n AppRegistry,\n StyleSheet,\n Text,\n View\n} from 'react-native';\nimport {Provider... | javascript | edit | 0 | 1 | mit | 9b457064997fde1aa218bd65ce9bd04a8dcabddb | asharov/fussbolito,asharov/fussbolito,asharov/fussbolito | index.android.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n/* Clearing variables */\n\nimport { getPositionIn, getPositionOut } from './offsetCalculator';\nimport getInlineOption from './getInlineOption';\n\nconst prepare = function($elements, options) {\n $elements.forEach((el, i) => {\n c... | javascript | edit | 0 | 5 | mit | f49e4db8c5be936ecf711a8cda3e86d425f7e96d | michalsnik/aos | src/js/helpers/prepare.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n/*jslint node: true*/\n'use strict';\n\n/**\n * Decode the value.\n *\n * @param value The value.\n * @returns The value.\n */\nmodule.exports = function (value) {\n\t// Check if the value is not a string.\n\tif (typeof value !== 'strin... | javascript | edit | 0 | 2 | mit | a73de96c4707b91ea11f92889ada2124528161b9 | barringtonhaynes/gaikan | lib/runtime/alterant/decode-alterant.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nvar _ = require('underscore');\n\nSYMBOL_TABLE = {}\n\nexports.define = function (sym, val) {\n SYMBOL_TABLE[sym] = val;\n}\n\nexports.eval = function eval(form, stack_frame) {\n if (typeof stack_frame == 'undefined') {\n stack_fra... | javascript | edit | 0 | 5 | mit | 623926ce52dd881b9cec00c05b6c9a7996c9636c | mikedouglas/conspiracy | lib/eval.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nimport React from 'react';\nimport ReactDOM from 'react-dom';\nimport './index.css';\nimport App from './App';\nimport registerServiceWorker from './registerServiceWorker';\nimport Navbar from './components/Navbar.js';\nimport Header fr... | javascript | edit | 0 | 0 | mit | 522968de5fe048b701f7cd6600f5592e44bc6a4f | FilmonFeMe/coloreyes,FilmonFeMe/coloreyes | src/index.js | rejected_duplicate | Near-duplicate of sample 97096 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nvar util = require('./util');\n\nmodule.exports = function fetchFeed(delegate) {\n // delegate.url: a url string\n // delegate.verbose: a bool\n // delegate.onError: an error handler\n // delegate.onResponse: a response and data han... | javascript | edit | 0 | 2 | mit | 8e4fbf59e00475f90dbf7d096550fa906db88370 | hlfcoding/custom-rss | src/fetch-feed.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nmodule.exports = {\n root: true,\n env: {\n 'browser': true\n },\n parser: 'babel-eslint',\n parserOptions: {\n sourceType: 'module'\n },\n extends: 'airbnb',\n plugins: [\n 'html'\n ],\n rules: {\n 'import/extensi... | javascript | edit | 0 | 0 | mit | fcde897bd7fbe28579e6a3c2307bd715da1a014f | eddyerburgh/avoriaz,eddyerburgh/avoriaz,eddyerburgh/avoriaz | .eslintrc.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nconst reporter = require('mocha/lib/reporters').min;\nconst bridgeTests = require('mocha-selenium-bridge');\nconst { Builder } = require('selenium-webdriver');\n\nconst bsConfig = {\n project: 'messageformat',\n 'browserstack.local': ... | javascript | edit | 0 | 3 | mit | 1bf03374b7edefdabacefbceb43ca02c6b702920 | SlexAxton/messageformat.js,SlexAxton/messageformat.js | test/browser/browserstack-runner.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nwindow.docMeta = (function () {\n var version = '3.2';\n var name = 'ogm-manual';\n var href = window.location.href;\n return {\n name: name,\n version: version,\n availableDocVersions: [\"2.0\", \"2.1\", \"3.0\", \"3.1\"],... | javascript | edit | 0 | 1 | apache-2.0 | 8361884021d550d663afce82583f1d0cd6807283 | neo4j/neo4j-ogm,neo4j/neo4j-ogm,neo4j/neo4j-ogm,neo4j/neo4j-ogm | neo4j-ogm-docs/src/main/resources/javascript/version.js | accepted | null | true |
[
{
"role": "user",
"content": "Write javascript code for the following: Add code for sum and mean to 7.8"
},
{
"role": "assistant",
"content": "// Release 1: Tests to User Stories\n\n/*\n\nAs as user, I want to be able to do three things:\n\n(1) I want to be able to take a list of numbers and fin... | javascript | new_file | 0 | 2 | mit | 09f98cd872a914cfeab6687ab009a145d5b4fbd9 | SilverFox70/phase-0,SilverFox70/phase-0,SilverFox70/phase-0 | week-7/group_project_solution.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nmodule.exports = {\n\t\"root\": true,\n\t\"env\": {\n\t\t\"es6\": true,\n\t\t\"browser\": true\n\t},\n\t\"extends\": \"eslint:recommended\",\n\t\"parserOptions\": {\n\t\t\"sourceType\": \"module\"\n\t},\n\t\"rules\": {\n\t\t\"indent\": ... | javascript | edit | 0 | 0 | mit | c07cfefbf1093bfa52a206fae1126b29e29fdc21 | to2mbn/skinview3d | .eslintrc.js | rejected_duplicate | Near-duplicate of sample 71667 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nvar $ = require('jquery');\nvar settings = require('settings');\n\n\nfunction getCookie() {\n match = document.cookie.match(/osf=(.*?)(;|$)/);\n return match ? match[1] : null;\n}\n\nfunction buildUrl(metadata, path, provider, fil... | javascript | edit | 0 | 4 | apache-2.0 | 2da65957e020bab97b6f3c0ddb67bf291ed0f925 | hmoco/osf.io,amyshi188/osf.io,caseyrollins/osf.io,zkraime/osf.io,asanfilippo7/osf.io,monikagrabowska/osf.io,hmoco/osf.io,lyndsysimon/osf.io,dplorimer/osf,felliott/osf.io,samchrisinger/osf.io,crcresearch/osf.io,aaxelb/osf.io,reinaH/osf.io,Nesiehr/osf.io,sbt9uc/osf.io,cosenal/osf.io,HarryRybacki/osf.io,monikagrabowska/os... | website/static/js/waterbutler.js | accepted | null | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.