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\nimport pyxb.binding.generate\n\nimport os.path\nschema_path = '%s/../../pyxb/standard/schemas/kml21.xsd' % (os.path.dirname(__file__),)\ncode = pyxb.binding.generate.GeneratePython(schema_file=schema_path)\nrv = compile(code, 'test', 'exec'...
python
edit
7
1
apache-2.0
ecc666f7dfc7ace45692c8759acff6d46bc1c43e
CantemoInternal/pyxb,jonfoster/pyxb-upstream-mirror,balanced/PyXB,jonfoster/pyxb-upstream-mirror,jonfoster/pyxb1,pabigot/pyxb,balanced/PyXB,jonfoster/pyxb2,pabigot/pyxb,jonfoster/pyxb-upstream-mirror,balanced/PyXB,jonfoster/pyxb1,CantemoInternal/pyxb,jonfoster/pyxb2,CantemoInternal/pyxb,jonfoster/pyxb2
tests/drivers/test-kml21.py
rejected_lint
Too many lint violations: 7
true
[ { "role": "user", "content": "Here is the current file:\n```python\n# Kegbot local settings, for travis-ci.org build\n\n# NEVER set DEBUG to `True` in production.\nimport os\n\nHOME = os.environ['HOME']\n\nDEBUG = True\nTEMPLATE_DEBUG = DEBUG\n\nDATABASES = {'default': {'ENGINE': 'django.db.backends.sqlite3...
python
edit
1
0
mit
e349996bc98c57464f25152bdd0ab663398b6a46
Kegbot/kegbot-server,Kegbot/kegbot-server,Kegbot/kegbot-server,Kegbot/kegbot-server,Kegbot/kegbot-server
deploy/travis/local_settings.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nfrom chef.base import ChefObject\n\nclass Role(ChefObject):\n \"\"\"A model object for a Chef role.\"\"\"\n\n url = '/roles'\n attributes = [\n 'description',\n ]\n\n\n```\n\nApply this change: Add run_list to Role for te...
python
edit
1
0
apache-2.0
ecc9efaf3bbbb3d6231d1217ff124d8237ac09bb
cread/pychef,Scalr/pychef,Scalr/pychef,cread/pychef,jarosser06/pychef,coderanger/pychef,coderanger/pychef,dipakvwarade/pychef,jarosser06/pychef,dipakvwarade/pychef
chef/role.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\n__version__ = '0.6.0'\n__version_info__ = __version__.split('.')\n\nfrom django.utils.translation import ugettext_lazy as _\n\n\ndef __activate_social_auth_monkeypatch():\n from social_core.backends.base import BaseAuth\n from social_...
python
edit
1
1
bsd-3-clause
26598254cd48a716527eb4689ad96551c5a39790
koniiiik/ksp_login,koniiiik/ksp_login,koniiiik/ksp_login
ksp_login/__init__.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\n\n\"\"\"\nLocal workflow implementation.\n\"\"\"\n\n\n__all__ = [\"LocalWorkflow\"]\n\n\nfrom law.workflow.base import Workflow, WorkflowProxy\n\n\nclass LocalWorkflowProxy(WorkflowProxy):\n\n workflow_type = \"l...
python
edit
1
1
bsd-3-clause
d9fd011a2750a01cac67aa6ca37c0aedc2a7ad94
riga/law,riga/law
law/workflow/local.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\n# coding: utf-8\nfrom PyQt5 import QtCore\n\nfrom PyQt5.QtWebKitWidgets import QWebView\n\n\nclass MyBrowser(QWebView):\n closing = QtCore.Signal()\n def __init(self):\n super().__init__()\n self.loadFinished.connec(self...
python
edit
4
1
bsd-3-clause
d106719a0b7bcbd87989bd36f618f90c4df02c46
sequana/sequana,sequana/sequana,sequana/sequana,sequana/sequana,sequana/sequana
sequana/gui/browser.py
rejected_lint
Too many lint violations: 4
true
[ { "role": "user", "content": "Here is the current file:\n```python\nfrom django.db import models\nfrom django.urls import reverse\n\n\nclass Tag(models.Model):\n name = models.CharField(max_length=10)\n\n def __str__(self):\n return self.name\n\n def get_absolute_url(self):\n return r...
python
edit
1
1
bsd-3-clause
a6b6d229aa83497f43f04104498394fbd5df9fb8
invzhi/invzhi.me,invzhi/invzhi.me
articles/models.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\n#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\nfrom dateutil.parser import parse\nfrom dateutil.relativedelta import DAILY\nfrom dateutil.rrule import rrule\n\n\nclass SummaryDownloader():\n\n # base url for official schedule json pag...
python
edit
1
3
mit
fbaf1a64621e8b72b7ee46b8c58a12ed96a0f41f
leaffan/pynhldb
utils/summary_downloader.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nimport os, logging\nfrom flask import Flask\nfrom raven.contrib.flask import Sentry\n\napp = Flask(__name__)\n\napp.config.from_object(os.environ.get('SETTINGS'))\n\napp.logger.info(\"\\nConfiguration\\n%s\\n\" % app.config)\n\n# Sentry exc...
python
edit
1
0
mit
03b4e218e796bf2cc42015f70195fb4a5e13f33b
LandRegistry/decision-alpha,LandRegistry/decision-alpha
decision/__init__.py
rejected_duplicate
Near-duplicate of sample 4143
true
[ { "role": "user", "content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\n\nfrom __future__ import (\n print_function, division, generators,\n absolute_import, unicode_literals\n)\n\nfrom .bonsai import BonsaiTree\nfrom .logistic import LogisticConverter\n\n```\n\nApply this change:...
python
edit
4
0
bsd-3-clause
f65fd97940cb1f9c146de1b95c6e1e8652ae0c52
markovianhq/bonspy
bonspy/__init__.py
rejected_lint
Too many lint violations: 4
true
[ { "role": "user", "content": "Here is the current file:\n```python\n\"\"\" Various kinds of panel widgets.\n\n\"\"\"\nfrom __future__ import absolute_import\n\nfrom ...properties import Bool, Int, String, Instance, List\nfrom ..widget import Widget\nfrom ..actions import Callback\n\nclass Panel(Widget):\n ...
python
edit
1
0
bsd-3-clause
0a73784ca3995b42b77d9a4cb3e6903154ef8914
khkaminska/bokeh,ericmjl/bokeh,ChinaQuants/bokeh,jplourenco/bokeh,clairetang6/bokeh,Karel-van-de-Plassche/bokeh,phobson/bokeh,srinathv/bokeh,rs2/bokeh,muku42/bokeh,Karel-van-de-Plassche/bokeh,KasperPRasmussen/bokeh,aavanian/bokeh,schoolie/bokeh,paultcochrane/bokeh,gpfreitas/bokeh,bokeh/bokeh,jplourenco/bokeh,aavanian/b...
bokeh/models/widgets/panels.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nfrom django.contrib.auth.models import User\nfrom django.test import TestCase\nfrom hc.api.models import Channel\n\n\nclass AddChannelTestCase(TestCase):\n\n def setUp(self):\n self.alice = User(username=\"alice\")\n self.a...
python
edit
1
2
bsd-3-clause
99cb654ec5730f6be33bb091aa3ac9e70963470c
healthchecks/healthchecks,iphoting/healthchecks,BetterWorks/healthchecks,BetterWorks/healthchecks,healthchecks/healthchecks,healthchecks/healthchecks,healthchecks/healthchecks,iphoting/healthchecks,iphoting/healthchecks,BetterWorks/healthchecks,BetterWorks/healthchecks,iphoting/healthchecks
hc/front/tests/test_add_channel.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\n# This file is part of Moksha.\n#\n# Moksha is free software: you can redistribute it and/or modify\n# it under the terms of the GNU General Public License as published by\n# the Free Software Foundation, either version 3 of the License, or...
python
edit
5
2
apache-2.0
4dae2456d36a92951beaca2f57ddbed575103cf6
lmacken/moksha,ralphbean/moksha,ralphbean/moksha,pombredanne/moksha,lmacken/moksha,mokshaproject/moksha,mokshaproject/moksha,mokshaproject/moksha,lmacken/moksha,pombredanne/moksha,pombredanne/moksha,ralphbean/moksha,pombredanne/moksha,mokshaproject/moksha
moksha/api/hub/consumer.py
rejected_lint
Too many lint violations: 5
true
[ { "role": "user", "content": "Here is the current file:\n```python\nimport logging\nimport sys\nimport threading\nimport time\n\nimport spotify\n\n\nif len(sys.argv) != 3:\n sys.exit('Usage: %s USERNAME PASSWORD' % sys.argv[0])\n\nusername, password = sys.argv[1], sys.argv[2]\n\n\ndef login(session, user...
python
edit
1
3
apache-2.0
49ebd8bee6cc91cf80715a7b2e01c4cfbe78d1da
felix1m/pyspotify,kotamat/pyspotify,jodal/pyspotify,mopidy/pyspotify,jodal/pyspotify,jodal/pyspotify,kotamat/pyspotify,felix1m/pyspotify,felix1m/pyspotify,kotamat/pyspotify,mopidy/pyspotify
tests/regression/bug_122.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nfrom rest_framework import serializers\nfrom rest_framework.views import APIView\nfrom rest_framework.response import Response\nfrom django import http\n\nfrom .tasks import send_contact_form_inquiry\n\n\n# Serializers define the API repres...
python
edit
1
3
mit
685fa68b79b4d21f69fe55f66724191d30bbbaa8
p2pu/learning-circles,p2pu/learning-circles,p2pu/learning-circles,p2pu/learning-circles
contact/views.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nimport telegram\n\n\ndef callback_query_handler(bot: telegram.Bot, update: telegram.Update):\n callback_query = update.callback_query\n game_short_name = callback_query.game_short_name\n if game_short_name == \"rock_paper_scissors\...
python
edit
1
2
apache-2.0
a490a85e5842bd31a99a94f2530dbbea2d1c2584
alvarogzp/telegram-games,alvarogzp/telegram-games,alvarogzp/telegram-games,alvarogzp/telegram-games
bot/game/launch.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nimport difflib\nimport pytest\nfrom mbuild.tests.base_test import BaseTest\nfrom mbuild.utils.io import get_fn\nfrom mbuild.utils.validation import assert_port_exists\n\n\nclass TestUtils(BaseTest):\n\n def test_assert_port_exists(self, ...
python
edit
1
4
mit
cd0426dbbfc6f1573cf5d09485b8930eb498e1c6
iModels/mbuild,iModels/mbuild
mbuild/tests/test_utils.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\n\"\"\"\nTests for helper function for updating a target from a Vuforia database.\n\"\"\"\n\nimport io\n\nimport pytest\n\nfrom vws import VWS\nfrom vws.exceptions import UnknownTarget\n\n\nclass TestUpdateTarget:\n \"\"\"\n Test for u...
python
edit
4
1
mit
a2b1d10e042d135c3c014622ffeabd7e96a46f9f
adamtheturtle/vws-python,adamtheturtle/vws-python
tests/test_update_target.py
rejected_lint
Too many lint violations: 4
true
[ { "role": "user", "content": "Here is the current file:\n```python\nimport json\nimport csv\nfrom collections import namedtuple\n\nfrom player_class import Players\n\n\ndef main():\n filename = get_data_file()\n data = load_file(filename)\n division_standings()\n playoff_standings()\n playoff...
python
edit
null
null
mit
42285c696dc2bcbcc1aeb6ed0bd46b6418e4223f
prcutler/nflpool,prcutler/nflpool
program.py
rejected_syntax
Syntax error detected by tree-sitter
false
[ { "role": "user", "content": "Here is the current file:\n```python\nimport pytest\n\nfrom resumeback import send_self\n\nfrom . import CustomError, defer, wait_until_finished, State\n\n\ndef test_subgenerator_next():\n ts = State()\n\n def subgenerator(this):\n yield defer(this.next)\n t...
python
edit
1
1
mit
5523946b35d076c47be92d703cdb071c18f6d0ec
FichteFoll/resumeback
tests/test_subgenerators.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\n#! /usr/bin/env python3\n\n\ndef get_version(data):\n def all_same(s):\n return all(x == s[0] for x in s)\n\n def has_digit(s):\n return any(x.isdigit() for x in s)\n\n data = data.splitlines()\n return list(\n ...
python
edit
1
6
mit
0b035ceaa611c13eac6e2cb01801ac46d9c2b13e
Bystroushaak/pyDHTMLParser,Bystroushaak/pyDHTMLParser
docs/__init__.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\n# trivial test\n\nimport _ctypes\nimport ctypes\n\n```\n\nApply this change: Replace the trivial ctypes test (did only an import) with the real test suite." }, { "role": "assistant", "content": "import unittest\n\nfrom test.test...
python
edit
1
2
mit
f23ee95c7b662dec71ed7fd527854a7f832e3603
sk-/python2.7-type-annotator,sk-/python2.7-type-annotator,sk-/python2.7-type-annotator
Lib/test/test_ctypes.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nfrom django.conf.urls import url\n\nfrom api.applications import views\n\nurlpatterns = [\n url(r'^$', views.ApplicationList.as_view(), name='application-list'),\n url(r'^(?P<client_id>\\w+)/$', views.ApplicationDetail.as_view(), name...
python
edit
1
0
apache-2.0
7b17a42713d0afedb594d184fb82fa3feab5681a
CenterForOpenScience/osf.io,samchrisinger/osf.io,SSJohns/osf.io,mfraezz/osf.io,alexschiller/osf.io,kwierman/osf.io,wearpants/osf.io,kwierman/osf.io,hmoco/osf.io,sloria/osf.io,binoculars/osf.io,brandonPurvis/osf.io,aaxelb/osf.io,ticklemepierce/osf.io,doublebits/osf.io,leb2dg/osf.io,brandonPurvis/osf.io,ticklemepierce/os...
api/applications/urls.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nfrom bockus.settings import *\nimport dj_database_url\n\nDEBUG = False\nTEMPLATE_DEBUG = DEBUG\n\nDATABASES['default'] = dj_database_url.config()\n\nALLOWED_HOSTS = [\n '.booksonas.com',\n '.herokuapp.com',\n 'localhost',\n '127...
python
edit
5
0
mit
36a4b66d3f9f7de52760da5e3c7f7c5f9170bb2a
phildini/bockus,phildini/bockus,phildini/bockus
bockus/prod_settings/__init__.py
rejected_lint
Too many lint violations: 5
true
[ { "role": "user", "content": "Here is the current file:\n```python\n#!/usr/bin/env python\n# -*- coding: utf-8 -*-\nfrom django import template\nfrom ..generate import image_url as url\n\n\nregister = template.Library()\n\n\n@register.simple_tag\ndef image_url(image_url, **kwargs):\n return url(image_url...
python
edit
1
7
mit
c12ec403fe382484b1963738143fe1ea2cbdb000
williamroot/opps,jeanmask/opps,YACOWS/opps,YACOWS/opps,opps/opps,williamroot/opps,jeanmask/opps,jeanmask/opps,opps/opps,YACOWS/opps,YACOWS/opps,williamroot/opps,williamroot/opps,jeanmask/opps,opps/opps,opps/opps
opps/images/templatetags/images_tags.py
rejected_duplicate
Near-duplicate of sample 14428
true
[ { "role": "user", "content": "Here is the current file:\n```python\n\nfrom distutils.core import setup\nfrom glob import glob\nimport os\nimport sys\n\nimport py2exe\n\nif len(sys.argv) == 1:\n sys.argv.append(\"py2exe\")\n sys.argv.append(\"-b 1\")\n\n\nclass Target:\n def __init__(self, **kw):\n ...
python
edit
3
1
apache-2.0
75486c41bd648e63f1baf118000300cb7dee164b
oVirt/ovirt-guest-agent,oVirt/ovirt-guest-agent,oVirt/ovirt-guest-agent,oVirt/ovirt-guest-agent
ovirt-guest-agent/setup.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nfrom django.http import HttpResponse\n\n\ndef health_view(request):\n return HttpResponse()\n\n```\n\nApply this change: Return some text on a health check" }, { "role": "assistant", "content": "from django.http import HttpRe...
python
edit
1
1
bsd-3-clause
d05b9effc6d230aeb2a13759a67df644d75140ca
theirc/CTS,theirc/CTS,theirc/CTS,stbenjam/CTS,stbenjam/CTS,stbenjam/CTS,stbenjam/CTS,theirc/CTS
cts/views.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nfrom armstrong.utils.backends import GenericBackend\n\n\ndef get_template_names(blast, recipient_list, recipient):\n return [\n 'tt_dailyemailblast/%s/%s/%s.html' % (blast.blast_type.slug,\n recipient_list.slug, rec...
python
edit
1
1
apache-2.0
912c81e99adf89d0c39ac19d1705bad4426d134b
texastribune/tt_dailyemailblast,texastribune/tt_dailyemailblast
tt_dailyemailblast/utils.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nimport secure_smtpd\nimport asyncore, logging, time, signal, sys\nfrom secure_smtpd import SMTPServer, FakeCredentialValidator\n\nclass SSLSMTPServer(SMTPServer):\n \n def __init__(self):\n pass\n \n def process_messa...
python
edit
2
1
isc
c156dd50e8f6b699ba87b7e185207e9ad3654979
bcoe/secure-smtpd
examples/ssl_server.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\n# Color Prefs for idle\n\nclass ColorPrefs:\n CNormal = \"black\", \"white\" # \"purple\", \"white\"\n CKeyword = \"#ff7700\", None\n CComment = \"#dd0000\", None\n CString = \"#00aa00\", None\n CDefinition...
python
edit
1
0
mit
2f31183c2ec71baa826282e10ce7e6b7decbdc75
sk-/python2.7-type-annotator,sk-/python2.7-type-annotator,sk-/python2.7-type-annotator
Tools/idle/IdlePrefs.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\n\n# Define your item pipelines here\n#\n# Don't forget to add your pipeline to the ITEM_PIPELINES setting\n# See: http://doc.scrapy.org/en/latest/topics/item-pipeline.html\n\nimport json,os\nfrom datetime import dat...
python
edit
4
2
mit
7c2ef2ce6b31d6188c4ea25d2c885d47a67ad5cb
Liebeck/OnlineParticipationDatasets
OnlineParticipationDataset/pipelines.py
rejected_lint
Too many lint violations: 4
true
[ { "role": "user", "content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Fri Dec 23 19:02:49 2016\n\n@author: sakurai\n\"\"\"\n\nfrom fuel.datasets import H5PYDataset\nfrom fuel.utils import find_in_data_path\nfrom fuel.schemes import SequentialScheme\nfrom fuel.stream...
python
edit
1
2
mit
075d6e6cfe225c7bc57b8cb2ea66be646a207f10
ronekko/deep_metric_learning
cars196_dataset.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nfrom rest_framework.negotiation import BaseContentNegotiation\n\n\nclass CustomClientContentNegotiation(BaseContentNegotiation):\n def select_parser(self, request, parsers):\n \"\"\"\n Select the first parser in the `.parse...
python
edit
1
3
apache-2.0
ece48034dac3466e2ebf5ced85afc0a36cf4997b
ZobairAlijan/osf.io,haoyuchen1992/osf.io,ckc6cz/osf.io,danielneis/osf.io,abought/osf.io,SSJohns/osf.io,felliott/osf.io,cwisecarver/osf.io,kwierman/osf.io,HalcyonChimera/osf.io,laurenrevere/osf.io,GageGaskins/osf.io,RomanZWang/osf.io,cslzchen/osf.io,doublebits/osf.io,samchrisinger/osf.io,acshi/osf.io,mluo613/osf.io,bill...
api/base/content_negotiation.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nfrom celery.task import task\n\nfrom . import models\nfrom .send_backends import sync\n\n\n@task\ndef send_daily_email_blasts(blast_pk):\n blast = models.DailyEmailBlast.objects.get(pk=blast_pk)\n sync.sync_daily_email_blasts(blast)\n...
python
edit
1
1
apache-2.0
68cca0cab9f2cfde6098801936d631aa8255adeb
texastribune/tt_dailyemailblast,texastribune/tt_dailyemailblast
tt_dailyemailblast/tasks.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nimport sqlite3\nimport time\n\n\nclass SQLiteLogger:\n def __init__(self, filename=\"g2x.db\"):\n self.filename = filename\n self.connection = None\n\n def __enter__(self):\n try:\n with open(self.filen...
python
edit
1
3
mit
2b58a34a6bde9c7db39fc436928e344284de633b
gizmo-cda/g2x,gizmo-cda/g2x,thelonious/g2x,gizmo-cda/g2x,gizmo-cda/g2x,thelonious/g2x
app/DataLogger/sqlite_logger.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\n# Open your $EDITOR to compose a message in weechat\n#\n# Usage:\n# /edit\n#\n# History:\n# 10-18-2015\n# Version 1.0.0: initial release\n\nimport os\nimport os.path\nimport subprocess\nimport weechat\n\n\ndef edit(data, buf, args):\n ed...
python
edit
1
2
mit
14503786d1ff3a91cee1b05698faf60e1f7bb371
keith/edit-weechat
edit.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\n# -*- encoding: utf-8\n\nfrom flask_restplus import fields, Model\n\n\nclass TypedModel(Model):\n \"\"\"\n A thin wrapper around ``Model`` that adds a ``type`` field.\n \"\"\"\n\n def __init__(self, name, model_fields, *args, **...
python
edit
1
3
mit
4c4b8f1a9d54d34dd9c2ee89367c7e290f94a12f
wellcometrust/platform-api,wellcometrust/platform-api,wellcometrust/platform-api,wellcometrust/platform-api
archive/archive_api/src/models/_base.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\n\"\"\" Provides a solution (`solve`) to the EMST problem. \"\"\"\n\n# Euclidean Minimum Spanning Tree (MST) algorithm\n#\n# input: a list of n Point objects\n#\n# output: a list of (p, q) tuples, where p and q are each input Point\n# object...
python
edit
1
3
isc
d76e4f45f78dc34a22f641cc8c691ac8f35daf0c
ciarand/exhausting-search-homework
src/exhaustive_search/euclidean_mst.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nimport os\nfrom ..virtualenv import ext_virtualenv\n\ndef test_basic(tmpdir):\n tmpdir = str(tmpdir)\n\n abs_source = os.path.join(tmpdir, 'requirements.txt')\n with open(abs_source, 'w') as vfile:\n vfile.write('bottle\\n')...
python
edit
1
1
mit
95becdbbece636369754850ee14d664042c1f4c2
gosquadron/squadron,gosquadron/squadron
squadron/exthandlers/tests/test_virtualenv.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nfrom plugins.categories import ISilentCommand\n\ntry:\n import requests_pyopenssl\n from requests.packages.urllib3 import connectionpool\n connectionpool.ssl_wrap_socket = requests_pyopenssl.ssl_wrap_socket\nexcept ImportError:\n ...
python
edit
4
6
isc
9b1ecea92cc629bf659764cf45d63b1d911a24e3
ComSSA/KhlavKalash
plugins/urlgrabber.py
rejected_lint
Too many lint violations: 4
true
[ { "role": "user", "content": "Here is the current file:\n```python\nimport os\nfrom tests.test_pip import here, reset_env, run_pip\n\n\ndef test_install_package_that_emits_unicode():\n \"\"\"\n Install a package with a setup.py that emits UTF-8 output and then fails.\n This works fine in Python 2, ...
python
edit
3
1
mit
ac0fe94d5ced669bb1e5b5c0645b0597bf96c895
pjdelport/pip,patricklaw/pip,fiber-space/pip,dstufft/pip,esc/pip,prasaianooz/pip,wkeyword/pip,nthall/pip,fiber-space/pip,graingert/pip,davidovich/pip,luzfcb/pip,cjerdonek/pip,jythontools/pip,RonnyPfannschmidt/pip,pjdelport/pip,techtonik/pip,pradyunsg/pip,mindw/pip,prasaianooz/pip,ianw/pip,qwcode/pip,erikrose/pip,zenlam...
tests/test_unicode.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\n#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\n\nimport pytest\n\nimport numpy as np\n\nimport dask\nimport dask.array as da\nimport dask.array.utils as dau\n\nimport dask_distance._compat\n\n\n@pytest.mark.parametrize(\"x\", [\n list...
python
edit
1
2
bsd-3-clause
4d8ee930b772329b4c3ded17a5a04efb7dada977
jakirkham/dask-distance
tests/test__compat.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nWTF_CSRF_ENABLED = True\nSECRET_KEY = 'you-will-never-guess'\n\n# In minutes\nCURRENT_TICKET_LIFETIME = 2\nQUEUED_TICKET_LIFETIME = 2\n\n```\n\nApply this change: Set standard lifetime of tickets to 12 hours" }, { "role": "assistant...
python
edit
1
0
apache-2.0
27e4adcf0ccd36c7c2a079f04e19ed38e8a05edd
otto-de/gatekeeper,otto-de/gatekeeper,otto-de/gatekeeper,otto-de/gatekeeper
app/config.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nfrom CafeScraper.Scraper import Scraper\r\nimport json\r\n\r\nscraper = Scraper()\r\njson_dump = json.dumps(list(scraper.cafes_dict.values()), default=lambda c: c.__dict__, sort_keys=True)\r\nprint(json_dump)\r\n\r\n# save to file\r\nwith o...
python
edit
1
2
mit
a680f4ba60e79ff7f169916d380f92a47739ccf6
atbe/MSU-Cafe-Scraper,atbe/MSU-Cafe-Scraper
collect_menus_to_json.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\nfrom __future__ import print_function, unicode_literals\nfrom __future__ import absolute_import, division\nimport inspect\nfrom . import registry\n\n\nclass _method_wrapper(object):\n \"\"\"A placeholder object u...
python
edit
1
3
mit
e3adb0e716cd3f200baa037f6d5a1dd0bb598202
concordusapps/python-shield
src/shield/__init__.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\n\"\"\"\nTests for the RAW sql functions.\n\"\"\"\n\nfrom django.conf import settings\nfrom django.test import TestCase\nfrom django.db.models import connection\n\nfrom boardinghouse.models import Schema\n\nclass TestRejectSchemaColumnChange...
python
edit
3
1
bsd-3-clause
2a7eecbf55f5cc00bed76a70990946309baa2baa
schinckel/django-boardinghouse,schinckel/django-boardinghouse,schinckel/django-boardinghouse
boardinghouse/tests/test_sql.py
rejected_duplicate
Near-duplicate of sample 17068
true
[ { "role": "user", "content": "Here is the current file:\n```python\nimport glob\n\nfrom nbconvert.preprocessors import ExecutePreprocessor\nimport nbformat\nimport pytest\n\nnotebooks = sorted(glob.glob(\"*.ipynb\"))\n\n\n@pytest.mark.parametrize(\"notebook\", notebooks)\ndef test_notebook_execution(noteboo...
python
edit
1
1
mit
b60bcae61d2da4a6869db25f233e8bec40740ffc
alanhdu/AccessibleML,adicu/AccessibleML
test/test_notebook.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nimport sublime\nimport os\n\ndef getSetting(key,default=None):\n\ts = sublime.load_settings(\"Fuse.sublime-settings\")\n\treturn s.get(key, default)\n\ndef getFusePathFromSettings():\n\tpath = getSetting(\"fuse_path_override\")\n\tif path =...
python
edit
1
3
mit
2e95fa670bccd4b38aa1bf30932b152559c077f4
fusetools/Fuse.SublimePlugin,fusetools/Fuse.SublimePlugin
fuse_util.py
rejected_duplicate
Near-duplicate of sample 14723
true
[ { "role": "user", "content": "Here is the current file:\n```python\ndef dict_in(value):\n '''\n Checks for the existence of a dictionary in a list\n\n Arguments:\n value -- A list\n\n Returns:\n A Boolean\n '''\n for item in value:\n if isinstance(item, dic...
python
edit
1
2
mit
ce38ad1884cdc602d1b70d5a23d749ff3683f440
dmpayton/reqon
reqon/utils.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nfrom celery.app import default_app\nfrom celery.app import defaults\n\n\ndef clean_quoted_config(config, key):\n # ini doesn't allow quoting, but lets support it to fit with celery\n config[key] = config[key].replace('\"', '')\n\nTYPE...
python
edit
1
7
mit
024209cdefd34e26983ea4910071ccbd1a33faaa
edelooff/pyramid_celery,miohtama/pyramid_celery
pyramid_celery/__init__.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nimport collections\nimport logging\n\nfrom django.utils.translation import ugettext as _\n\nfrom horizon.api import quantum\nfrom horizon import tabs\n\nfrom akanda.horizon.configuration.tables.publicips import PublicIPsTable\n\n\n# The tab...
python
edit
3
5
apache-2.0
ad79f01358aa83162730b15507d7d6d3c3575ab3
dreamhost/akanda-horizon,dreamhost/akanda-horizon
akanda/horizon/configuration/tabs.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\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://www.apache.org/licenses/LICENSE-2.0\n#\n# Unl...
python
edit
1
2
bsd-3-clause
1e2d1f25cb36db7383e6a2300e2e96d47113cc16
kimvais/cryptography,Ayrx/cryptography,kimvais/cryptography,Hasimir/cryptography,Lukasa/cryptography,dstufft/cryptography,skeuomorf/cryptography,sholsapp/cryptography,Hasimir/cryptography,Ayrx/cryptography,kimvais/cryptography,dstufft/cryptography,sholsapp/cryptography,dstufft/cryptography,skeuomorf/cryptography,sholsa...
cryptography/primitives/block/ciphers.py
rejected_duplicate
Near-duplicate of sample 13956
true
[ { "role": "user", "content": "Here is the current file:\n```python\n#\n# HamperAuthenticator is the class to handle the authentication part of the provisioning portal.\n# Instantiate with the email and password you want, it'll pass back the cookie jar if successful,\n# or an error message on failure\n#\nfro...
python
edit
2
2
mit
f6e35897ce3b7e335310016c16a3bf76645bf077
MobileXLabs/hamper
lib/authenticator.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\nimport json\nimport registration\nimport resources\n\n\nclass JSRNEncoder(json.JSONEncoder):\n \"\"\"\n Encoder for JSRN resources.\n \"\"\"\n def default(self, o):\n if isinstance(o, resources.Re...
python
edit
1
4
bsd-3-clause
b0b1be44c64ed48c15f9e796b90a21e7e4597df8
timsavage/jsrn,timsavage/jsrn
jsrn/encoding.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nimport serial\nimport schedule\nimport time\nfrom flask import Flask, request\nfrom threading import Thread\nfrom influxdb import InfluxDBClient\n\nCOM_PORT = 2\nBAUDRATE = 9600\nREAD_THREAD = 10\nDB_HOST = 'localhost'\nDB_HOST_PORT = 8086\...
python
edit
2
2
mit
15e9e3231386cb5a194e184e7b24fed8030f0d41
jpdias/aWareHouse,jpdias/aWareHouse,jpdias/aWareHouse,jpdias/aWareHouse
Server/server.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nfrom django.conf.urls.defaults import patterns, url\n\nfrom flicks.base import views\n\nurlpatterns = patterns('',\n url(r'^/?$', views.home, name='flicks.base.home'),\n url(r'^strings/?$', views.strings, name='flicks.base.strings'),\...
python
edit
1
0
bsd-3-clause
4b93e5aa8c0ce90189fb852e75ee213d3be0d01a
mozilla/firefox-flicks,mozilla/firefox-flicks,mozilla/firefox-flicks,mozilla/firefox-flicks
flicks/base/urls.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\n# This file is part of BenchExec, a framework for reliable benchmarking:\n# https://github.com/sosy-lab/benchexec\n#\n# SPDX-FileCopyrightText: 2007-2020 Dirk Beyer <https://www.sosy-lab.org>\n#\n# SPDX-License-Identifier: Apache-2.0\n\n\ni...
python
edit
3
3
apache-2.0
013277886a3c9f5d4ab99f11da6a447562fe9e46
sosy-lab/benchexec,sosy-lab/benchexec,ultimate-pa/benchexec,dbeyer/benchexec,ultimate-pa/benchexec,sosy-lab/benchexec,sosy-lab/benchexec,sosy-lab/benchexec,ultimate-pa/benchexec,ultimate-pa/benchexec,ultimate-pa/benchexec,dbeyer/benchexec,dbeyer/benchexec,sosy-lab/benchexec,dbeyer/benchexec,ultimate-pa/benchexec
benchexec/tools/cmaesfuzz.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\n\"\"\"\nTests for `kolibri.utils.cli` module.\nThese tests deliberately omit `@pytest.mark.django_db` from the tests,\nso that any attempt to access the Django database during the running\nof these cli methods will result in an error and te...
python
edit
1
2
mit
b236a7961dbc9930ed135602cbed783818bde16e
learningequality/kolibri,learningequality/kolibri,learningequality/kolibri,indirectlylit/kolibri,indirectlylit/kolibri,learningequality/kolibri,indirectlylit/kolibri,indirectlylit/kolibri
kolibri/utils/tests/test_cli_at_import.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\ndef topological_sort_recur(adjacency_dict, start_vertex,\n\t visited_set, finish_ls):\n\t\"\"\"Topological Sorting by Recursion.\"\"\"\n\tvisited_set.add(start_vertex)\n\tfor neighbor_vertex in adjacency_dict[start_ver...
python
edit
1
3
bsd-2-clause
cde8c1b4c89a2e0ef3765372b4838373d5729cdb
bowen0701/algorithms_data_structures
alg_topological_sort.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\n# Copyright (c) 2016 Ansible, Inc.\n# All Rights Reserved.\n\nimport json\n\nfrom django.utils.encoding import smart_text\nfrom django.core.mail.backends.smtp import EmailBackend\nfrom django.utils.translation import ugettext_lazy as _\n\n\...
python
edit
1
2
apache-2.0
e64d13486fe20c44dde0dea6a6fed5a95eddbbd1
snahelou/awx,wwitzel3/awx,snahelou/awx,wwitzel3/awx,wwitzel3/awx,wwitzel3/awx,snahelou/awx,snahelou/awx
awx/main/notifications/email_backend.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\n# Licensed under a 3-clause BSD style license - see LICENSE.rst\nfrom ... import lamda\n\ndef test_query():\n Q = lamda.core.LAMDAQuery()\n Q.lamda_query(mol='co', query_type='erg_levels')\n Q.lamda_query(mol='co', query_type='rad_...
python
edit
1
1
bsd-3-clause
fc25a6c4796ad008570974a682037bc575f15018
imbasimba/astroquery,imbasimba/astroquery,ceb8/astroquery,ceb8/astroquery
astroquery/lamda/tests/test_lamda.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\n# coding: utf-8\n\nfrom epages.client import *\n\nfrom epages.product_service import *\nfrom epages.shop_service import *\n\nfrom epages.shop import *\n\n```\n\nApply this change: Remove product_service from epages package" }, { "ro...
python
edit
4
0
mit
5496f501ff7da677ee76c442b6a5b544d595ce1d
ooz/epages-rest-python,ooz/epages-rest-python
epages/__init__.py
rejected_lint
Too many lint violations: 4
true
[ { "role": "user", "content": "Here is the current file:\n```python\n# Licensed under a 3-clause BSD style license - see LICENSE.rst\n\"\"\"\nPhotutils is an Astropy affiliated package to provide tools for\ndetecting and performing photometry of astronomical sources. It also\nhas tools for background estima...
python
edit
2
2
bsd-3-clause
09eb16e94052cbf45708b20e783a602342a2b85b
larrybradley/photutils,astropy/photutils
photutils/__init__.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nimport sqlite3\n\nclass SQLiteWrapper:\n\tdef __init__(self, db):\n\t\tself.conn = sqlite3.connect(db)\n\t\tself.cursor = self.conn.cursor()\n\t\tself.cursor.execute(\"PRAGMA cache_size=-16000\")\n\t\tself.cursor.execute(\"PRAGMA synchronou...
python
edit
1
11
mit
8fa1cae882c0ff020c0b9c3c2fac9e4248d46ce4
mikispag/bitiodine
deploy/common/sqlite_wrapper.py
rejected_complexity
Cyclomatic complexity too high: 11
true
[ { "role": "user", "content": "Here is the current file:\n```python\nfrom selenium import webdriver\n\nbrowser = webdriver.Firefox()\nbrowser.get('http://localhost:8000')\n\nassert 'Django' in browser.title\n\n```\n\nApply this change: Refactor FTs to setup/teardown with pytest.fixture" }, { "role": ...
python
edit
1
1
mit
0cfd376b02da6ebc70ad66c913e3ee4750a6a04c
jvanbrug/scout,jvanbrug/scout
functional_tests.py
accepted
null
true
[ { "role": "user", "content": "Write python code for the following: Add algorithm for provably unspendable address generation" }, { "role": "assistant", "content": "import obelisk\n\nimport sys\nfrom twisted.internet import reactor\n\n\nTESTNET = True\n\ndef build_output_info_list(unspent_rows):\...
python
new_file
2
4
mit
ce98707e94a772434eaca56791c1b4980da36bf0
saltduck/OpenBazaar,dionyziz/OpenBazaar,Renelvon/OpenBazaar,STRML/OpenBazaar,dionyziz/OpenBazaar,NolanZhao/OpenBazaar,mirrax/OpenBazaar,hoffmabc/OpenBazaar,atsuyim/OpenBazaar,bglassy/OpenBazaar,must-/OpenBazaar,NolanZhao/OpenBazaar,akhavr/OpenBazaar,rllola/OpenBazaar,im0rtel/OpenBazaar,hoffmabc/OpenBazaar,dlcorporation...
node/trust/global.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\n#!/usr/bin/env python\n# Licensed under a 3-clause BSD style license - see LICENSE.rst\nimport mica.centroid_dashboard\n\n# Cheat. Needs entrypoint scripts\nmica.centroid_dashboard.update_observed_metrics()\n\n```\n\nApply this change: Fix ...
python
edit
1
0
bsd-3-clause
9699d573fa459cb7ee90237d7fa64f7014c96db4
sot/mica,sot/mica
scripts/update_centroid_reports.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\n#\n# This file is for everybody to add tests for bugs that aren't\n# fixed yet. Please add a test case and appropriate bug description.\n#\n# When you fix one of the bugs, please move the test to the correct\n# test_ module.\n#\n\nimport un...
python
edit
4
1
mit
b3f60cfd4c1a4241c44fcd6738cbc59b9780af70
sk-/python2.7-type-annotator,sk-/python2.7-type-annotator,sk-/python2.7-type-annotator
Lib/test/outstanding_bugs.py
rejected_lint
Too many lint violations: 4
true
[ { "role": "user", "content": "Here is the current file:\n```python\nimport sys\n\nfrom PyQt5 import QtWidgets\n\nfrom gui.mainWindow import MainWindow\n\n\napp = QtWidgets.QApplication(sys.argv)\nplayerWindow = MainWindow()\nplayerWindow.show()\napp.aboutToQuit.connect(playerWindow.exit)\nsys.exit(app.exec_...
python
edit
1
0
mit
cc317eb3244edb0ef5424d45d333e255247c46cd
michael-stanin/Subtitles-Distributor
src/runApp.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nimport logbook\n\nimport sys\n\nclass SentryLogbookHandler(logbook.Handler):\n def emit(self, record):\n from sentry import capture\n\n # Avoid typical config issues by overriding loggers behavior\n if record.name ==...
python
edit
1
2
bsd-3-clause
2828bdaaf15f1358211ecac376beb0072c0ef7bf
dcramer/sentry-old,dcramer/sentry-old,dcramer/sentry-old
sentry/contrib/logbook/__init__.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nimport os\nimport csv\nfrom parser import Parser\n\nclass Extract:\n\t\"\"\"\n\tExtract data from .git repo and persist as a data set\n\t\"\"\"\n\t# repos name git: .git\n\t# destination absolute path\n\tdef clone_repo(self, repo_name, dest...
python
edit
2
1
mit
7d08a71874dd7b1ab7ba4bb1cd345161d9118266
rajikaimal/emma,rajikaimal/emma
src/extract.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\n\"\"\"Leetcode 84. Largest Rectangle in Histogram\nHard\n\nURL: https://leetcode.com/problems/largest-rectangle-in-histogram/\n\nGiven n non-negative integers representing the histogram's bar height where the\nwidth of each bar is 1, find t...
python
edit
3
3
bsd-2-clause
049e8c746b5f40b3e708dcd749052405e2246160
bowen0701/algorithms_data_structures
lc0084_largest_rectangle_in_histogram.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\n# Copyright (c) 2011-2014 Berkeley Model United Nations. All rights reserved.\n# Use of this source code is governed by a BSD License (see LICENSE).\n\nimport json\n\nfrom huxley.api.serializers import UserSerializer\nfrom huxley.utils.shor...
python
edit
1
2
bsd-3-clause
a5d61bee86c394cf6bc972020cbfe2f95463d1e2
bmun/huxley,nathanielparke/huxley,ctmunwebmaster/huxley,ctmunwebmaster/huxley,nathanielparke/huxley,bmun/huxley,bmun/huxley,ctmunwebmaster/huxley,nathanielparke/huxley,ctmunwebmaster/huxley,bmun/huxley,nathanielparke/huxley
huxley/www/views.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\n#!/usr/bin/env python3\nfrom .base import Serializable\nfrom .locations import Platform\nfrom datetime import datetime\n\n\nclass TimeAndPlace(Serializable):\n def __init__(self, platform=None, arrival=None, departure=None):\n sup...
python
edit
1
3
apache-2.0
09498335615b7e770f5976b9749d68050966501d
NoMoKeTo/choo,NoMoKeTo/transit
models/timeandplace.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nclass Token(object):\n\tdef __init__( self, line ):\n\t\tentries = line.split('\\t')\n\t\tself.form = entries[0].lower()\n\t\tself.gold_pos = entries[1]\n\t\tself.predicted_pos = entries [3]\n\n\tdef createFeatureVector(self, featvec, curre...
python
edit
3
5
mit
d7fc29fb6e0c449617cf6aae1025fd5b718d8b70
YNedderhoff/perceptron-pos-tagger,YNedderhoff/named-entity-recognizer,YNedderhoff/perceptron-pos-tagger,YNedderhoff/aspect-classifier,YNedderhoff/aspect-classifier,YNedderhoff/named-entity-recognizer
modules/token.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nimport os.path\nfrom utils import file_sha1sum\n\n\nclass Artefact(object):\n def __init__(self, filename, extension):\n if not filename.endswith(extension):\n raise ValueError\n self._filename = filename\n ...
python
edit
1
2
mit
cd471449edad56ef6c3a69d025130f4fb8ea1fea
jstutters/Plumbium
plumbium/artefacts.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nfrom __future__ import unicode_literals\n# don't convert to ascii in py2.7 when creating string to return\n\ncrontable = []\noutputs = []\n\n\ndef process_message(data):\n outputs.append([data['channel'], \"from repeat1 \\\"{}\\\" in cha...
python
edit
1
1
mit
59bf9eca217ef8ef3011124d1ff9e1570e8ff76d
cworth-gh/stony
plugins/clue/clue.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\n\"\"\"Actions to run at server startup.\n\"\"\"\n\nfrom django.db import connection\n\n\ndef run():\n \"\"\"Call this from manage.py or tests.\n \"\"\"\n _add_custom_mult_agg_function()\n\n\ndef _add_custom_mult_agg_function():\n ...
python
edit
1
2
mit
9347f3bc4a9c37c7013e8666f86cceee1a7a17f9
churchlab/millstone,woodymit/millstone_accidental_source,churchlab/millstone,woodymit/millstone,churchlab/millstone,woodymit/millstone_accidental_source,churchlab/millstone,woodymit/millstone,woodymit/millstone_accidental_source,woodymit/millstone,woodymit/millstone,woodymit/millstone_accidental_source
genome_designer/main/startup.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nfrom __future__ import print_function\nimport os, pyrax, sys\nimport pyrax.exceptions as pexc\nfrom termcolor import colored\nimport ConfigParser\nfrom subprocess import check_output\n\npath = os.path.dirname(os.path.realpath(__file__))\nco...
python
edit
1
4
apache-2.0
6d76842d9f9394aa78cda55fff9c62a4db5da5c6
boxidau/rax-autoscaler,boxidau/rax-autoscaler,eljrax/rax-autoscaler,rackerlabs/rax-autoscaler
common.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\n# Copyright 2015 Vinicius Chiele. 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 of the License at\n#...
python
edit
2
4
mit
2fc3ee4edc4b7a1842fca369620c790244000f11
viniciuschiele/flask-apidoc
flask_apidoc/commands.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\n\"\"\"\nThis file demonstrates two different styles of tests (one doctest and one\nunittest). These will both pass when you run \"manage.py test\".\n\nReplace these with more appropriate tests for your application.\n\"\"\"\n\nfrom django.te...
python
edit
1
2
bsd-3-clause
3e2b06aa73488323600a5942588b556f2d78c2af
navotsil/Open-Knesset,ofri/Open-Knesset,Shrulik/Open-Knesset,DanaOshri/Open-Knesset,jspan/Open-Knesset,navotsil/Open-Knesset,MeirKriheli/Open-Knesset,jspan/Open-Knesset,Shrulik/Open-Knesset,ofri/Open-Knesset,habeanf/Open-Knesset,jspan/Open-Knesset,noamelf/Open-Knesset,otadmor/Open-Knesset,alonisser/Open-Knesset,navotsi...
persons/tests.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\n\"\"\" NURBS-Python Visualization Component\n\n.. moduleauthor:: Onur Rauf Bingol <<EMAIL>>\n\n\"\"\"\n\n```\n\nApply this change: Add metadata to visualization module" }, { "role": "assistant", "content": "\"\"\" NURBS-Python V...
python
edit
1
0
mit
8377f3e61441a7f465feefba905cd3c82586e1a5
orbingol/NURBS-Python,orbingol/NURBS-Python
geomdl/visualization/__init__.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nimport os\nimport pathlib\n\nGITDIR = pathlib.Path(os.environ.get('GITDIR', '/opt/git')) #TODO check permissions\n\n```\n\nApply this change: Fix GITDIR constant to use local gitdir if global doesn't exist" }, { "role": "assistant",...
python
edit
null
null
mit
74feef6094d884b0116fef895885aa47233801c1
fenhl/gitdir
gitdir/__init__.py
rejected_syntax
Syntax error detected by tree-sitter
false
[ { "role": "user", "content": "Here is the current file:\n```python\n#!/usr/local/bin/python\nclass MuffledCalculator:\n muffled=False\n def calc(self,expr):\n try:\n return eval(expr)\n except ZeroDivisionError:\n if self.muffled:\n print \"Can't divide zero\"\n else:\n ...
python
edit
6
0
apache-2.0
98771f6a7a96ccedf56e3619433e2451d5c3251f
Vayne-Lover/Python
exception/test1.py
rejected_lint
Too many lint violations: 6
true
[ { "role": "user", "content": "Here is the current file:\n```python\n\"\"\"Displays a randomly generated witticism from Brian Chu himself.\"\"\"\n\nimport json\nimport random\n\n__match__ = r\"!brian\"\n\n\nwith open('plugins/brian_corpus/cache.json', 'r') as infile:\n cache = json.load(infile)\n\nwith op...
python
edit
1
3
mit
e23b146f613ed6e0090b0ef1f895ee1785e56f31
kvchen/keffbot-py,kvchen/keffbot
plugins/brian.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nimport os\nfrom subprocess import check_call\n\nimport pytest\n\n\ndef run(command, problem, so, shape, nbpml, *extra):\n args = [\"python\", \"../benchmarks/user/benchmark.py\", command]\n args.extend([\"-P\", str(problem)])\n arg...
python
edit
1
2
mit
4cef3788a19b9ad7059184a39accd2b551407de4
opesci/devito,opesci/devito
tests/test_benchmark.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nfrom tastypie.resources import ModelResource\nfrom tastypie import fields\nfrom tastypie.authentication import BasicAuthentication\nfrom tastypie.authorization import DjangoAuthorization\n\nfrom django.contrib.auth.models import User\n\nfro...
python
edit
1
1
bsd-2-clause
6fd0c91fd1bbc6ae1a8fae46503464ab63603d38
lapo-luchini/pinry,supervacuo/pinry,lapo-luchini/pinry,supervacuo/pinry,wangjun/pinry,QLGu/pinry,Stackato-Apps/pinry,dotcom900825/xishi,lapo-luchini/pinry,Stackato-Apps/pinry,MSylvia/pinry,pinry/pinry,MSylvia/pinry,pinry/pinry,pinry/pinry,Stackato-Apps/pinry,dotcom900825/xishi,QLGu/pinry,wangjun/pinry,QLGu/pinry,rafiro...
pinry/api/api.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nimport json\n\nfrom django.conf import settings\nfrom django.http import HttpResponseRedirect, HttpResponseNotFound\nfrom django.shortcuts import get_object_or_404, resolve_url\nfrom django.utils.http import is_safe_url\nfrom django.views.g...
python
edit
1
7
bsd-3-clause
661d42468359836c0ce9ee4e267241a4aaf7a021
ABASystems/django-lot
lot/views.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nfrom django.contrib.contenttypes.models import ContentType\nfrom django.core import urlresolvers\nfrom django.core.exceptions import ImproperlyConfigured\nfrom django.db import models\nfrom django.test import TestCase\n\nfrom ..permalinks i...
python
edit
1
1
bsd-3-clause
9a14fec9a4bb931b41ab62988975e5688f16573d
lewiscollard/cms,jamesfoley/cms,danielsamuels/cms,lewiscollard/cms,dan-gamble/cms,dan-gamble/cms,lewiscollard/cms,danielsamuels/cms,dan-gamble/cms,jamesfoley/cms,danielsamuels/cms,jamesfoley/cms,jamesfoley/cms
cms/tests/test_permalinks.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nfrom hearthstone import bountyxml\n\n\ndef test_bountyxml_load():\n\tbounty_db, _ = bountyxml.load()\n\n\tassert bounty_db\n\n\tassert bounty_db[47].boss_name == \"Cap'n Hogger\"\n\tassert bounty_db[58].region_name == \"The Barrens\"\n\n```...
python
edit
1
1
mit
24341ee3dabcbad751c849ef8007b669bdce5141
HearthSim/python-hearthstone
tests/test_bountyxml.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\n\nimport click\nfrom .compat import StringIO\nimport seria\n\n\nCONTEXT_SETTINGS = dict(help_option_names=['-h', '--help'])\n\n\n@click.command(context_settings=CONTEXT_SETTINGS)\n@click.option('--xml', 'out_fmt', f...
python
edit
5
3
mit
0b15611eb0020bc2cdb4a4435756315b0bd97a21
rtluckie/seria
seria/cli.py
rejected_lint
Too many lint violations: 5
true
[ { "role": "user", "content": "Here is the current file:\n```python\nfrom devicehive import Handler\nfrom devicehive import DeviceHive\n\n\nclass TestHandler(Handler):\n \"\"\"Test handler class.\"\"\"\n\n def handle_connect(self):\n if not self.options['handle_connect'](self):\n self...
python
edit
1
2
apache-2.0
32efe7a0365738f982030f7c5be3b702dbac87c8
devicehive/devicehive-python
tests/test.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\n#!/usr/bin/python\n\"\"\"\ndemo.py -- Experimenting with expressing this forth-like pattern in Python.\n\nIt appears it can be done with varargs and splatting.\n\"\"\"\n\nimport sys\nimport time\n\n\ndef retry(*args):\n n = args[0]\n f = ...
python
edit
3
2
apache-2.0
d1a43bb960d695ce74d38e9bd95218f655f057a0
oilshell/blog-code,oilshell/blog-code,oilshell/blog-code,oilshell/blog-code,oilshell/blog-code,oilshell/blog-code,oilshell/blog-code
forth-like/demo.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\n\n\n# A special triplet is defined as: a <= b <= c for\n# a in list_a, b in list_b, and c in list_c\ndef get_num_special_triplets(list_a, list_b, list_c):\n # remove duplicates and sort lists\n list_a = sorted(set(list_a))\n list_b...
python
edit
1
6
mit
b2d4bf11b293073c4410ca1be98f657a30c35762
rootulp/hackerrank,rootulp/hackerrank,rootulp/hackerrank,rootulp/hackerrank,rootulp/hackerrank,rootulp/hackerrank
python/triple-sum.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nimport requests\nimport json\nimport time\n\nndex_base_url = 'http://services.bigmech.ndexbio.org'\n\ndef send_request(url_suffix, params):\n res = requests.post(ndex_base_url + url_suffix, data=json.dumps(params))\n res_json = get_re...
python
edit
3
5
bsd-2-clause
e593306092292f72009e13bafe1cbb83f85d7937
jmuhlich/indra,pvtodorov/indra,pvtodorov/indra,bgyori/indra,sorgerlab/belpy,bgyori/indra,johnbachman/belpy,johnbachman/belpy,johnbachman/indra,sorgerlab/indra,johnbachman/indra,bgyori/indra,johnbachman/belpy,sorgerlab/indra,pvtodorov/indra,sorgerlab/indra,johnbachman/indra,jmuhlich/indra,jmuhlich/indra,sorgerlab/belpy,...
indra/bel/ndex_client.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\n#!/usr/bin/env python3\n\n# card-fight-thingy - Simplistic battle card game... thingy\n#\n# The MIT License (MIT)\n#\n# Copyright (c) 2015 The Underscores\n#\n# Permission is hereby granted, free of charge, to any person obtaining a copy\n#...
python
edit
3
0
mit
d5ad324355e0abdf0a6bdcb41e1f07224742b537
TheUnderscores/card-fight-thingy
src/main.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nimport sublime\nimport sublime_plugin\n\n\nclass QuickFileOpenCommand(sublime_plugin.WindowCommand):\n def run(self):\n settings = sublime.load_settings('QuickFileOpen.sublime-settings')\n files = settings.get('files')\n ...
python
edit
1
3
mit
e57c2cefa9e8403aa9a2f27d791604a179c8b998
gsingh93/sublime-quick-file-open
quickfileopen.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nimport json\n\nfrom django.core.cache import cache\nfrom django.conf import settings\nfrom django.template import Library, TemplateSyntaxError\n\nregister = Library()\n\n\n@register.inclusion_tag('svg_icons/icon.html')\ndef icon(name, **kwa...
python
edit
5
1
apache-2.0
4947ebf9460c2cf2ba8338de92601804dec2148a
mikedingjan/django-svg-icons,mikedingjan/django-svg-icons
src/svg_icons/templatetags/svg_icons.py
rejected_lint
Too many lint violations: 5
true
[ { "role": "user", "content": "Here is the current file:\n```python\nfrom unittest.case import TestCase\n\nfrom mock import Mock\n\nfrom robber import expect\nfrom robber.matchers.called import Called\n\n\nclass TestCalled(TestCase):\n def test_matches(self):\n mock = Mock()\n mock()\n ...
python
edit
1
1
mit
5bdfb968d6a05fcb727866bee063f996232bf9b8
vesln/robber.py
tests/matchers/test_called.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nfrom subprocess import call, check_output\n\nclass TestOs:\n \"\"\" Contains test methods to test \n if the vagrant OS got installed properly \"\"\"\n\n\n```\n\nApply this change: Add tests for vagrant guest OS" }, { "role": "...
python
edit
3
1
bsd-3-clause
d3b8b948dac6ccce68ccf21311397ce6792fddc6
DevBlend/DevBlend,DevBlend/zenias,byteknacker/fcc-python-vagrant,DevBlend/DevBlend,DevBlend/zenias,DevBlend/zenias,byteknacker/fcc-python-vagrant,DevBlend/DevBlend,DevBlend/zenias,DevBlend/zenias,DevBlend/DevBlend,DevBlend/DevBlend,DevBlend/zenias,DevBlend/DevBlend
tests/test_modules/os_test.py
accepted
null
true