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```python\nfrom flask import Flask, render_template\nfrom flask_nav import Nav\nfrom flask_nav.elements import *\n\nnav = Nav()\n\n\nclass UserGreeting(Text):\n def __init__(self):\n pass\n\n @property\n def text(self):\n return...
python
edit
12
1
mit
57a5042b8a01c16937206678924f6fe9c5273cc9
mbr/flask-nav,mbr/flask-nav
example/__init__.py
rejected_lint
Too many lint violations: 12
true
[ { "role": "user", "content": "Here is the current file:\n```python\nimport s7\n\nclass Alarm:\n ALARM_DB = 12\n\n def __init__(self, s7conn):\n self._s7conn = s7conn\n\n def arm(self):\n # Toggle bit\n self._s7con.writeBit(self.ALARM_DB, 0, 1, 1)\n self._s7con.writeBit(s...
python
edit
3
1
bsd-2-clause
e103f3bcb4e6488295503dea2f788b98c4b7d43e
kprovost/domotica,kprovost/domotica
domotica/alarm.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nfrom astral.api.handlers.base import BaseHandler\nfrom astral.conf import settings\n\nimport logging\nlog = logging.getLogger(__name__)\n\n\nclass PingHandler(BaseHandler):\n def get(self):\n \"\"\"If 'bytes' is specified in the q...
python
edit
1
2
mit
abea380145ca0d2ebc1b68876b9cde0322be4db5
peplin/astral
astral/api/handlers/ping.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nfrom gogoutils.parser import Parser\n\n\ndef test_parser_url():\n \"\"\"Test parsing of url\"\"\"\n\n urls = [\n 'http://github.com/gogoair/test',\n 'https://github.com/gogoair/test',\n 'http://github.com/gogoair/...
python
edit
1
2
apache-2.0
644252445b6c9b2729e73f97ba20e96dcfadb73b
gogoair/gogo-utils
tests/test_parser.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nfrom builtins import range\nimport sys\nsys.path.insert(1,\"../../../\")\nimport h2o\nfrom tests import pyunit_utils\n##\n# Test out the cor() functionality\n# If NAs in the frame, they are skipped in calculation unless na.rm = F\n# If any ...
python
edit
5
1
apache-2.0
e45f777f74cf8dc48c48732269be4c37c8966c76
mathemage/h2o-3,h2oai/h2o-3,h2oai/h2o-dev,jangorecki/h2o-3,h2oai/h2o-dev,jangorecki/h2o-3,mathemage/h2o-3,h2oai/h2o-3,spennihana/h2o-3,jangorecki/h2o-3,spennihana/h2o-3,michalkurka/h2o-3,spennihana/h2o-3,spennihana/h2o-3,spennihana/h2o-3,jangorecki/h2o-3,h2oai/h2o-3,h2oai/h2o-dev,h2oai/h2o-3,michalkurka/h2o-3,michalkur...
h2o-py/tests/testdir_munging/unop/pyunit_cor.py
rejected_lint
Too many lint violations: 5
true
[ { "role": "user", "content": "Here is the current file:\n```python\nfrom twisted.trial.unittest import TestCase\nfrom twisted.internet import defer\n\nimport os\n\nfrom norm.porcelain import makePool\n\n\n\npostgres_url = os.environ.get('NORM_POSTGRESQL_URI', None)\nskip_postgres = ('You must define NORM_PO...
python
edit
1
1
mit
5a88126b53bbd47a4c8899b50bdbf0d913183bd5
iffy/norm,iffy/norm
norm/test/test_porcelain.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\n# TODO: Test robustness, test speed\nimport unittest, time, sys, argparse, threading\nsys.path.append('./test/ipc')\nfrom common_conf import *\nfrom test_dev_server import TestDevServer\nfrom test_client import TestUE4CVClient\n\nif __name_...
python
edit
5
1
mit
b65c95ca400f91648a53553f51979f5ceb7a0d94
unrealcv/unrealcv,qiuwch/unrealcv,qiuwch/unrealcv,qiuwch/unrealcv,qiuwch/unrealcv,unrealcv/unrealcv,qiuwch/unrealcv,unrealcv/unrealcv,qiuwch/unrealcv,unrealcv/unrealcv,unrealcv/unrealcv
test/test-unrealcv.py
rejected_lint
Too many lint violations: 5
true
[ { "role": "user", "content": "Here is the current file:\n```python\nfrom __future__ import division\nfrom __future__ import unicode_literals\nfrom __future__ import print_function\nfrom __future__ import absolute_import\nfrom builtins import super\nfrom builtins import range\nfrom future import standard_lib...
python
edit
6
3
mit
96dc9e590b81926fddb83a85a1352039c10c1509
toslunar/chainerrl,toslunar/chainerrl
links/mlp.py
rejected_lint
Too many lint violations: 6
true
[ { "role": "user", "content": "Here is the current file:\n```python\nfrom django.conf import settings\n\n\nAWS_ACCESS_KEY_ID = getattr(settings, 'AWS_ACCESS_KEY_ID')\nAWS_SECRET_ACCESS_KEY = getattr(settings, 'AWS_SECRET_ACCESS_KEY')\nAWS_STATIC_BUCKET_NAME = getattr(settings, 'AWS_STATIC_BUCKET_NAME')\n\nAW...
python
edit
1
0
bsd-3-clause
7d7043560f26c31346472b6452e8b191729c54a3
mirumee/django-offsite-storage
offsite_storage/settings.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nfrom __future__ import absolute_import, unicode_literals\n\nimport textwrap\n\n\ntry:\n import gi\n gi.require_version('Gst', '1.0')\n gi.require_version('GstPbutils', '1.0')\n from gi.repository import GLib, GObject, Gst, GstPb...
python
edit
1
0
apache-2.0
1daf5825580d31e3f2825b5b5edfaa2aed8146fe
kingosticks/mopidy,jodal/mopidy,mokieyue/mopidy,tkem/mopidy,kingosticks/mopidy,tkem/mopidy,mokieyue/mopidy,adamcik/mopidy,adamcik/mopidy,jodal/mopidy,mopidy/mopidy,vrs01/mopidy,ZenithDK/mopidy,ZenithDK/mopidy,tkem/mopidy,jodal/mopidy,jcass77/mopidy,mopidy/mopidy,adamcik/mopidy,tkem/mopidy,mokieyue/mopidy,jcass77/mopidy...
mopidy/internal/gi.py
rejected_duplicate
Near-duplicate of sample 13726
true
[ { "role": "user", "content": "Here is the current file:\n```python\n#!/usr/bin/env python2\n\n'''Resize images using the FFT\n\nFFTresize resizes images using zero-padding in the frequency domain.\n'''\n\n\nfrom fftinterp import interp2\nimport imutils\nfrom numpy import zeros as _zeros\n\n\n__author__ = 'M...
python
edit
1
4
isc
5b18bcfa03876dbfda75b14bf8239f01c1f70ec2
eliteraspberries/fftresize
fftresize/fftresize.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\n\"\"\"Entry point for all things Klaxer\"\"\"\n\n__author__ = 'Aru Sahni, Kevin Dwyer, Justin Shelton, Dylan Bernard, Will Schneider, et al'\n__version__ = '0.0.1'\n__license__ = 'MIT'\n\nAPP_NAME = 'Klaxer'\n\n```\n\nApply this change: Adj...
python
edit
1
0
mit
77c245240fcccf1c7c6f3251168801de45182b8d
klaxer/klaxer
klaxer/__init__.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nimport typing as tp\nimport builtins as py\nfrom .optional import Optional, optional\n\nK = tp.TypeVar('K')\nV = tp.TypeVar('V')\n\n\nclass Dictionary(tp.Generic[K, V], tp.Iterable[tp.Tuple[K, V]]):\n def __init__(self, entries: tp.Dict[...
python
edit
1
2
mit
26250bf43e659c03576a4d7e4d986b622a18bb48
koher/swifpy
swifpy/dictionary.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\n# Licensed under an MIT open source license - see LICENSE\n\n__version__ = \"1.2.2\"\n\nfrom .analysis import Analysis\nfrom .filfind_class import fil_finder_2D\nfrom .width_profiles import filament_profile\n\n```\n\nApply this change: Reve...
python
edit
4
0
mit
8d0325e28a1836a8afdfc33916d36a3e259ad131
e-koch/FilFinder
fil_finder/__init__.py
rejected_lint
Too many lint violations: 4
true
[ { "role": "user", "content": "Here is the current file:\n```python\n#!/usr/bin/env python\n# coding: utf-8\nimport sys\nfrom argparse import ArgumentParser\nfrom os.path import abspath\nfrom os.path import dirname\n\n# Modify the path so that our djoauth2 app is in it.\nparent_dir = dirname(abspath(__file__...
python
edit
3
2
mit
feddcfd9153da81777c25571f35ee3c97e655c64
vden/djoauth2-ng,Locu/djoauth2,seler/djoauth2,vden/djoauth2-ng,seler/djoauth2,Locu/djoauth2
generate_migrations.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nfrom django.http import HttpResponseRedirect\nfrom django.shortcuts import render_to_response\nfrom django.template import RequestContext\nfrom django.contrib.contenttypes.models import ContentType\n\n\nfrom geotagging.models import Point\n...
python
edit
1
4
bsd-3-clause
88647bd762da9619c066c9bd79e48cb234247707
uclastudentmedia/django-geotagging,uclastudentmedia/django-geotagging,uclastudentmedia/django-geotagging
geotagging/views.py
rejected_duplicate
Near-duplicate of sample 4425
true
[ { "role": "user", "content": "Here is the current file:\n```python\nfrom django.core.urlresolvers import reverse\nfrom django.db import models\nfrom django.utils import timezone\n\nfrom core.models import AuthorModel, ImageModel\n\nfrom .managers import PostManager, ImageManager\nimport util\n\n\nSTATUS_CHO...
python
edit
3
2
apache-2.0
84816dda37d071e521f65449ee59c992b5e302bc
megaprojectske/megaprojects.co.ke,megaprojectske/megaprojects.co.ke,megaprojectske/megaprojects.co.ke
megaprojects/blog/models.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nfrom .download import download\nfrom .info import info\nfrom .link import link\nfrom .package import package\nfrom .train import train, train_config\nfrom .model import model\nfrom .convert import convert\n\n```\n\nApply this change: Remove...
python
edit
9
0
mit
baf3ef0ddcb7b59973750443f4c0a3732dd0f12a
spacy-io/spaCy,explosion/spaCy,aikramer2/spaCy,explosion/spaCy,recognai/spaCy,explosion/spaCy,explosion/spaCy,recognai/spaCy,aikramer2/spaCy,aikramer2/spaCy,honnibal/spaCy,spacy-io/spaCy,recognai/spaCy,honnibal/spaCy,explosion/spaCy,honnibal/spaCy,explosion/spaCy,aikramer2/spaCy,recognai/spaCy,aikramer2/spaCy,recognai/...
spacy/cli/__init__.py
rejected_lint
Too many lint violations: 9
true
[ { "role": "user", "content": "Here is the current file:\n```python\n\"\"\"All routes regarding authentication.\"\"\"\n\nfrom datetime import datetime\nfrom sqlalchemy import or_\nfrom webargs.flaskparser import use_args\n\nfrom server import user_bp\nfrom server.extensions import db\nfrom server.models impo...
python
edit
1
4
mit
c485ac39ede0bfbcc6b68fd10ed35ff692124c6d
Nukesor/spacesurvival,Nukesor/spacesurvival,Nukesor/spacesurvival,Nukesor/spacesurvival
server/api/auth.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nfrom createCollection import createCollection\nfrom ObjectFactories.ItemFactory import ItemFactory\nfrom DataObjects.Collection import Collection\nimport datetime, json, os.path, argparse\n\nCONST_COLLECTIONS_NAME = 'collections'\n\ndef gen...
python
edit
3
2
apache-2.0
cf77d5b49416c33b05955a66450adda289a342d0
AmosGarner/PyInventory
main.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nfrom distutils.version import StrictVersion\r\nimport django\r\nif StrictVersion(django.get_version()) >= StrictVersion('1.6'):\r\n from django.conf.urls import patterns, url, include\r\nelse:\r\n from django.conf.urls.defaults import *...
python
edit
2
0
mit
3350460fdb4f0360b9251f30340ed9d1b6f97839
trevoriancox/django-shibboleth-remoteuser,CloudComputingCourse/django-shibboleth-remoteuser,KonstantinSchubert/django-shibboleth-adapter,ties/django-shibboleth-remoteuser,denisvlr/django-shibboleth-remoteuser,ties/django-shibboleth-remoteuser,uchicago-library/django-shibboleth-remoteuser,trevoriancox/django-shibboleth-...
shibboleth/urls.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nimport uuid\n\nfrom gittip.orm import db\nfrom gittip.models.participant import Participant\n\n\nclass User(Participant):\n \"\"\"Represent a website user.\n\n Every current website user is also a participant, though if the user is\n ...
python
edit
1
3
cc0-1.0
f4eac1d029b79c5dc5a6a07e696f9ea4c341342f
bountysource/www.gittip.com,mccolgst/www.gittip.com,eXcomm/gratipay.com,gratipay/gratipay.com,eXcomm/gratipay.com,studio666/gratipay.com,bountysource/www.gittip.com,mccolgst/www.gittip.com,mccolgst/www.gittip.com,bountysource/www.gittip.com,mccolgst/www.gittip.com,gratipay/gratipay.com,eXcomm/gratipay.com,gratipay/grat...
gittip/models/user.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nfrom django.db import models\n\nfrom .compat import User\n\n\nclass Switch(models.Model):\n\n label = models.CharField(max_length=200)\n description = models.TextField(\n help_text='Short description of what this switch is doin...
python
edit
1
1
bsd-2-clause
6eaa58149bae1c5462fc79255656321145a4b45f
potatolondon/django-hashbrown
hashbrown/models.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nimport sys\nimport os\nfrom subprocess import check_call\nfrom pew._utils import invoke_pew as invoke\nfrom utils import skip_windows, connection_required\nimport pytest\n\ndef skip_marker(f):\n return skip_windows(reason='Pythonz unavai...
python
edit
1
1
mit
c600d1e1ad3cef69f6028afd64e14a04c747e1c6
berdario/pew,berdario/pew
tests/test_install.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nimport discord\n\nrolesTriggerString = '!role'\n\nasync def parse_roles_command(message, client):\n msg = 'Role!'\n await client.send_message(message.channel, msg)\n\n```\n\nApply this change: Modify to use shlex for getting command a...
python
edit
null
null
mit
2f2f18abbcde94e61c38a519b3b8d959be2e0301
suclearnub/scubot
modules/roles.py
rejected_syntax
Syntax error detected by tree-sitter
false
[ { "role": "user", "content": "Here is the current file:\n```python\n#!/usr/bin/env python\n\nimport json\nimport sys\nimport csv\nfrom pymongo import MongoClient\n\nif len(sys.argv) < 2:\n print 'usage: python read.py filepath'\n sys.exit(1)\n\nreader = csv.DictReader(open(sys.argv[1]), delimiter=',', quo...
python
edit
4
0
mit
f93888778e1710136d3ba5cc5365711a1c658ff6
typpo/asterank,typpo/asterank,typpo/asterank,typpo/asterank
data/pipeline/run/30_exoplanets/exoread.py
rejected_lint
Too many lint violations: 4
true
[ { "role": "user", "content": "Write python code for the following: Add tests for raise_if_error function" }, { "role": "assistant", "content": "import pytest\n\nfrom xbee_helper import device, exceptions, ZigBee\n\n\ndef test_raise_if_error_no_status():\n \"\"\"\n Should return None withou...
python
new_file
3
1
mit
eca2199c90fa169acef8672458df0df3e6d65fad
flyte/xbee-helper
tests/test_device.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\n# coding=utf-8\n\nimport os, sys\nsys.path.insert(0, os.path.dirname(os.path.dirname(__file__)))\n\nimport re\nversion_regex = re.compile(r'^\\d+\\.\\d+')\n\nimport lasio.las_version\n\n\ndef test_verify_default_vcs_tool():\n result = la...
python
edit
1
3
mit
5038c49c1597ef6182c429dd63b34045a69de945
kinverarity1/lasio,kwinkunks/lasio,kinverarity1/las-reader
tests/test_version.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nfrom sharepa.search import ShareSearch\nfrom sharepa.search import basic_search\n\nimport elasticsearch_dsl\nimport types\n\n\ndef test_basic_search():\n results = basic_search.execute()\n assert results.hits\n assert results.aggre...
python
edit
3
2
mit
fd909f383ab8a930c8a858144e0566075821f019
fabianvf/sharepa,erinspace/sharepa,samanehsan/sharepa,CenterForOpenScience/sharepa
tests/test_search.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nfrom yacron import config\n\n\ndef test_mergedicts():\n\tassert dict(config.mergedicts({\"a\": 1}, {\"b\": 2})) == {\"a\": 1, \"b\": 2}\n\n\ndef test_mergedicts_nested():\n\tassert dict(config.mergedicts(\n\t {\"a\": {'x': 1, 'y': 2, 'z'...
python
edit
1
1
mit
e5351bba6cdf7b76da895afda80c18309c7f90eb
gjcarneiro/yacron
tests/test_config.py
accepted
null
true
[ { "role": "user", "content": "Write python code for the following: Add prediction functions to imports in init" }, { "role": "assistant", "content": "from .hdbscan_ import HDBSCAN, hdbscan\nfrom .robust_single_linkage_ import RobustSingleLinkage, robust_single_linkage\nfrom .prediction import ap...
python
new_file
9
0
bsd-3-clause
ae9b50b72d69a06c47cff0bc78d58346399b65d3
scikit-learn-contrib/hdbscan,lmcinnes/hdbscan,lmcinnes/hdbscan,scikit-learn-contrib/hdbscan
hdbscan/__init__.py
rejected_lint
Too many lint violations: 9
true
[ { "role": "user", "content": "Here is the current file:\n```python\n\"\"\"Machine Learning Time-Series Platform (MLTSP)\n\nSee http://mltsp.io for more information.\n\"\"\"\n\n__version__ = '0.3dev'\n\n\ndef install():\n \"\"\"Install MLTSP config file in ~/.config/mltsp/mltsp.yaml.\n\n \"\"\"\n im...
python
edit
1
3
bsd-3-clause
697ffec14e11e3558c8ebd33637aeebd7119a772
mltsp/mltsp,bnaul/mltsp,acrellin/mltsp,bnaul/mltsp,bnaul/mltsp,acrellin/mltsp,acrellin/mltsp,bnaul/mltsp,mltsp/mltsp,mltsp/mltsp,mltsp/mltsp,bnaul/mltsp,acrellin/mltsp,bnaul/mltsp,acrellin/mltsp,mltsp/mltsp,acrellin/mltsp,mltsp/mltsp
mltsp/__init__.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nimport pytest\n\ndef pytest_addoption(parser):\n parser.addoption(\"--filter-project-name\",\n action=\"store\",\n default=None,\n help=\"pass a project name to filter a test fi...
python
edit
3
1
mit
72302898ba5a6fc74dcedfc6f2049f4a0c1299ac
elifesciences/builder,elifesciences/builder
src/conftest.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\n\"\"\"\nThis introduces a new page type, which has no content of its own but inherits\nall content from the linked page.\n\"\"\"\n\nfrom django.db import models\nfrom django.utils.translation import ugettext_lazy as _\n\nfrom feincms._inter...
python
edit
1
3
bsd-3-clause
74f0cfae2e56157c4bd3e5dde6d68cd8e40cf412
feincms/feincms,nickburlett/feincms,michaelkuty/feincms,feincms/feincms,nickburlett/feincms,matthiask/feincms2-content,matthiask/feincms2-content,joshuajonah/feincms,matthiask/django-content-editor,pjdelport/feincms,joshuajonah/feincms,matthiask/feincms2-content,michaelkuty/feincms,michaelkuty/feincms,nickburlett/feinc...
feincms/module/page/extensions/symlinks.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nfrom trac.db import Table, Column, Index, DatabaseManager\r\nfrom trac.core import TracError\r\nfrom trac.versioncontrol.cache import CACHE_YOUNGEST_REV\r\n\r\ndef do_upgrade(env, ver, cursor):\r\n \"\"\"Modify the repository cache schem...
python
edit
6
3
bsd-3-clause
02ca3946662fd996f77c30d9e61d8fc8d9243de7
exocad/exotrac,dokipen/trac,moreati/trac-gitsvn,exocad/exotrac,dokipen/trac,dafrito/trac-mirror,dafrito/trac-mirror,moreati/trac-gitsvn,dafrito/trac-mirror,dafrito/trac-mirror,exocad/exotrac,dokipen/trac,moreati/trac-gitsvn,exocad/exotrac,moreati/trac-gitsvn
trac/upgrades/db20.py
rejected_lint
Too many lint violations: 6
true
[ { "role": "user", "content": "Here is the current file:\n```python\nimport re\n\ndef gpgga_get_position(gpgga_sentence):\n\tgps = re.search(\"\\$GPGGA,,([0-9]+\\.[0-9]+),([NS]),([0-9]+\\.[0-9]+),([WE]),,,,([0-9]+),M,+\\*(\\w+)\", gpgga_sentence)\n\tposition = {}\n\tposition['lat'] = gps.group(1)\n\tposition...
python
edit
2
1
mit
4fa9cff24867d3288d4f46c669151e823e934df0
elielsardanons/dstar_sniffer,elielsardanons/dstar_sniffer
nmea.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\n#\n# Copyright (c) 2009 rPath, Inc.\n#\n# This program is distributed under the terms of the Common Public License,\n# version 1.0. A copy of this license should have been distributed with this\n# source file in a file called LICENSE. If it...
python
edit
null
null
apache-2.0
ca7fb88d36b386defab610388761609539e0a9cf
fedora-conary/conary,fedora-conary/conary,fedora-conary/conary,fedora-conary/conary,fedora-conary/conary
conary/build/capsulerecipe.py
rejected_syntax
Syntax error detected by tree-sitter
false
[ { "role": "user", "content": "Here is the current file:\n```python\nfrom .base import FunctionalTest\n\nfrom store.tests.factories import *\n\n\nclass ProductTest(FunctionalTest):\n\n def test_product_navigation(self):\n # Create a product\n product = ProductFactory.create()\n\n # Ge...
python
edit
3
1
bsd-3-clause
21cb063ec63792ddeb45a62570a8565c69f2091b
kevgathuku/compshop,andela-kndungu/compshop,andela-kndungu/compshop,andela-kndungu/compshop,kevgathuku/compshop,andela-kndungu/compshop,kevgathuku/compshop,kevgathuku/compshop
tests/functional/test_product.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nimport logging\n\nfrom django import forms\nfrom django.conf import settings\nfrom django.utils.translation import ugettext_lazy as _\n\nimport stripe\n\nfrom .models import Supporter\n\nlog = logging.getLogger(__name__)\n\n\nclass Supporte...
python
edit
4
2
mit
e2fb7715d10a9a02216fa5668f482952bbb60310
SteveViss/readthedocs.org,rtfd/readthedocs.org,KamranMackey/readthedocs.org,safwanrahman/readthedocs.org,wijerasa/readthedocs.org,laplaceliu/readthedocs.org,jerel/readthedocs.org,pombredanne/readthedocs.org,fujita-shintaro/readthedocs.org,VishvajitP/readthedocs.org,CedarLogic/readthedocs.org,atsuyim/readthedocs.org,rav...
readthedocs/donate/forms.py
rejected_lint
Too many lint violations: 4
true
[ { "role": "user", "content": "Here is the current file:\n```python\nfrom struct import unpack\n\nclass KaitaiStruct:\n def read_u1(self):\n return unpack('B', self._io.read(1))[0]\n\n```\n\nApply this change: Fix formatting as per PEP8" }, { "role": "assistant", "content": "from struct impor...
python
edit
1
1
mit
f3687b849dd01e9af32e6786ed6a813448cf8a38
kaitai-io/kaitai_struct_python_runtime
kaitaistructures.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nfrom flask import url_for\n\n\ndef register_template_utils(app):\n \"\"\"Register Jinja 2 helpers (called from __init__.py).\"\"\"\n\n @app.template_test()\n def equalto(value, other):\n return value == other\n\n @app.tem...
python
edit
1
1
mit
e9eb8e0c4e77525d31c904e7f401a0d388a3fbf6
hack4impact/women-veterans-rock,hack4impact/women-veterans-rock,hack4impact/women-veterans-rock
app/utils.py
rejected_duplicate
Near-duplicate of sample 2847
true
[ { "role": "user", "content": "Here is the current file:\n```python\nimport unittest\nfrom itertools import chain\n\nfrom apriori import subsets\n\n\nclass AprioriTest(unittest.TestCase):\n def test_subsets_should_return_empty_subsets_if_input_empty_set(self):\n result = tuple(subsets(set([])))\n\n...
python
edit
3
1
mit
b9bd647cfd8def947838cb35c266b3b9ac855201
asaini/Apriori,gst-group/apriori_demo
test_apriori.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\n\"\"\"\nCompatibility support for Python 3.3. Remove when Python 3.3 support is\nno longer required.\n\"\"\"\n\nfrom .py27compat import builtins\n\n\ndef max(*args, **kwargs):\n \"\"\"\n Add support for 'default' kwarg.\n\n >>> max...
python
edit
1
4
mit
b84fe94128c308be3e95be800693eb92ec8c7d25
jaraco/keyring
keyring/py33compat.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nfrom common.helpers.constants import FrontEndSection\nfrom django.contrib.sitemaps import Sitemap\nfrom .models import Project\nfrom datetime import date\n\n\nclass SectionSitemap(Sitemap):\n protocol = \"https\"\n changefreq = \"mont...
python
edit
1
1
mit
c22252cef5225bc71ec9f407efe39f61819bcea5
DemocracyLab/CivicTechExchange,DemocracyLab/CivicTechExchange,DemocracyLab/CivicTechExchange,DemocracyLab/CivicTechExchange
civictechprojects/sitemaps.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\n# coding=utf8\n\"\"\"\nping.py - Sopel Ping Module\nAuthor: Sean B. Palmer, inamidst.com\nAbout: http://sopel.chat\n\"\"\"\nfrom __future__ import unicode_literals\n\nimport random\nfrom sopel.module import rule, priority, thread\n\n\n@rule...
python
edit
1
1
mit
3874ca578c52879d9861213e321f6ece9e67f10b
Uname-a/knife_scraper,Uname-a/knife_scraper,Uname-a/knife_scraper
sopel/modules/ping.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\n# vim: tabstop=4 shiftwidth=4 softtabstop=4\n\n# Licensed under the Apache License, Version 2.0 (the \"License\"); you may\n# not use this file except in compliance with the License. You may obtain\n# a copy of the License at\n#\n#...
python
edit
1
0
apache-2.0
77c6fd50fdc2bd7e716ecfba30e8e18e27b3c0eb
openstack/oslo.concurrency,varunarya10/oslo.concurrency,JioCloud/oslo.concurrency
oslo/__init__.py
rejected_duplicate
Near-duplicate of sample 397
true
[ { "role": "user", "content": "Here is the current file:\n```python\nfrom __future__ import unicode_literals\n\nimport os\n\nfrom cffi import FFI\n\n\n__version__ = '2.0.0a1'\n\n\nheader_file = os.path.join(os.path.dirname(__file__), 'api.processed.h')\nheader = open(header_file).read()\nheader += '#define S...
python
edit
1
3
apache-2.0
80bbff34e7bb8d9d3779d46b1bf9e64b62592055
kotamat/pyspotify,felix1m/pyspotify,kotamat/pyspotify,jodal/pyspotify,felix1m/pyspotify,mopidy/pyspotify,mopidy/pyspotify,jodal/pyspotify,jodal/pyspotify,kotamat/pyspotify,felix1m/pyspotify
spotify/__init__.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\n\"\"\"calc.py: A simple python calculator.\"\"\"\n\nimport sys\n\ndef add_all(nums):\n return sum(nums)\n\ndef multiply_all(nums):\n return reduce(lambda a, b: a * b, nums)\n\nif __name__ == '__main__':\n command = sys.argv[1]\n ...
python
edit
2
1
bsd-3-clause
cf663c4961a84260e34ec422a4983d312df9e8c3
anchavesb/pyCalc
calc.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nfrom contextlib import contextmanager\nfrom flask import current_app\nfrom redis import StrictRedis\nimport rq\n\n\n_queue = None\n\n\ndef get_queue():\n global _queue\n if _queue is None:\n _queue = create_queue()\n return ...
python
edit
1
2
bsd-2-clause
70efd2427caf52a5ba45e05eb33dc47fce2147c6
Lancey6/redwind,Lancey6/redwind,Lancey6/redwind
redwind/tasks.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nimport time\nimport requests\n\n\nclass SlackNotificationError(Exception):\n pass\n\n\ndef send_slack_message(message, webhook_url, pretext=None, title=None):\n \"\"\" Send slack message using webhooks\n\n Args:\n message (s...
python
edit
1
4
mit
f7ade90b6f68a4a8e71a3720ef529c228f2a035a
Chris-Graffagnino/slackelot
slackelot/slackelot.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nfrom django.db import models\n\n# Represents a category which articles can be part of\nclass Category(models.Model):\n name = models.CharField(max_length=255)\n\n def __str__(self):\n return self.name+\" [\"+str(self.id)+\"]\"\...
python
edit
1
1
mit
f68808dc85b2bb0ea8fb0d7de4669099740cdb61
grundleborg/mesosphere
mesoblog/models.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nimport scrollphat\nfrom pijobs.scrollphatjob import ScrollphatJob\n\nclass FlashJob(ScrollphatJob):\n def run(self):\n scrollphat.clear()\n for i in range(int(self.options['loop'])):\n scrollphat.set_pixels(lambd...
python
edit
1
2
mit
c0512873d1f558768c174c64faf419e03b63e24b
ollej/piapi,ollej/piapi
pijobs/flashjob.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\n#!/usr/bin/python\n\nimport argparse\nimport os\nimport struct\nimport sys\n\n###############\n### CLASSES ###\n###############\nclass MyParser(argparse.ArgumentParser):\n def error(self, message):\n sys.stderr.write('error: %s\\n...
python
edit
5
2
apache-2.0
15fd86ff33d4f585578ef4e67614e249b1e94d45
justinccdev/jjvm
jjvm.py
rejected_lint
Too many lint violations: 5
true
[ { "role": "user", "content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\n# -----------------------------------------------------------------------------\n# Copyright (c) Spyder Project Contributors\n#\n# Licensed under the terms of the MIT License\n# (see LICENSE.txt for details)\n# ----...
python
edit
1
0
mit
e2813d7c27079a259f542ff36383ec0aa2233a9e
spyder-ide/spyder-terminal,spyder-ide/spyder-terminal,spyder-ide/spyder-terminal,spyder-ide/spyder-terminal
spyder_terminal/__init__.py
rejected_duplicate
Near-duplicate of sample 3288
true
[ { "role": "user", "content": "Here is the current file:\n```python\nimport argparse\nimport astropy.io.fits as fits\nimport numpy as np\nimport sys\n\nMETHOD_MAP = {\"median\": lambda x: np.median(x, axis=0),\n \"average\": lambda x: np.average(x, axis=0),\n \"sum\": lambda x: np.s...
python
edit
3
4
mit
7a362c4a516a1bf6fa91b9d8c670a5d5613e5aeb
vulpicastor/miniraf
miniraf/combine.py
rejected_duplicate
Near-duplicate of sample 15641
true
[ { "role": "user", "content": "Here is the current file:\n```python\n#!/usr/bin/env python\n# encoding: utf-8\n\n\"\"\"\nA Simple Example Flask Application\n==================================\n\"\"\"\n\n# Third Party Libs\nfrom flask import Flask\nfrom flask_hal import HAL, document\n\n\napp = Flask(__name__...
python
edit
1
1
unlicense
7cf58ed386028a616c2083364d3f5c92e0c0ade3
thisissoon/Flask-HAL,thisissoon/Flask-HAL
examples/hello_world/hello_world.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nimport urllib2, sys, os.path, imp\n\nclass AnyMethodRequest(urllib2.Request):\n def __init__(self, url, data=None, headers={}, origin_req_host=None, unverifiable=None, method=None):\n self.method = method and method.upper() or Non...
python
edit
1
6
apache-2.0
774ece47574466f6661de469ef0f43ecf97d66f0
mollyproject/mollyproject,mollyproject/mollyproject,mollyproject/mollyproject
molly/utils/misc.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\n#! /usr/bin/env python3\n\nimport config # pylint: disable=unused-import\n\nfrom functools import partial\n\nfrom flask import Flask\nfrom flask.ext.sqlalchemy import SQLAlchemy\nfrom flask.ext.login import LoginManager\n\napp = Flask(\"od...
python
edit
3
1
mit
9da75318a5d8cf646442912f46e89ec2e6b13fb3
fsmi/odie-server,fjalir/odie-server,fjalir/odie-server,Kha/odie-server,fsmi/odie-server,Kha/odie-server,fsmi/odie-server,Kha/odie-server,fjalir/odie-server
odie.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nfrom django.conf.urls import include, url\nfrom django.contrib import admin\nfrom django.conf import settings\nfrom django.conf.urls.static import static\n\nurlpatterns = [\n # Examples:\n # url(r'^$', 'mywebsite.views.home', name='ho...
python
edit
1
0
mit
58d5f96464a4706fd88869f7a09c1dffcd9ac684
TomGijselinck/mywebsite,TomGijselinck/mywebsite
mywebsite/urls.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\n\nimport functools\nimport inspect\nimport warnings\n\nstring_types = (type(b''), type(u''))\n\n\ndef deprecated(reason):\n \"\"\"\n This is a decorator which can be used to mark functions\n as deprecated. ...
python
edit
1
1
mit
c1510244999e1e88dd66f62857d855e466cec570
vrcmarcos/python-deprecated
deprecated/__init__.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nfrom django.contrib import admin\n\nfrom organizations.models import (Organization, OrganizationUser,\n OrganizationOwner)\n\n\nclass OwnerInline(admin.StackedInline):\n model = OrganizationOwner\n\n\nclass OrganizationAdmin(admin...
python
edit
1
0
bsd-2-clause
d4d04b72727b5e3886255a866f984b75fe610406
bennylope/django-organizations,st8st8/django-organizations,DESHRAJ/django-organizations,GauthamGoli/django-organizations,bennylope/django-organizations,GauthamGoli/django-organizations,aptivate/django-organizations,DESHRAJ/django-organizations,aptivate/django-organizations,st8st8/django-organizations,arteria/django-ar-...
organizations/admin.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nfrom couchdb.schema import *\nfrom couchdb.schema import View\nfrom wiki.auth.models import User\n\nclass Page(Document):\n created_date = DateTimeField()\n last_edited_date = DateTimeField()\n title = TextFiel...
python
edit
9
0
mit
22dc2bd827143c4c73b7b122d94a64611960e9a1
theju/django-couch-wiki
wiki/models.py
rejected_lint
Too many lint violations: 9
true
[ { "role": "user", "content": "Here is the current file:\n```python\nimport unittest\n\nfrom examples import books\n\n\nclass BooksTest(unittest.TestCase):\n\n def test_builder(self):\n book = books.MallocMessageBuilder().init_root(books.Book)\n book.title = 'Moby-Dick; or, The Whale'\n ...
python
edit
1
3
mit
ff476b33c26a9067e6ac64b2c161d29b0febea33
clchiou/garage,clchiou/garage,clchiou/garage,clchiou/garage
py/capnptools/examples/tests/test_books.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\n# Copyright Hybrid Logic Ltd. See LICENSE file for details.\n\n\"\"\"\nControl service for managing a Flocker cluster.\n\nA Flocker cluster is composed of a number of nodes. The control service is\nin charge of managing the desired configu...
python
edit
1
0
apache-2.0
7b78ce63a34b3f043fd79eb8f3f1d2049103e46f
w4ngyi/flocker,adamtheturtle/flocker,mbrukman/flocker,LaynePeng/flocker,jml/flocker,runcom/flocker,agonzalezro/flocker,wallnerryan/flocker-profiles,AndyHuu/flocker,moypray/flocker,mbrukman/flocker,Azulinho/flocker,hackday-profilers/flocker,w4ngyi/flocker,1d4Nf6/flocker,agonzalezro/flocker,runcom/flocker,adamtheturtle/f...
flocker/control/__init__.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\n# osmviz module #\n# Copyright (c) 2010 Colin Bick, Robert Damphousse\n\n# Permission is hereby granted, free of charge, to any person obtaining a copy\n# of this software and associated documentation files (the \"Software\"), to deal\n# in...
python
edit
1
0
mit
a5b40d9781caf74179f8c7e1f6fe4de5299b1e59
hugovk/osmviz,hugovk/osmviz
src/osmviz/__init__.py
rejected_duplicate
Near-duplicate of sample 3318
true
[ { "role": "user", "content": "Here is the current file:\n```python\nfrom django.contrib import admin\nfrom .models import Source, Registration\n\n\nclass RegistrationAdmin(admin.ModelAdmin):\n list_display = [\n \"id\", \"stage\", \"validated\", \"mother_id\", \"source\",\n \"created_at\", ...
python
edit
1
0
bsd-3-clause
540c0130ccca7d7d7cf51ddbe251652a5c46364e
praekelt/hellomama-registration,praekelt/hellomama-registration
registrations/admin.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nfrom __future__ import division\n\nimport sympy\n\nfrom symfit import Variable, Parameter\nfrom symfit.distributions import Gaussian, Exp\n\n\ndef test_gaussian():\n \"\"\"\n Make sure that symfit.distributions.Gaussians produces the ...
python
edit
1
1
mit
20a8d57f5e3d00898c7362d650b37f7962fdfe7a
tBuLi/symfit
tests/test_distributions.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\n#!/usr/bin/env python\n\nfrom socket import *\n\nHOST = 'localhost'\nPORT = 21567\nBUFSIZ = 1024\nADDR = (HOST, PORT)\n\nwhile True:\n tcpCliSock = socket(AF_INET, SOCK_STREAM)\n tcpCliSock.connect(ADDR)\n data = raw_input('> ')\n ...
python
edit
2
0
mit
787494af73a0b0e316547c3ec8536aa9ac21575e
ccandillo/chapter2
clients.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nfrom __future__ import unicode_literals\n\nfrom django.db import models\n\n# Create your models here.\n\n```\n\nApply this change: Add a State model and some enums" }, { "role": "assistant", "content": "from __future__ import un...
python
edit
1
0
mit
ff6ef6752b4aa0f561f2776d400e3c313963815c
sbuss/voteswap,sbuss/voteswap,sbuss/voteswap,sbuss/voteswap
polling/models.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\nfrom django import template\n\nfrom ..models import Badge, Award\nfrom ..compat import get_user_model\n\nregister = template.Library()\n\n\n@register.assignment_tag\ndef badgify_badges(**kwargs):\n \"\"\"\n Re...
python
edit
1
5
mit
e00ad93c1a769a920c7f61eeccec582272766b26
ulule/django-badgify,ulule/django-badgify
badgify/templatetags/badgify_tags.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nfrom django.db import models\nfrom django.utils.translation import ugettext_lazy as _\n\nclass Chapter(models.Model):\n \"\"\"\n Video section.\n \"\"\"\n video = models.ForeignKey('videos.Video')\n title = models.CharField(m...
python
edit
1
1
bsd-2-clause
e9a8d67115295e852e376d17bd159f5b9789bb4d
incuna/incuna-videos,incuna/incuna-videos
videos/module/chapters/models.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nfrom django.views.generic import TemplateView\nfrom django.contrib.auth.mixins import PermissionRequiredMixin\n\nfrom admin.base.settings import KEEN_CREDENTIALS\n\n\nclass MetricsView(PermissionRequiredMixin, TemplateView):\n template_n...
python
edit
1
1
apache-2.0
2293cc41ef1fada91c1d71c2f75ebf3e5609bd9e
HalcyonChimera/osf.io,caseyrollins/osf.io,chennan47/osf.io,hmoco/osf.io,crcresearch/osf.io,felliott/osf.io,saradbowman/osf.io,chennan47/osf.io,caseyrollins/osf.io,cslzchen/osf.io,icereval/osf.io,mattclark/osf.io,CenterForOpenScience/osf.io,CenterForOpenScience/osf.io,HalcyonChimera/osf.io,adlius/osf.io,sloria/osf.io,ba...
admin/metrics/views.py
accepted
null
true
[ { "role": "user", "content": "Write python code for the following: Allow alpha versions in the versioning string" }, { "role": "assistant", "content": "__version_info__ = (0, 1, 1, 'a1')\n__version__ = '.'.join(map(str, __version_info__[:3]))\nif len(__version_info__) == 4:\n __version__ += _...
python
new_file
1
0
bsd-3-clause
df03a2d9543b392fb9ea9c027b93f4ed736e6788
bryanwweber/PyKED,pr-omethe-us/PyKED
pyked/_version.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\n#!/usr/bin/python\r\n# $Id:$\r\n\r\nfrom pyglet.gl import *\r\n\r\ndef draw_client_border(window):\r\n glClearColor(0, 0, 0, 1)\r\n glClear(GL_COLOR_BUFFER_BIT)\r\n\r\n glMatrixMode(GL_PROJECTION)\r\n glLoadIdentity()\r\n glO...
python
edit
21
1
bsd-3-clause
50146d9e3e43ca4d9c50d044c52714cf4234cee1
adamlwgriffiths/Pyglet,adamlwgriffiths/Pyglet,seeminglee/pyglet64,adamlwgriffiths/Pyglet,adamlwgriffiths/Pyglet,seeminglee/pyglet64,niklaskorz/pyglet,niklaskorz/pyglet,seeminglee/pyglet64,niklaskorz/pyglet,niklaskorz/pyglet
tests/window/window_util.py
rejected_lint
Too many lint violations: 21
true
[ { "role": "user", "content": "Here is the current file:\n```python\nimport imp\nimport json\nimport os\nimport sys\n\nhere = os.path.dirname(__file__)\nlocalpaths = imp.load_source(\"localpaths\", os.path.abspath(os.path.join(here, os.pardir, \"localpaths.py\")))\n\nroot = localpaths.repo_root\n\nimport man...
python
edit
3
1
bsd-3-clause
3ef70e2e4e319414441b69b0f96ca9d52df9929e
wpt-on-tv-tf/wpt-tools,wpt-on-tv-tf/wpt-tools,vivliostyle/wpt-tools,frewsxcv/wpt-tools,frewsxcv/wpt-tools,UprootStaging/wpt-tools,frewsxcv/wpt-tools,UprootStaging/wpt-tools,wpt-on-tv-tf/wpt-tools,kaixinjxq/wpt-tools,vivliostyle/wpt-tools,UprootStaging/wpt-tools,vivliostyle/wpt-tools,kaixinjxq/wpt-tools,kaixinjxq/wpt-to...
runner/update_manifest.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\n# Copyright 2013 Getlogic BV, Sardar Yumatov\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 of the License at\n#\n# http...
python
edit
2
0
apache-2.0
72c122d8ff580a4c0c5fa4554844c73c657a6581
marcinkaszynski/apnsclient
apnsclient/__init__.py
rejected_duplicate
Near-duplicate of sample 841
true
[ { "role": "user", "content": "Here is the current file:\n```python\nfrom celery import Celery\n\n\nclass NewAcropolisCelery(Celery):\n def init_app(self, app):\n super(NewAcropolisCelery, self).__init__(\n app.import_name,\n broker=app.config['CELERY_BROKER_URL'],\n )\...
python
edit
1
2
mit
c21eaccbee53f2b915fc35b85bf665e84b81dc8c
NewAcropolis/api,NewAcropolis/api,NewAcropolis/api
app/celery/__init__.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nfrom .selectors import (\n HAS_SELECT,\n DefaultSelector,\n EVENT_READ,\n EVENT_WRITE\n)\n\n\ndef _wait_for_io_events(socks, events, timeout=None):\n \"\"\" Waits for IO events to be available from a list of sockets\n or o...
python
edit
1
7
mit
ca97a29dded7278b40785fe88b5e8c9ceb542d86
sigmavirus24/urllib3,Lukasa/urllib3,Disassem/urllib3,Lukasa/urllib3,Disassem/urllib3,urllib3/urllib3,urllib3/urllib3,sigmavirus24/urllib3
urllib3/util/wait.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\n'''\nFunctions to view the minion's public key information\n'''\nfrom __future__ import absolute_import\n\n# Import python libs\nimport os\n\n# Import Salt libs\nimport salt.utils\n\n\ndef finger():\n '''\n Re...
python
edit
5
1
apache-2.0
785717703baf0c8fd9234058a6c9845a6838a8bf
saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt
salt/modules/key.py
rejected_lint
Too many lint violations: 5
true
[ { "role": "user", "content": "Here is the current file:\n```python\nfrom django.conf import settings\nfrom django.utils import translation\n\nfrom celery.task import task\nfrom haystack import site\n\n@task\ndef delayed_update(instance_pk, model):\n \"\"\" Only index stuff that is known to be public \"\"...
python
edit
1
2
mit
27d8c3e0944056d23f1d25c651f7988f6cbf8353
CodeforHawaii/froide,CodeforHawaii/froide,LilithWittmann/froide,catcosmo/froide,ryankanno/froide,stefanw/froide,okfse/froide,catcosmo/froide,okfse/froide,ryankanno/froide,stefanw/froide,ryankanno/froide,CodeforHawaii/froide,CodeforHawaii/froide,LilithWittmann/froide,fin/froide,catcosmo/froide,catcosmo/froide,LilithWitt...
froide/helper/tasks.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nfrom django.db import models\nfrom django.contrib.sites.models import Site\n\n\nclass MultiSiteField(models.ManyToManyField):\n\n def __init__(self, **kwargs):\n defaults = {\n 'blank': False,\n }\n defaults.update(kwar...
python
edit
1
2
mit
373b0210483839b7ac5b4fd8eb0bcfdfe8d63d83
AGoodId/begood-sites
begood_sites/fields.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nimport django\nfrom django.conf import settings\n\nif not settings.configured:\n settings.configure(\n DEBUG=True,\n INSTALLED_APPS=(\n 'mailviews',\n 'mailviews.tests',\n ),\n DATABASES=...
python
edit
1
0
apache-2.0
a5deca67d654fa1113db3e224efefc85831146dc
disqus/django-mailviews,joshowen/django-mailviews,disqus/django-mailviews,danxshap/django-mailviews,joshowen/django-mailviews,danxshap/django-mailviews
mailviews/tests/__init__.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\n# Lint as: python3\n\"\"\"Tests for spectral.\"\"\"\n\nfrom __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\n\nimport tensorflow as tf\nimport numpy as np\n\nimport layers\n\n\nclass...
python
edit
1
1
apache-2.0
b2470140f7fb33bee2af34cdc51695406a4073ec
googleinterns/audio_synthesis
utils/layers_test.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\ndef argsort(x, /, *, axis=-1, descending=False, stable=True):\n from .. import argsort\n from .. import flip\n # Note: this keyword argument is different, and the default is different.\n kind = 'stable' if stable else 'quicksort...
python
edit
1
3
mit
e521b16844efc2853c0db9014098cb3e37f6eb04
jakirkham/numpy,numpy/numpy,mhvk/numpy,seberg/numpy,pdebuyl/numpy,numpy/numpy,numpy/numpy,jakirkham/numpy,anntzer/numpy,charris/numpy,simongibbons/numpy,endolith/numpy,simongibbons/numpy,mhvk/numpy,seberg/numpy,mattip/numpy,mattip/numpy,jakirkham/numpy,mhvk/numpy,charris/numpy,seberg/numpy,simongibbons/numpy,pdebuyl/nu...
numpy/_array_api/_sorting_functions.py
rejected_duplicate
Near-duplicate of sample 16513
true
[ { "role": "user", "content": "Here is the current file:\n```python\n# Copyright (c) 2012 The Chromium Authors. All rights reserved.\n# Use of this source code is governed by a BSD-style license that can be\n# found in the LICENSE file.\n\nfrom master import master_config\nfrom master.factory import chromium...
python
edit
1
1
bsd-3-clause
022fdeed936c0ad74a2510e568bdc385b4ebb13d
eunchong/build,eunchong/build,eunchong/build,eunchong/build
masters/master.chromium/master_android_cfg.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nfrom fabric.api import cd, sudo, env\nimport os\n\nexpected_vars = [\n 'PROJECT',\n]\n\nfor var in expected_vars:\n if var not in os.environ:\n raise Exception('Please specify %s environment variable' % (\n var,))\n\...
python
edit
1
2
bsd-3-clause
e660d8e05e54adbd0ea199a02cc188dc7007089a
praekelt/go-rts-zambia
fabfile.py
rejected_duplicate
Near-duplicate of sample 11498
true
[ { "role": "user", "content": "Here is the current file:\n```python\nimport os\nfrom setuptools import setup\n\n\ndef read(fname):\n return open(os.path.join(os.path.dirname(__file__), fname)).read()\n\n\nsetup(name='windpowerlib',\n version='0.1.3',\n description='Creating time series of wind p...
python
edit
1
1
mit
19debebae3368be479b8368e96e17458e9a18d23
wind-python/windpowerlib
setup.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nfrom fabric.api import local, cd\n\ndef docs():\n local(\"./bin/docs\")\n local(\"./bin/python setup.py upload_sphinx --upload-dir=docs/html\")\n\ndef release():\n # update version id in setup.py, changelog and docs/source/conf.py\...
python
edit
3
1
bsd-3-clause
3b99493e606a04a6338d8ee2fc299595d19b2a44
janusnic/importd,pombredanne/importd,arpitremarkable/importd,pombredanne/importd,akshar-raaj/importd,hitul007/importd,akshar-raaj/importd,hitul007/importd,janusnic/importd,arpitremarkable/importd
fabfile.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nfrom setuptools import setup\n\nsetup(\n name='dblp',\n version='0.1.0',\n author='Sebastian Gehrmann',\n author_email='<EMAIL>',\n packages=['dblp'],\n url='https://github.com/sebastianGehrmann/dblp-pub/tree/master',\n ...
python
edit
1
0
mit
22c818fdb813fbd3b7ea48bb0fd3c7324ebdd0ba
sebastianGehrmann/dblp-pub
setup.py
accepted
null
true
[ { "role": "user", "content": "Write python code for the following: Update Byzantine Randomized Consensus protocol class" }, { "role": "assistant", "content": "from base.consensus import Consensus\n\n\nclass ByzantineRandomizedConsensus(Consensus):\n \"\"\"\n Implements a Byzantine Fault To...
python
new_file
1
1
mit
3617400a7c0915920384d15ff273aa4c8a805d9c
koevskinikola/ByzantineRandomizedConsensus
core/byzantinerandomizedconsensus.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\n__all__ = ['Config', 'Chdir', 'cmd', 'log','Properties','replace_vars','cmd']\n\nfrom buildtools.config import Config, Properties, replace_vars\nfrom buildtools.os_utils import Chdir, cmd, ENV, BuildEnv\nfrom buildtools.bt_logging import lo...
python
edit
1
0
mit
116d3837aa817dee6e15bdc24f20eac1e56066dd
N3X15/python-build-tools,N3X15/python-build-tools,N3X15/python-build-tools
buildtools/__init__.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nfrom os import environ\nfrom urllib2 import urlopen\n\nfrom flask import Flask, json, make_response\napp = Flask(__name__)\n\nurl = 'http://open.mapquestapi.com/directions/v2/route'\nparams = '?key={apikey}&ambiguities=ignore&routeType=pede...
python
edit
1
3
apache-2.0
8a9c6c9df8f29f5ff6f9bb1a6200536f08cf08a9
kynan/GetLost
getlost.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\n#!/usr/bin/python\n\"\"\"\nPrint log for given DNA program run\n\"\"\"\n\nimport os\nimport sys\nfrom readevtlog import *\n\nhome = os.getenv('HOME')\nlogdir = os.path.join(home,'_dna','logs',sys.argv[1])\nfor d in sorted(os.listdir(logdi...
python
edit
3
5
apache-2.0
bf84052d391774b13b8333acc06533e4ec9cde9e
SKA-ScienceDataProcessor/RC,SKA-ScienceDataProcessor/RC,SKA-ScienceDataProcessor/RC,SKA-ScienceDataProcessor/RC,SKA-ScienceDataProcessor/RC
MS2/visualize/dna-summary.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nfrom django.db import models\nimport datetime\n\n\nclass Production(models.Model):\n name = models.CharField(max_length=100)\n description = models.TextField(blank=True)\n\n def __str__(self):\n return self.name\n\n\nclass S...
python
edit
1
1
mit
cbae962b77b7277f5904279a5418a53e38148f2c
Karspexet/Karspexet,Karspexet/Karspexet,Karspexet/Karspexet,Karspexet/Karspexet,Karspexet/Karspexet
karspexet/show/models.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\n# Test calling non-special method inherited from native type\n\nclass mytuple(tuple):\n pass\n\nt = mytuple((1, 2, 3))\nprint(t)\nprint(t == (1, 2, 3))\nprint((1, 2, 3) == t)\n\n```\n\nApply this change: tests/basics: Add test for tuple ...
python
edit
1
0
mit
819380c964ca30f9d3e480a61371d502b7976abe
adafruit/circuitpython,MrSurly/micropython,tobbad/micropython,tobbad/micropython,bvernoux/micropython,MrSurly/micropython,kerneltask/micropython,tobbad/micropython,pramasoul/micropython,bvernoux/micropython,selste/micropython,kerneltask/micropython,pozetroninc/micropython,henriknelson/micropython,henriknelson/micropyth...
tests/basics/subclass_native_cmp.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\n# Copyright 2012 NEC Corporation\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\"); you may\n# not use this file except in compliance with the License. You may obtain\n# a copy of the License at\n#\n# h...
python
edit
1
0
apache-2.0
118eabf049db8804635001b2348fcb81c8a2a4f4
j4/horizon,yeming233/horizon,henaras/horizon,yeming233/horizon,damien-dg/horizon,tqtran7/horizon,BiznetGIO/horizon,Hodorable/0602,tqtran7/horizon,RudoCris/horizon,dan1/horizon-x509,agileblaze/OpenStackTwoFactorAuthentication,kfox1111/horizon,maestro-hybrid-cloud/horizon,NeCTAR-RC/horizon,redhat-openstack/horizon,Tesora...
openstack_dashboard/dashboards/admin/routers/ports/tables.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nimport sys\nimport logging\nimport distutils.log\nfrom . import monkey\n\n\ndef _not_warning(record):\n return record.levelno < logging.WARNING\n\n\ndef configure():\n \"\"\"\n Configure logging to emit warning and above to stderr\...
python
edit
1
2
mit
4c267c78a09128dc80be821654dd60b174d53d41
pypa/setuptools,pypa/setuptools,pypa/setuptools
setuptools/logging.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nfrom os import environ as env\n\nfrom glanceclient import Client as glclient\nimport keystoneclient.v2_0.client as ksclient\nimport novaclient.v2.client as nvclient\n\n\nclient_args = {\n }\n\nnova = nvclient.Client(auth_url=env['OS_...
python
edit
1
0
apache-2.0
92e96d8b352f608a0d04521a140bdd3dcbe5ebbc
pellaeon/bsd-cloudinit-installer,pellaeon/bsd-cloudinit-installer
test/tools/service.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nfrom __future__ import absolute_import, division, unicode_literals\n\nfrom changes.api.base import APIView\nfrom changes.constants import Status\nfrom changes.config import db\nfrom changes.jobs.sync_job_step import sync_job_step\nfrom chan...
python
edit
1
3
apache-2.0
3d524f00269026bc66dcd2b085c60c0d43242ee5
bowlofstew/changes,bowlofstew/changes,dropbox/changes,bowlofstew/changes,dropbox/changes,wfxiang08/changes,wfxiang08/changes,wfxiang08/changes,dropbox/changes,wfxiang08/changes,bowlofstew/changes,dropbox/changes
changes/api/jobstep_deallocate.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nfrom io import StringIO\nfrom contextlib import contextmanager\n\nfrom django.conf import settings\nfrom django.core.management.base import BaseCommand\nfrom django.utils import translation\nfrom django.utils.translation import ugettext_laz...
python
edit
1
5
mit
0409580aed43b6a0556fcc4b8e6e9252d9f082ea
stefanw/froide,stefanw/froide,stefanw/froide,fin/froide,stefanw/froide,fin/froide,stefanw/froide,fin/froide,fin/froide
froide/publicbody/management/commands/validate_publicbodies.py
accepted
null
true