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\nmodule.exports = {\n plugins: ['@typescript-eslint'],\n overrides: [\n {\n files: ['**/*.ts', '**/*.tsx'],\n rules: {\n // typescript will handle this so no need for it\n 'no-undef': 'off',\n 'no-unus... | javascript | edit | 0 | 0 | mit | a2981360a9531458ce590eb8c6144fbd64848d90 | relekang/eslint-config-relekang | configs/typescript.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nconst db = require('../lib/db')\nconst mongoose = db.goose\nconst conn = db.rope\n\nconst fs = require('fs')\nconst router = require('koa-router')()\nconst File = require('../lib/models/file')\nconst grid = require('gridfs-stream')\n\nc... | javascript | edit | 0 | 3 | mit | f1da9f35647cd44ee8bd898593da8f35b7e7cb02 | kunni80/server,muffin/server | routes/media.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n\n\"use strict\";\n\n$(function () {\n \n//-----------------------\n //- Dashboard > Authentication Requests Chart -\n //-----------------------\n\ttry{\n\t\n\n var authChartData = JSON.parse($(\"#authenticationChartJson\").val()); ... | javascript | edit | 0 | 2 | mit | 248123f9306c6805df7026153dd13e98113e9e77 | madumlao/oxTrust,madumlao/oxTrust,GluuFederation/oxTrust,GluuFederation/oxTrust,GluuFederation/oxTrust,madumlao/oxTrust,madumlao/oxTrust,GluuFederation/oxTrust,GluuFederation/oxTrust,madumlao/oxTrust | server/src/main/webapp/resources/js/dashboard.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nvar locationDep = new Deps.Dependency();\nvar location = null;\nvar locationRefresh = false;\n\nvar options = {\n enableHighAccuracy: true,\n maximumAge: 0\n};\n\nvar errCallback = function () {\n // do nothing\n};\n\nvar callback = ... | javascript | edit | 0 | 3 | mit | 28df4f7258df6930b0fa5892becde4c8962c6017 | steedos/meteor,yalexx/meteor,justintung/meteor,Profab/meteor,mubassirhayat/meteor,aramk/meteor,ashwathgovind/meteor,lpinto93/meteor,jagi/meteor,skarekrow/meteor,papimomi/meteor,SeanOceanHu/meteor,emmerge/meteor,lawrenceAIO/meteor,dfischer/meteor,Theviajerock/meteor,rabbyalone/meteor,mubassirhayat/meteor,stevenliuit/met... | packages/geolocation/geolocation.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nimport {formatString} from './utils';\nimport HostStorage from './Storage/HostStorage';\nimport ContextualIdentities from './ContextualIdentity';\nimport ExtendedURL from './ExtendedURL';\n\nexport async function buildDefaultContainer(p... | javascript | edit | 0 | 5 | mit | 4875769e5f7b38642e76ef8996058b644b45aae2 | kintesh/containerise,kintesh/containerise | src/defaultContainer.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n'use strict';\n\nconst readline = require('readline');\n\nconst _ = require('lodash');\nconst Bacon = require('baconjs');\n\nfunction parseLine (line) {\n const p = line.split('=');\n const key = p[0];\n p.shift();\n const value = p... | javascript | edit | 0 | 3 | apache-2.0 | 0cacc1182e66fe3cc8ac68639309b1bc5c8714b2 | CleverCloud/clever-tools,CleverCloud/clever-tools,CleverCloud/clever-tools | src/models/variables.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nimport React from 'react'\nimport styled from 'styled-components'\n\nconst Modal = props =>\n props.isOpen ? (\n <ModalContainer>\n <ModalContent>{props.children}</ModalContent>\n </ModalContainer>\n ) : (\n <div />\n )... | javascript | edit | 0 | 1 | mit | af56a39be34c4c42ffffbcf9f5dff5bba268bb8a | h-simpson/hughsimpson.me,h-simpson/hughsimpson.me | src/components/Modal.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nimport Ember from 'ember';\nimport { default as CalendarEvent } from 'el-calendar/components/calendar-event';\nimport layout from '../templates/components/ilios-calendar-event';\nimport moment from 'moment';\n\nconst {computed, Handleba... | javascript | edit | 0 | 1 | mit | 254a3a85d6ca2e769949c7062bb6035dcfd9cd11 | ilios/calendar,jrjohnson/calendar,stopfstedt/calendar,stopfstedt/calendar,ilios/calendar,jrjohnson/calendar | addon/components/ilios-calendar-event.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nTemplate.postSubmit.events({\n 'submit form': function(e) {\n e.preventDefault();\n\n var post = {\n url: $(e.target).find('[name=url]').val(),\n title: $(e.target).find('[name=title]').val()\n };\n\n post.slug = ... | javascript | edit | 0 | 2 | mit | 63cd19e26f0cd5629372fb50c0244986c3ef1bbd | drainpip/music-management-system,drainpip/music-management-system | app/client/templates/posts/post_submit.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nimport logger from 'logger';\n\nimport { getAppObj } from '../network';\n\nconst safeRoute = {\n method : 'GET',\n path : '/safe/{link*}',\n handler : async ( request, reply ) =>\n {\n try\n {\n ... | javascript | edit | 0 | 4 | mit | e3c9a348450c91830d5e36a792563fffcbe7d992 | joshuef/peruse,joshuef/peruse | app/extensions/safe/server-routes/safe.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n// Test functions\nfunction multiply (a, b) {\n 'use strict'\n return a * b\n}\n\nfunction divide (a, b) {\n 'use strict'\n try {\n return multiply(add(a, b), a, b) / c\n } catch (e) {\n Opbeat.captureException(e)\n }\n}\n\n... | javascript | edit | 0 | 2 | mit | 9403627fad7d97e27f83643099d264a3b17b9b4a | opbeat/opbeat-angular,opbeat/opbeat-react,jahtalab/opbeat-js,opbeat/opbeat-js-core,jahtalab/opbeat-js,opbeat/opbeat-react,opbeat/opbeat-js-core,opbeat/opbeat-angular,jahtalab/opbeat-js,opbeat/opbeat-react,opbeat/opbeat-angular | examples/minimal/app.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n$(document).on('turbolinks:load', function () {\n $(\"#selectImage\").imagepicker({\n hide_select: true,\n show_label : true\n });\n\n var $container = $('.image_picker_selector');\n // initialize\n $contai... | javascript | edit | 0 | 1 | mit | 561d5e010f91fef43bda94e7e51af6ed5cbd9792 | ppanagiotis/gamemooch,ppanagiotis/gamemooch,ppanagiotis/gamemooch,ppanagiotis/gamemooch | app/assets/javascripts/custom.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n/**\n * Wysiwyg related javascript\n */\n\n// =require ./lib/redactor.js\n\n(function($){\n $(document).ready( function() {\n /**\n * Minimal wysiwyg support\n */\n $('.wysiwyg-minimal').redactor({\n airButtons: ['bo... | javascript | edit | 0 | 1 | mit | 84bc2383b6c99b0e4696f758b5cb5fa9749fcb14 | Courseware/coursewa.re,Courseware/coursewa.re | app/assets/javascripts/editor.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nconst fs = require('fs')\nconst { promisify } = require('util')\nconst request = require('sync-request')\nconst AdmZip = require('adm-zip')\nconst lockfile = require('lockfile')\n\nconst lockPromise = promisify(lockfile.lock)\n\nconst t... | javascript | edit | 0 | 2 | mit | b49b4c23636c8264794085b33ffcc702a3d46620 | nellh/bids-validator,nellh/bids-validator,Squishymedia/bids-validator,Squishymedia/BIDS-Validator,nellh/bids-validator | bids-validator/tests/env/load-examples.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nimport React, {Component} from 'react';\nimport $ from 'jquery';\nimport CurrentWeatherCard from './CurrentWeatherCard';\n\nexport default class App extends Component {\n constructor(){\n super()\n this.state = {\n location:... | javascript | edit | 0 | 1 | mit | 7a49bcacbb557caca510ea8a044e4a57a62a8733 | thatPamIAm/weathrly,thatPamIAm/weathrly | lib/components/App.js | rejected_duplicate | Near-duplicate of sample 98877 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nimport Ember from 'ember';\nimport TravisRoute from 'travis/routes/basic';\nimport config from 'travis/config/environment';\n\nexport default TravisRoute.extend({\n needsAuth: false,\n\n titleToken(model) {\n var name = model.name ... | javascript | edit | 0 | 2 | mit | 40b9521f4e05eed0bf03accf868f5a4e844e3b9f | fotinakis/travis-web,travis-ci/travis-web,travis-ci/travis-web,fotinakis/travis-web,fotinakis/travis-web,fotinakis/travis-web,travis-ci/travis-web,travis-ci/travis-web | app/routes/owner/repositories.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n/*\n * Clock plugin using Moment.js (http://momentjs.com/) to\n * format the time and date.\n *\n * The only exposed property, 'format', determines the\n * format (see Moment.js documentation) to display time and date.\n *\n * Requires ... | javascript | edit | 0 | 3 | mit | 4b707d9da54fb68888a5494fcd9d6d64036446c1 | koterpillar/tianbar,koterpillar/tianbar,koterpillar/tianbar | scripts/time.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n\nvar fs = require(\"fs\");\nvar path = require(\"path\");\nvar utilities = require(\"./utilities\");\n\nmodule.exports = {\n\n addFabricBuildToolsGradle: function() {\n\n var buildGradle = utilities.readBuildGradle();\n\n ... | javascript | edit | 0 | 1 | mit | 72bcff83f71a0fd9cb04a05386e43898c6fbf75b | andrestraumann/FabricPlugin,sarriaroman/FabricPlugin,andrestraumann/FabricPlugin,sarriaroman/FabricPlugin,sarriaroman/FabricPlugin,andrestraumann/FabricPlugin,sarriaroman/FabricPlugin | hooks/lib/android-helper.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nimport {Component, View, bootstrap} from 'angular2/angular2';\n\n// Annotation section\n@Component({\n selector: 'my-app'\n})\n@View({\n inline: '<h1>Hello {{ name }}</h1>'\n})\n// Component controller\nclass MyAppComponent {\n ... | javascript | edit | 0 | 1 | mit | 796174d58262bafa0157684ae6e28e455dec82b3 | training-blogs/20150514-ionic-angular-2-series-introduction,training-blogs/20150514-ionic-angular-2-series-introduction,training-blogs/20150514-ionic-angular-2-series-introduction | app.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n'use babel'\n\nimport {MessageRegistry} from '../lib/message-registry'\nimport {getLinter, getMessage} from '../spec/common'\nimport {timeNow, timeDiff, getMessages} from './common'\n\nconst messageRegistry = new MessageRegistry()\nmess... | javascript | edit | 0 | 2 | mit | 8d1f37df3b597e5fe53374a3c2ec37d0ca54816e | steelbrain/linter,AtomLinter/Linter,atom-community/linter | benchmarks/message-registry.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n$(function() {\n $(\"#register\").submit(function() {\n var password = $(\"#password\").val();\n if (password !== $(\"#confirm\").val()) {\n return false;\n }\n var hashedPassword = CryptoJS.SHA256(password).toString()... | javascript | edit | 0 | 3 | mit | c9b1e95d27e9e5bc150576cd02a2e4769a073f8f | jimguys/poemlab,jimguys/poemlab | public/js/register.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nvar util = require('../src/util/seeds');\n\n\nexports.seed = function(knex, Promise) {\n return util.insertOrUpdate(knex, 'cities', {\n id: 1,\n name: 'Otaniemi',\n })\n .then(() => util.insertOrUpdate(knex, 'cities', {\n id... | javascript | edit | 0 | 1 | mit | 3f6b6b1db300809bef2540df1c6f05d53e2482af | futurice/wappuapp-backend,futurice/wappuapp-backend,kaupunki-apina/prahapp-backend,kaupunki-apina/prahapp-backend | seeds/cities.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n'use strict';\n\nangular.module('app').controller('LoginCtrl', function($scope, $uibModal, mafenSession, alertify, PATHS) {\n 'ngInject';\n\n $scope.mafenSession = mafenSession;\n\n $scope.user = {};\n\n $scope.login = function() {\... | javascript | edit | 0 | 1 | mit | 692aa1ca5d46206e7e8e360412b545f593e4d355 | b0r3d0m/mafen,pil-a/mafen,pil-a/mafen,pil-a/mafen,b0r3d0m/mafen,b0r3d0m/mafen | web/client/scripts/controllers/LoginCtrl.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nvar BitBucket = {\n\n hasLogin: function () {\n return !!localStorage['bitbucketLogin'] && !!localStorage['bitbucketRepo'];\n },\n\n getLastChangeset: function (user, repo, callback, fail) {\n var url = \"https://bitbucket.org/... | javascript | edit | 0 | 2 | mit | c2c711f7896ad4cf405e239a4d37dd8112fd288a | asivokon/mooch-sentinel,asivokon/mooch-sentinel,asivokon/mooch-sentinel,asivokon/mooch-sentinel | chrome-extension/app/scripts/bitbucket.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nimport webpack from 'webpack'\nimport baseWebpackConfig from './webpack.base'\nimport UglifyJSPlugin from 'uglifyjs-webpack-plugin'\nimport {BundleAnalyzerPlugin} from 'webpack-bundle-analyzer'\nimport {Plugin as ShakePlugin} from 'webp... | javascript | edit | 0 | 0 | apache-2.0 | e9de3d6da5e3cfc03b6d5e39fe92ede9c110d712 | Metnew/react-semantic.ui-starter | webpack_config/server/webpack.prod.babel.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n/*global Ember */\n\nvar trailingHistory = Ember.HistoryLocation.extend({\n setURL: function (path) {\n var state = this.getState();\n path = this.formatURL(path);\n path = path.replace(/\\/?$/, '/');\n\n ... | javascript | edit | 0 | 1 | mit | aa9db35cfe91efef0dc797324b5570fd2245d66a | TryGhost/Ghost,TryGhost/Ghost,TryGhost/Ghost | ghost/admin/initializers/trailing-history.js | rejected_duplicate | Near-duplicate of sample 93439 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nvar semver = require('semver');\n\nfunction getSupportedTypescriptTarget() {\n var nodeVersion = process.versions.node;\n\n if (semver.gt(nodeVersion, '7.6.0')) {\n return 'es2017'\n } else if (semver.gt(nodeVersion, '7.0.0')) {\n... | javascript | edit | 0 | 5 | mit | 6bf45d425a47caa83eae07113249c414df6c32c4 | maxdavidson/structly,maxdavidson/structly | jest.config.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\ncatalogApp.controller('CatalogCtrl', ['$scope', 'assetService', function($scope, assetService) {\n\n $scope.assets = [];\n $scope.totalHits = 0;\n\n $scope.getAssets = function(data) {\n var promise = assetService.getAssets({\n ... | javascript | edit | 0 | 2 | mit | f4d79cf2e7924ef1dd294e8c37ce54bfc2a73d02 | satbirjhuti/catalogFeed,satbirjhuti/catalogFeed | js/controllers/catalog-ctrl.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n/* eslint strict: 0 */\n'use strict';\n\n// Load environment variables\nrequire('dotenv-safe').load();\n\n// Load assets\nconst assets = require('./assets');\nconst express = require('express');\nconst compression = require('compression... | javascript | edit | 0 | 1 | mit | 2f2a17f599a3d3de05b61664c6d321494c01e552 | reauv/persgroep-app,reauv/persgroep-app | server/production.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n\"use strict\";\n\nmodule.exports = function Browscap (cacheDir) {\n if (typeof cacheDir === 'undefined') {\n cacheDir = './sources/';\n }\n\n this.cacheDir = cacheDir;\n\n /**\n * parses the given user agent to get the informa... | javascript | edit | 0 | 2 | mit | 1a067a9635585cbb96c80040b2941e92868b07df | mimmi20/browscap-js | browscap.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nimport normalizeEvents from './tools/normalizeEvents';\nimport normalizeListener from './tools/normalizeListener';\n\nexport default function stereo () {\n let listeners = {};\n\n let emitter = {\n on(events, listener) {\n // ... | javascript | edit | 0 | 4 | mit | a7da36d8376de9f2eccac11f9e3db35618ecf44a | stoeffel/stereo,tomekwi/stereo | source/index.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n// ==UserScript==\n// @name eBay - Hilight Items With Bids\n// @namespace http://mathemaniac.org\n// @include http://*.ebay.*/*\n// @grant none\n// @version 2.3.1\n// @require http://ajax.googleapis.... | javascript | edit | 0 | 3 | mit | a205caefe68d4c9279aaa86470c30974da226874 | Eckankar/userscripts,Eckankar/userscripts | Miscellaneous/ebay.highlight-bids.user.js | rejected_duplicate | Near-duplicate of sample 75929 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nconst mongoskin = require('mongoskin');\nconst logger = require('../log.js');\n\nclass GameRepository {\n save(game, callback) {\n var db = mongoskin.db('mongodb://127.0.0.1:27017/throneteki');\n\n if(!game.id) {\n ... | javascript | edit | 0 | 2 | mit | a0b049a5f396eb9498bd1a8ea8bdb79f64321b97 | ystros/throneteki,jeremylarner/ringteki,cryogen/gameteki,DukeTax/throneteki,cryogen/throneteki,jbrz/throneteki,gryffon/ringteki,jeremylarner/ringteki,jbrz/throneteki,gryffon/ringteki,Antaiseito/throneteki_for_doomtown,cryogen/throneteki,Antaiseito/throneteki_for_doomtown,cryogen/gameteki,gryffon/ringteki,DukeTax/throne... | server/repositories/gameRepository.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n'use strict';\n\nvar rootIDs = [\n \"React\"\n];\n\nvar debug = {\n rootIDs: rootIDs,\n configFile: \"grunt/config/jsx/debug.json\",\n sourceDir: \"src\",\n outputDir: \"build/modules\"\n};\n\nvar jasmine = {\n rootIDs: [\n \"a... | javascript | edit | 0 | 0 | bsd-3-clause | f7ea031dac8dedddd9525c42a5c27b34c01f616a | gfogle/react,richiethomas/react,claudiopro/react,chacbumbum/react,sugarshin/react,reactjs-vn/reactjs_vndev,orneryhippo/react,dariocravero/react,szhigunov/react,ashwin01/react,TheBlasfem/react,ridixcr/react,TylerBrock/react,benchling/react,dirkliu/react,haoxutong/react,odysseyscience/React-IE-Alt,gfogle/react,trueadm/re... | grunt/config/jsx/jsx.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n'use strict';\n\nvar chai = require('chai'),\n expect = chai.expect,\n sinon = require('sinon'),\n sinonChai = require('sinon-chai'),\n logger = require('../../../logger');\n\nchai.use(sinonChai);\n\ndescribe('logger', funct... | javascript | edit | 0 | 1 | mit | 40743d988e0ab90d9e54f304a65a5f436db13dbd | lxanders/community | server/test/unit/logger/loggerSpec.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n$(document).ready(function() {\n function updateAssessmentFormState() {\n var numberOfQuestions = $('#assessment .legend').length;\n var numberOfCheckedAnswers = $('#assessment input:checked').length;\n var numberOfUnansweredQ... | javascript | edit | 0 | 3 | mit | 2d78ed41e309568eb0307769c58a3bbdad5d75f9 | woople/woople-theme,woople/woople-theme | app/assets/javascripts/assessment_form.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n$(document).ready(function() {\n onCreatedChrome()\n});\n\nfunction onCreatedChrome() {\n chrome.tabs.onCreated.addListener(function(tab) {\n alert(\"hello\");\n });\n}\n\n```\n\nApply this change: Make function to eat bookmarks"
... | javascript | edit | 0 | 1 | mit | 627ea6e7175d3ec1fb89e0c896e123ed8bd3ee2b | tmashuang/BookWorm,tmashuang/BookWorm | bookWorm.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n/**\n * Copyright (c) 2017, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.\n *\n * WSO2 Inc. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance... | javascript | edit | 0 | 1 | apache-2.0 | f98e9ddd8fa02c5d16f7d94c8b811b21e2c39b8f | wso2/carbon-analytics,wso2/carbon-analytics,wso2/carbon-analytics,wso2/carbon-analytics,wso2/carbon-analytics | src/main/resources/web/js/tool-editor/constants.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nvar exec = require('child_process').exec,\n _ = require('lodash')\n\n\nmodule.exports.asyncIterate = function(array, callback, done) {\n function iterate(idx) {\n var current = array[idx]\n\n if (current) {\n ... | javascript | edit | 0 | 4 | mit | d602a2a4c9b2aca9ca330768025fd594ad2f0037 | mnylen/pig,mnylen/pig | lib/helpers.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n/**\n * Creates an instance of `Message`.\n *\n * This class is used as a mock when testing Crane handlers, substituted in\n * place of a `Message` from the underlying message queue adapter.\n *\n * @constructor\n * @api protected\n */\... | javascript | edit | 0 | 2 | mit | c515c365778b609c1e54a24bc670f23d3ef2fac4 | jaredhanson/chai-crane-handler | lib/message.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n(function($) {\n\t$(document).ready(function(){\n\n\t\tshowHideButton();\n\t\t$('.cms-tabset-nav-primary li').on('click', showHideButton);\n\t\t\n\t\tfunction showHideButton() {\n\t\t\tif ($('#Root_Mailblock_set').is(':visible')) {\n\t\... | javascript | edit | 0 | 2 | bsd-3-clause | 5d03539ad1fb34c246b3d7f729256c4370f1ad6d | signify-nz/silverstripe-mailblock,signify-nz/silverstripe-mailblock | javascript/mailblock.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n'use strict';\n\nvar fs = require('fs');\nvar visitors = require('react-tools/vendor/fbtransform/visitors');\nvar jstransform = require('jstransform');\n\nvar visitorList = visitors.getAllVisitors();\n\nvar getJsName = function(filename... | javascript | edit | 0 | 1 | mit | 1dabed199a7087054b64896d523983f1539802af | sloria/react-components,quicktoolbox/react-components,sloria/react-components,redsunsoft/react-components,jepezi/react-components,jepezi/react-components,Khan/react-components,redsunsoft/react-components,jepezi/react-components,vasanthk/react-components,sloria/react-components,vasanthk/react-components,quicktoolbox/rea... | prepublish.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n/* global exports */\n/* global Buffer */\n\"use strict\";\n\n// module Node.Encoding\n\nexports.byteLength = function (str) { \n return function (enc) { \n return Buffer.byteLength(str, enc); \n };\n};\n\n```\n\nApply this change:... | javascript | edit | 0 | 1 | mit | 3e1f0ab719845969ae82f73713374cd15342d51d | purescript-node/purescript-node-buffer | src/Node/Encoding.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n// ==UserScript==\n// @id Modify URL @2ch\n// @name Modify URL @2ch\n// @version 0.0.5\n// @namespace curipha\n// @author curipha\n// @description Modify \"ttp://\" text to anchor and redirec... | javascript | edit | 0 | 3 | unlicense | cb92521b4c237e8a6d7b26f0fe02c26b10187c3a | curipha/userscripts,curipha/userscripts | modifyurl@2ch.user.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nangular.module('listExample.controllers', [])\n\n\n// Controller that fetches a list of data\n.controller('MovieIndexCtrl', function($scope, MovieService) {\n \n // \"MovieService\" is a service returning mock data (services.js)\n //... | javascript | edit | 0 | 1 | mit | fed9ff29a9a2390146666ec19119836fa91cd96a | Jeremy017/ionic,Jeremy017/ionic,lutrosis81/manup-app,gyx8899/ionic,Gregcop1/ionic,blueElix/ionic,Kryz/ionic,ddddm/ionic,yalishizhude/ionic,nelsonsozinho/ionic,cnbin/ionic,chrisbautista/ionic,thebigbrain/ionic,Jandersolutions/ionic,chinakids/ionic,abcd-ca/ionic,brant-hwang/ionic,Urigo/meteor-ionic,Xeeshan94/ionic,janij/... | examples/starters/list/js/controllers.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nvar Hoptoad = require('hoptoad-notifier').Hoptoad\n ,\tenv = require('../environment')\n , shouldReport = env.hoptoad && env.hoptoad.reportErrors;\n\t\n\t\nif(shouldReport)\n\tHoptoad.key = env.hoptoad.apiKey;\n\t\nprocess.addListener... | javascript | edit | 0 | 3 | mit | 768f4bf499d00c6a801b018b6a1c656c5800076c | iFixit/wompt.com,iFixit/wompt.com,Wompt/wompt.com,iFixit/wompt.com,Wompt/wompt.com,Wompt/wompt.com,iFixit/wompt.com | nodejs/lib/hoptoad.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n'use strict';\n\n/**\n * @description Enemy class => objects the player should avoid\n * @constructor\n * @param {number} x position of the enemy on the 'x' axis\n * @param {number} y position of the enemy on the ... | javascript | edit | 0 | 3 | mit | af892e2365daa6b213c89b3bacdfaf4da777d1d6 | zakhttp/super-mario-frogger,zakhttp/super-mario-frogger | src/js/Enemy.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nimport React from 'react';\n\nmodule.exports = React.createClass({\n getInitialState: function getInitialState() {\n return {\n isPlayingStream: typeof window.orientation === 'undefined', // Should return true if not mobile\n ... | javascript | edit | 0 | 2 | mit | d7991bc3af6d3bce7ae1fec107e8497c4b1e25f1 | frequencyasia/website,frequencyasia/website | js/components/player.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nconst utils = require('../../utils')\n\nconst load = (files, jsonFiles, jsonContentsDict, annexed, dir) => {\n let issues = []\n\n // Read JSON file contents and parse for issues\n const readJsonFile = (file, annexed, dir) =>\n ut... | javascript | edit | 0 | 3 | mit | e0860e4491a2519493426cb1cfdbcca8071467e9 | nellh/bids-validator,Squishymedia/bids-validator,Squishymedia/BIDS-Validator,nellh/bids-validator,nellh/bids-validator | validators/json/load.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n\"use strict\";\n\nvar MetafileMatcher = require('./metafile-matcher');\n\n// Not needed in Node 4.0+\nif (!Object.assign) Object.assign = require('object-assign');\n\nclass MetalsmithMetafiles {\n constructor(options) {\n options =... | javascript | edit | 0 | 6 | mit | c140b8c985cfc05ce8ae1326e470d9f4e1231a54 | Ajedi32/metalsmith-metafiles | lib/metalsmith-metafiles.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nimport { moduleFor, test } from 'ember-qunit';\n\nmoduleFor('controller:submit', 'Unit | Controller | submit', {\n // Specify the other units that are required for this test.\n // needs: ['controller:foo']\n needs: [\n 'vali... | javascript | edit | null | null | apache-2.0 | dcbba806e6d933f714fec77c1b37c485a43a9e00 | baylee-d/ember-preprints,caneruguz/ember-preprints,baylee-d/ember-preprints,CenterForOpenScience/ember-preprints,CenterForOpenScience/ember-preprints,laurenrevere/ember-preprints,laurenrevere/ember-preprints,caneruguz/ember-preprints | tests/unit/controllers/submit-test.js | rejected_syntax | Syntax error detected by tree-sitter | false |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n/*\n * This is a template used when TiShadow \"appifying\" a titanium project.\n * See the README.\n */\n\nvar TiShadow = require(\"/api/TiShadow\");\nvar Compression = require('ti.compression');\n\n\n// Need to unpack the bundle on a f... | javascript | edit | 0 | 0 | apache-2.0 | fea368f1da1c6c3a58ad7bbcf6193d56c5592e68 | titanium-forks/dbankier.TiShadow,r8o8s1e0/TiShadow,HazemKhaled/TiShadow,FokkeZB/TiShadow,emilyvon/TiShadow,HazemKhaled/TiShadow,r8o8s1e0/TiShadow,Biotelligent/TiShadow,r8o8s1e0/TiShadow,Biotelligent/TiShadow,HazemKhaled/TiShadow,FokkeZB/TiShadow,emilyvon/TiShadow,emilyvon/TiShadow,titanium-forks/dbankier.TiShadow,titan... | app/Resources/appify.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nvar Turbolinks = require(\"exports?this.Turbolinks!turbolinks\");\n\n/* Disable the Turbolinks page cache to prevent Tlinks from storing versions of\n * pages with `react-id` attributes in them. When popping off the history, the\n * `re... | javascript | edit | 0 | 1 | apache-2.0 | 1623ae966b9823088e65870104d9e37d714b23c0 | ssorallen/turbo-react,ssorallen/turbo-react,ssorallen/turbo-react | src/reactize.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nfunction randomFrom(array) {\n return array[Math.floor(Math.random()*array.length)]\n}\n\nfunction filter_available(item) {\n return !item.unreleased\n}\n\nvar language_map = {\n \"en_US\": \"en\",\n \"fr_FR\": \"fr\",\n \"ja_JP\":... | javascript | edit | 0 | 3 | mit | 754bd76e3f18246b4b3cf161755fb9919571cc19 | DeviPotato/splat2-calc,DeviPotato/splat2-calc | app/util.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nimport React from 'react'\nimport { shallow } from 'enzyme'\nimport { shallowToJson } from 'enzyme-to-json'\nimport Search from './Search'\nimport ShowCard from './ShowCard'\nimport preload from '../public/data.json'\n\ntest('Search sna... | javascript | edit | 0 | 1 | mit | fd20009fcf17de391b398cbb7ce746144fc610c6 | dianafisher/FEM-complete-intro-to-react,dianafisher/FEM-complete-intro-to-react | js/Search.spec.js | rejected_duplicate | Near-duplicate of sample 95604 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nimport Route from '@ember/routing/route';\n\nexport default Route.extend({\n titleToken() {\n return 'Ember CLI';\n }\n});\n\n```\n\nApply this change: Update to return the title Function"
},
{
"role": "assistant",
"con... | javascript | edit | 0 | 1 | mit | 14b04b085f0688c37580b7622ef36b062e4d0bcf | ember-learn/ember-api-docs,ember-learn/ember-api-docs | app/routes/ember-cli.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n/* eslint-env node */\nconst EmberAddon = require('ember-cli/lib/broccoli/ember-addon');\n\nmodule.exports = function(defaults) {\n var app = new EmberAddon(defaults, {\n // Add options here\n });\n\n /*\n This build file speci... | javascript | edit | 0 | 1 | mit | fdcfa64c627f9522db5f176cc103171df839cad1 | scottwernervt/ember-cli-group-by,scottwernervt/ember-cli-group-by | ember-cli-build.js | rejected_duplicate | Near-duplicate of sample 94221 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n;(function(){\n var G = dijkstra.hexGrid(2);\n\n var view = new dijkstra.GraphView(G, document.getElementById('graph'), {\n placement: function(position){ return {\n 'x': 100 * position.x,\n 'y': 100 *... | javascript | edit | 0 | 2 | mit | 0d7cfde7c85bf6c8275b7db45cc2f2faf911fb41 | dvberkel/Dijkstra,dvberkel/Dijkstra | js/application.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n'use strict';\n\nangular.module('<%=angularAppName%>')\n .controller('SettingsController', function ($scope, Principal, Auth) {\n $scope.success = null;\n $scope.error = null;\n Principal.identity().then(function... | javascript | edit | 0 | 2 | apache-2.0 | 62bc1ec26ad607e42a2495257b3e0156830b42dd | vivekmore/generator-jhipster,deepu105/generator-jhipster,dynamicguy/generator-jhipster,mosoft521/generator-jhipster,pascalgrimaud/generator-jhipster,ziogiugno/generator-jhipster,atomfrede/generator-jhipster,siliconharborlabs/generator-jhipster,wmarques/generator-jhipster,duderoot/generator-jhipster,maniacneron/generato... | app/templates/src/main/webapp/scripts/app/account/settings/_settings.controller.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n/*\nLoad a block from github.io.\nAccepts a url as a parameter which can include url parameters e.g. https://megjlow.github.io/extension2.js?name=SUN&ip=10.0.0.1\n*/\n\nnew (function() {\n\tvar ext = this;\n\t\n\tvar descriptor = {\n ... | javascript | edit | 0 | 4 | mit | 6ce99ce4acbed8c57b672706c4b26dfc063bb04b | megjlow/megjlow.github.io | extensionloader.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nimport React, { useState, useCallback, useRef } from 'react';\n\n/**\n * Hook which manages popover position over a DOM element.\n * Pass a ref created by React.createRef. Receive callbacks,\n */\nexport const usePopover = () => {\n co... | javascript | edit | 0 | 1 | mit | 275dc5b09b27d5441814aa423cddaa7472344dbf | sussol/mobile,sussol/mobile,sussol/mobile,sussol/mobile | src/hooks/usePopover.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nimport FroalaEditorComponent from 'ember-froala-editor/components/froala-editor';\n\nexport default FroalaEditorComponent.extend({\n // eslint-disable-next-line ember/avoid-leaking-state-in-ember-objects\n options: {\n key: 'Tvywse... | javascript | edit | 0 | 0 | mit | c8e2d1ac9ed72967aa8f8210f8c05f2af8044cab | froala/ember-froala-editor,froala/ember-froala-editor,Panman8201/ember-froala-editor,Panman8201/ember-froala-editor | tests/dummy/app/components/froala-editor.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\ngoog.provide('gmf.proj.EPSG21781');\n\ngoog.require('ol.proj');\n\nif (typeof proj4 == 'function') {\n proj4.defs('EPSG:21781',\n '+proj=somerc +lat_0=46.95240555555556 +lon_0=7.439583333333333 ' +\n '+k_0=1 +x_0=600000 +y_0=... | javascript | edit | 0 | 0 | mit | 8ddadad76536c0445c1da4cd203646509dc30cfd | Jenselme/ngeo,kalbermattenm/ngeo,ger-benjamin/ngeo,pgiraud/ngeo,camptocamp/ngeo,ger-benjamin/ngeo,pgiraud/ngeo,Jenselme/ngeo,ger-benjamin/ngeo,Jenselme/ngeo,camptocamp/ngeo,adube/ngeo,camptocamp/ngeo,adube/ngeo,camptocamp/ngeo,adube/ngeo,kalbermattenm/ngeo,kalbermattenm/ngeo,adube/ngeo,camptocamp/ngeo,Jenselme/ngeo,pgi... | contribs/gmf/src/proj/epsg21781projection.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nvar Context = process.binding('evals').Context,\n // TODO: Remove .Script when bumping req'd node version to >= 5.0\n Script = process.binding('evals').NodeScript || process.binding('evals').Script;\n\nexports.javascript = functio... | javascript | edit | 0 | 4 | mit | 0087fa9db21bf615d3c57480c89a706c8d8e75bf | iizukanao/jsdom,aduyng/jsdom,jeffcarp/jsdom,jeffcarp/jsdom,tmpvar/jsdom,Zirro/jsdom,evdevgit/jsdom,susaing/jsdom,sebmck/jsdom,Zirro/jsdom,Ye-Yong-Chi/jsdom,mbostock/jsdom,zaucy/jsdom,beni55/jsdom,kesla/jsdom,darobin/jsdom,cpojer/jsdom,mbostock/jsdom,Sebmaster/jsdom,snuggs/jsdom,AshCoolman/jsdom,szarouski/jsdom,janusnic... | lib/jsdom/level2/languages/javascript.js | rejected_duplicate | Near-duplicate of sample 67739 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nangular.module('app').directive(\"validateBitcoinAddress\", function() {\n return {\n require: 'ngModel',\n link: function(scope, ele, attrs, ctrl) {\n\n ctrl.$parsers.unshift(function(value) {\n\n ... | javascript | edit | 0 | 2 | mit | 6e853e6d2eba890ddff29b71a21130e145c747fb | atsuyim/OpenBazaar,must-/OpenBazaar,must-/OpenBazaar,saltduck/OpenBazaar,NolanZhao/OpenBazaar,NolanZhao/OpenBazaar,tortxof/OpenBazaar,tortxof/OpenBazaar,must-/OpenBazaar,blakejakopovic/OpenBazaar,habibmasuro/OpenBazaar,bankonme/OpenBazaar,blakejakopovic/OpenBazaar,rllola/OpenBazaar,rllola/OpenBazaar,mirrax/OpenBazaar,b... | html/directives/validateBitcoinAddress.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n// Patch DNS.lookup to resolve all hosts added via Replay.localhost as 127.0.0.1\n\nconst DNS = require('dns');\nconst Replay = require('./');\n\n\nconst originalLookup = DNS.lookup;\nDNS.lookup = function(domain, options, callback) ... | javascript | edit | 0 | 7 | mit | 5b0082d9aaa6ae25e2ed7a0049b1829b3a9aa242 | assaf/node-replay | src/patch_dns_lookup.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nimport Ember from 'ember';\n\nexport default Ember.Component.extend({\n classNames: ['popover-confirm'],\n\n iconClass: function () {\n var filename = this.get('filename'),\n regex, extension;\n\n if (file... | javascript | edit | 0 | 4 | mit | 733b66e5733800e4abc8dbcf358b3af20e424313 | cowbell/sharedrop,umeshjakhar/sharedrop,cowbell/sharedrop,rogervaas/sharedrop,umeshjakhar/sharedrop,rogervaas/sharedrop | app/components/popover-confirm.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n'use strict';\n\nconst EventEmitter = require('events');\n\n/**\n * Tracker Manager\n * @interface\n */\nclass ITrackerManager extends EventEmitter {\n\tconstructor() {\n\t\tsuper();\n\n\t\tif (this.constructor === ITrackerManager) {\n\... | javascript | edit | 0 | 2 | mit | 5a14bf458e67d893cefe99e7515fdb3b904ab556 | reeFridge/tracker-proxy | src/interfaces/i-tracker-manager.js | rejected_duplicate | Near-duplicate of sample 78759 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n\"use strict\";\n\nlet replyCount = 21;\nlet message = `This topic has a total of replies`;\n```\n\nApply this change: Complete the code to use the variable replyCount from inside the template string"
},
{
"role": "assistant",
... | javascript | edit | 0 | 0 | mit | 246825583b1c778e56bad458f3e4283c9b1c5df6 | var-bin/reactjs-training,var-bin/reactjs-training,var-bin/reactjs-training | es2015/total-replies.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nimport Ember from 'ember';\nimport Polling from 'travis/mixins/polling';\nimport { colorForState } from 'travis/utils/helpers';\n\nexport default Ember.Component.extend(Polling, {\n routing: Ember.inject.service('-routing'),\n tagName... | javascript | edit | 0 | 2 | mit | c118153f2f48a271cb8d4859e5c65e22cd59ee5f | fauxton/travis-web,fotinakis/travis-web,travis-ci/travis-web,travis-ci/travis-web,travis-ci/travis-web,travis-ci/travis-web,fotinakis/travis-web,fauxton/travis-web,fauxton/travis-web,fauxton/travis-web,fotinakis/travis-web,fotinakis/travis-web | app/components/repos-list-item.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n// Copyright 2016 The Closure Rules Authors. All rights reserved.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy o... | javascript | edit | 0 | 1 | apache-2.0 | 46f8795db8215e2a470b54cfe1e94ebb1888460e | jart/rules_closure,jart/rules_closure,jart/rules_closure,gramic/rules_closure,gramic/rules_closure,bazelbuild/rules_closure,gramic/rules_closure,gramic/rules_closure,jart/rules_closure,jart/rules_closure,bazelbuild/rules_closure,bazelbuild/rules_closure,bazelbuild/rules_closure | closure/testing/test/arithmetic_es6module_test.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nimport React from 'react';\n\nfunction Browser() {\n return (\n <div className=\"c-browser\">\n <h3>Browser not supported</h3>\n <p>The browser you are using is out-of-date and not supported by our site.</p>\n\n <h4>F... | javascript | edit | 0 | 1 | mit | 8920390d8a84fdaf0d887a7fccd023ce0855e4bb | resource-watch/resource-watch,resource-watch/resource-watch,resource-watch/resource-watch,resource-watch/resource-watch | components/app/common/Browser.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nexport default class Middleware {\n\n /**\n * Constructor\n */\n constructor(key, value) {\n key = key.toLowerCase();\n\n // In case of simple middleware\n if (key == \"middleware\") {\n return this.simpleMiddleware(va... | javascript | edit | 0 | 3 | mit | 48e5053047d6b48c40a55a69b9f945658b4ef438 | ArthurMialon/StarterApiNodejs | lib/Middleware.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nexport class Basefield {\n id = '';\n label = '';\n columns = 8;\n index = undefined;\n parent = undefined;\n\n init(id = '', {label = '', columns = 8, parent, index} = {}) {\n this.id = id;\n this.label = label;\n this.c... | javascript | edit | 0 | 3 | mit | ab7e76c25376e82ca3559b6a088ea213ae227a6e | apinf/openapi-designer,apinf/open-api-designer,apinf/open-api-designer,apinf/openapi-designer | src/resources/basefield.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n/*\n * grunt-appium\n * https://github.com/hungrydavid/grunt-appium\n *\n * Copyright (c) 2015 David Adams\n * Licensed under the MIT license.\n */\n\n'use strict';\n\nmodule.exports = function(grunt) {\n\n // Please see the Grunt docu... | javascript | edit | 0 | 1 | mit | 8aa9ed0a01065affb26bd069fc4afbdcfd9a7cf3 | hungrydavid/grunt-appium | tasks/appium.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n'use strict';\n\nvar fs = require('fs');\nvar cp = require('child_process');\nvar assert = require('assert');\n\nvar partialDependencies = {\n \"concat-stream\": \"^1.4.7\",\n \"os-shim\": \"^0.1.2\"\n};\nvar fullDependencies = {\n \... | javascript | edit | 0 | 2 | mit | 308f844589596950fc43b2699bdd33d79f67bcb4 | ForbesLindesay/spawn-sync,terabyte/spawn-sync,bcoe/spawn-sync,tmagiera/spawn-sync | postinstall.js | rejected_duplicate | Near-duplicate of sample 94090 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nimport { TagRels } from './collection.js';\nimport { ensureIndex } from '../../collectionUtils';\n\nTagRels.addView('postsWithTag', terms => {\n return {\n selector: {\n tagId: terms.tagId,\n baseScore: {$gt: 0},\n },\n... | javascript | edit | 0 | 1 | mit | d90c82cea8abeace95e5b97cc0e51debe0b63225 | Discordius/Telescope,Discordius/Lesswrong2,Discordius/Lesswrong2,Discordius/Telescope,Discordius/Telescope,Discordius/Lesswrong2,Discordius/Telescope,Discordius/Lesswrong2 | packages/lesswrong/lib/collections/tagRels/views.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nimport { handleSuccess, handleFailure } from './assert-promise';\n\nfunction applyData(object, data) {\n return new Ember.RSVP.Promise(function(resolve, reject) {\n if (typeof data === 'function') {\n var newObject = data.call(... | javascript | edit | 0 | 16 | mit | 204c213882920d4666fb962d8c3bb39ce2fcf988 | runtrizapps/ember-testing-grate | lib/apply-data.js | rejected_complexity | Cyclomatic complexity too high: 16 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nangular.module('MainApp')\n .directive('uaf', () => { // uaf = Update after find\n return (scope, el, attrs) => {\n scope.$watch('tasks', (newVal) => {\n el[0].children[0].children[0].innerHTML = newVal[attrs.uaf];\n ... | javascript | edit | 0 | 1 | mit | 8dcb43a4272563971cd22f32106731519451f83a | mkermani144/wanna,mkermani144/wanna | desktop/app/components/tasks/directive.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nimport axios from 'axios';\n\nfunction getUsers() {\n return axios({\n url: '/api/users',\n timeout: 20000,\n method: 'get',\n responseType: 'json'\n })\n .then(function (res) {\n retu... | javascript | edit | 0 | 1 | mit | c32995e50fc10e50e6808d5f5df51dd203c8a613 | Keitarokido/tiles,Keitarokido/tiles | src/utils/getUsers.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nimport { screen } from 'electron';\n\n/**\n * Create main window's settings.\n * @param {Object} rawopts - Configuration options for main window.\n * @return {Object} The main window configuration.\n */\nfunction mainWindow(rawopts) {\n... | javascript | edit | 0 | 1 | mit | df3fd41acf43fe5b0401ecb60ae090541c575d59 | JamenMarz/cluster,JamenMarz/vint | lib/mainWindow.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nimport check from './support/check';\n\ndescribe('of operator', () => {\n it('turns into an `in` operator', () => {\n check(`\n a of b\n `, `\n a in b;\n `);\n });\n\n it('works in an expression context', () => {\n... | javascript | edit | 0 | 1 | mit | 8941d15ae95988becf61ba2d05a4eca140dd2486 | eventualbuddha/decaffeinate,alangpierce/decaffeinate,decaffeinate/decaffeinate,alangpierce/decaffeinate,eventualbuddha/decaffeinate,decaffeinate/decaffeinate,alangpierce/decaffeinate | test/of_test.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nvar fs = require('fs');\n\nvar cronJob = require('cron').CronJob;\n\nvar config = require('./config');\nvar data = require('./data');\n\n\nfunction init() {\n writeJSON();\n}\nmodule.exports = init;\n\nfunction writeJSON() {\n wri... | javascript | edit | 0 | 2 | mit | ebf95a31b0ba193817a28ec16468ef7809ec6953 | cdnperf/cdnperf,bebraw/cdnperf,bebraw/cdnperf,cdnperf/cdnperf | cronjobs.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nconst db = require('../db.js');\n\nmodule.exports = (self, offSet) => {\n const queryStr = `SELECT teach.teach_id FROM (\n (\n SELECT users_languages_levels.user AS teach_id FROM users_langua... | javascript | edit | 0 | 1 | mit | 5016ab3b206d1a53fce943d07b0402df7a145aed | VictoriousResistance/iDioma,VictoriousResistance/iDioma | server/db/controllers/getMatchesGivenSelfAndOffset.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n// Harmless Ransom Note\n\n/* Rules:\n Takes two parameters\n First will be the note we want to write as a string.\n The second will be the magazine text we have available to make the note out of as a string\n The purpose of the... | javascript | edit | 0 | 1 | mit | 217c40ac2ca61f4a14f41a1a5b3d4f7983910b46 | benjaminhyw/javascript_algorithms | harmless-ransom-note.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n/**\n * Different datasets the tool can use\n *\n * The first-level keys are country names, in English,\n * as they will appear in the app\n *\n * The second level names are database identifiers.\n * These ids are used in the url, so sh... | javascript | edit | 0 | 0 | bsd-3-clause | 0e34b6069f2f4e70620eeb40fa44f19e1a93f5e0 | POI-Importer/POI-Importer.github.io,POI-Importer/POI-Importer.github.io | datasets.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n/*\n * grunt-load-options\n * https://github.com/chriszarate/grunt-load-options\n *\n * Copyright (c) 2013 Chris Zarate\n * Licensed under the MIT license.\n */\n\n'use strict';\n\nvar requireDirectory = require('require-directory');\n\... | javascript | edit | 0 | 2 | mit | 050a474b6f5e000584bf5a1a8f41e3d9750faf3d | chriszarate/grunt-load-options | tasks/load-options.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\njsio('from shared.javascript import Class, bind')\njsio('import ui.Component')\n\nexports = Class(ui.Component, function(supr){\n\t\n\tthis._domTag = 'span'\n\tthis._className = 'Value'\n\t\n\tthis.init = function(jsArgs, viewArgs) {\n\... | javascript | edit | 0 | 3 | mit | 422c9f3f7f937e06179c9aedabda1bedb61a1e2c | marcuswestin/Focus | js/views/Value.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nmodule.exports = (function(){\n\treturn function unixToDate(unixTime) {\n\t\tconsole.log(unixTime)\n\t\tvar date = new Date(Number(unixTime));\n\t\tvar year = date.getFullYear();\n\t\tvar month;\n\t\tvar day;\n\n\t\tif (date.getMonth().... | javascript | edit | 0 | 2 | mit | 765578bfcb878b4fc7668b08ce2fe6fb12721592 | capsul/capsul-api | helpers/unixToDate.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nimport React from \"react\";\nimport { graphql, Link } from \"gatsby\";\n\nimport Layout from \"../app/layout\";\n\nimport \"./blog-post.scss\";\n\nexport const BLOG_POST_QUERY = graphql`\n query BlogPostTemplate($slug: String!) {\n ... | javascript | edit | 0 | 1 | mit | 3a4bba37b5f2e46fc8484a9ad1a5142bf9adc183 | yanglinz/personal-site,yanglinz/personal-site | src/templates/blog-post.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n// Lazy-loaded modules are assumed on the hosting domain,\n// so we override the constant at runtime.\n// __webpack_public_path__ = process.env.NODE_ENV === \"production\"\n// ? \"https://example.com\"\n// : \"http://localhost:3000\... | javascript | edit | 0 | 5 | mit | 4c869f1077036ededd6c755a600b9200997f56bb | ericclemmons/performant-3rd-party-widgets,ericclemmons/performant-3rd-party-widgets | src/widgets/index.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n'use strict';\n\nexport default class metaDataService {\n constructor() {\n this.pageTitle = '';\n }\n\n getPageTitle() {\n return this.pageTitle;\n }\n\n setPageTitle(newTitle) {\n this.pageTitle = n... | javascript | edit | 0 | 1 | mit | 3fc6e2976b46dfaa6dc6768884f8c7a959c12996 | flareair/board_of_shame,flareair/board_of_shame,flareair/board_of_shame | client/shared/services/metaDataService.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n'use strict';\n\nvar _ = require('lodash');\nvar fs = require('fs');\nvar hljs = require('../../build');\nvar jsdom = require('jsdom').jsdom;\nvar utility = require('../utility');\n\ndescribe('special cases tests', funct... | javascript | edit | 0 | 1 | bsd-3-clause | 277eeede63ec0ec591eaa934c2ace2df13592e77 | aurusov/highlight.js,teambition/highlight.js,Sannis/highlight.js,MakeNowJust/highlight.js,carlokok/highlight.js,bluepichu/highlight.js,StanislawSwierc/highlight.js,carlokok/highlight.js,palmin/highlight.js,teambition/highlight.js,carlokok/highlight.js,isagalaev/highlight.js,dbkaplun/highlight.js,tenbits/highlight.js,hi... | test/special/index.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n\"use strict\";\n\nconst Renderable = require('./renderable');\n\nclass Collection extends Renderable {}\n\nCollection.Instance = require('./collectionInstance');\n/*\nconst Registry = require('../../../util/registry');\n\nclass Collect... | javascript | edit | 0 | 0 | mit | f506d6f9e71821fe808d2b77d2b5c886591383ed | coreyp1/defiant,coreyp1/defiant | lib/plugin/theme/renderable/collection.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nvar Q = require('q');\nvar _ = require('lodash');\nvar spawn = require('child_process').spawn;\n\nmodule.exports = function(args, options) {\n var deferred = Q.defer();\n\n options = options || {};\n\n var defaults = {\n ... | javascript | edit | 0 | 2 | mit | 3f1d2eec28ec703569637e1d148fb7b668ee1e41 | crowdtap/parachute | lib/git-wrapper.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nvar GithubApi = require('github'),\n config = require('../config'),\n Promise = require('promise'),\n github = new GithubApi({\n debug: config.debug,\n version: '3.0.0'\n });\n\ngithub.authenticate({\n type: 'oau... | javascript | edit | 0 | 1 | mit | eba98196b93eaba09ba8d64a6a7e70ab832ded1c | iFixit/pulldasher,iFixit/pulldasher,iFixit/pulldasher,iFixit/pulldasher | lib/git-manager.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n/*\n\tMiscellaneous commands\n*/\n\nSettings.addPermissions(['pick', 'randomanswer']);\n\nexports.commands = {\n\tchoose: 'pick',\n\tpick: function (arg, by, room, cmd) {\n\t\tvar choices = arg.split(\",\");\n\t\tchoices = choices.filte... | javascript | edit | 0 | 4 | mit | eeb287f6029c7116b81ac81af76e055b2e3efa85 | ateck5/le_spatula,sama2/Pokemon-Showdown-Node-Bot,awolffromspace/PC-Battle-Server-Bot,TheFenderStory/Mambot,Ecuacion/Espaol-Bot,abulechu/Pokemon-Showdown-Node-Bot,Robophill/Pokemon-Showdown-Node-Bot,Flareninja/Pokemon-Showdown-Node-Bot,Ecuacion/Pokemon-Showdown-Node-Bot,TheFenderStory/Pokemon-Showdown-Node-Bot,Freigeis... | commands/misc.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nvar root = null;\n\nif (typeof window === 'undefined') {\n root = global;\n root.tryc = require('../../');\n} else {\n root = window;\n root.tryc = require('tryc');\n root.__karma__.start = function() {\n root.__karma__.info({ t... | javascript | edit | 0 | 3 | mit | 97f6eb7ce14fe5baa6533216fa04717e69e7f44b | vesln/tryc | test/support/index.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\nconst gulp = require('gulp');\nconst sweetjs = require(\"gulp-sweetjs\");\nconst sourcemaps = require('gulp-sourcemaps');\nconst concat = require('gulp-concat-util');\n\n// Macro packages.\nconst match = \"sparkler/macros\";\nconst lamb... | javascript | edit | 0 | 1 | isc | ff4845f9cd7591fafffe0316b4c80948fbe80008 | hagb4rd/tennu,LordWingZero/tennu,Tennu/tennu | gulpfile.js | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```javascript\n'use strict';\n\nvar bluebird = require('bluebird');\nvar fs = bluebird.promisifyAll(require('fs'));\nvar hljs = require('../../build');\nvar path = require('path');\nvar utility = require('../utility');\n\nfunction testA... | javascript | edit | 0 | 1 | bsd-3-clause | 5116c1dd1c7a9e993d0c4b86a67d58520386fb56 | bluepichu/highlight.js,bluepichu/highlight.js,MakeNowJust/highlight.js,isagalaev/highlight.js,highlightjs/highlight.js,highlightjs/highlight.js,teambition/highlight.js,Sannis/highlight.js,carlokok/highlight.js,MakeNowJust/highlight.js,palmin/highlight.js,sourrust/highlight.js,bluepichu/highlight.js,StanislawSwierc/high... | test/detect/index.js | accepted | null | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.