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 django.core.validators import RegexValidator\n\nsha1_validator = RegexValidator(regex=\"^[a-f0-9]{40}$\",\n message=\"Must be valid sha1 sum\")\ntag_validator = RegexValidator(regex=\"^[A-Za-z][\\w\\-\\.]... | python | edit | 1 | 3 | bsd-3-clause | 2ca3f28b4423fc8ecd19591a039b7a5c814ab25b | siggame/webserver,siggame/webserver,siggame/webserver | webserver/codemanagement/validators.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/bin/python3\n\nimport math\nimport os\nimport random\nimport re\nimport sys\n\n\ndef arrayManipulation(n, queries):\n # An array used to capture the difference of an element\n # compared to the previous element.\n # Therefore th... | python | edit | 6 | 3 | mit | 8900aa1b47449bd6ad204725c3a98f75e17eb3ba | rootulp/hackerrank,rootulp/hackerrank,rootulp/hackerrank,rootulp/hackerrank,rootulp/hackerrank,rootulp/hackerrank | python/array_manipulation.py | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom .base import Base\nimport requests\n\nclass Config(Base):\n \"\"\" Get basic nio info \"\"\"\n\n def __init__(self, options, *args, **kwargs):\n super().__init__(options, *args, **kwargs)\n self._resource = 'service... | python | edit | 1 | 4 | apache-2.0 | efebbe998ac67810f6e0f86b685ab18f1ccf2bda | nioinnovation/nio-cli,neutralio/nio-cli | nio_cli/commands/config.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.core.management.base import BaseCommand\nfrom casexml.apps.case.models import CommCareCase\nfrom corehq.util.couch import iter_update, DocUpdate\n\n\nclass Command(BaseCommand):\n help = (\"Make sure all supply point cases ha... | python | edit | 3 | 5 | bsd-3-clause | e8584f4193658399ea9bb2317915caff78fce88b | dimagi/commcare-hq,qedsoftware/commcare-hq,dimagi/commcare-hq,qedsoftware/commcare-hq,qedsoftware/commcare-hq,qedsoftware/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,qedsoftware/commcare-hq | corehq/apps/commtrack/management/commands/update_supply_point_locations.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom Queue import Empty\nfrom itertools import cycle\n\n\nclass Queue(object):\n\n def __init__(self, backend, name):\n self.name = name\n self.backend = backend\n\n def put(self, payload):\n self.backend.put(self... | python | edit | 2 | 4 | bsd-3-clause | b702569c800953eb3476c927fbc1085e67c88dbd | ask/ghettoq | ghettoq/messaging.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\nfrom openerp import fields, models\n\nclass Session(models.Model):\n _name = 'openacademy.session'\n\n name = fields.Char(required=True)\n start_date = fields.Date()\n duration = fields.Float(digits=(6, ... | python | edit | 1 | 0 | apache-2.0 | 290bf5b5e577673a15e9a71033a5df2704ccff7a | LihanHA/opencademy-project | opencademy/model/openacademy_session.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nGitHubTarballPackage ('mono', 'llvm', '2.10', '943edbc1a93df204d687d82d34d2b2bdf9978f4e',\n\tconfigure = 'CFLAGS=\"-m32\" CPPFLAGS=\"-m32\" CXXFLAGS=\"-m32\" LDFLAGS=\"-m32\" ./configure --prefix=\"%{prefix}\" --enable-optimized --enable-ta... | python | edit | 2 | 0 | mit | e4275c4f1a408dd9f8095bef4ed650ccc54401e9 | BansheeMediaPlayer/bockbuild,mono/bockbuild,mono/bockbuild,BansheeMediaPlayer/bockbuild,BansheeMediaPlayer/bockbuild | packages/mono-llvm-2-10.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"Add Build.priority\n\nRevision ID: 36cbde703cc0\nRevises: fe743605e1a\nCreate Date: 2014-10-06 10:10:14.729720\n\n\"\"\"\n\n# revision identifiers, used by Alembic.\nrevision = '36cbde703cc0'\ndown_revision = 'fe743605e1a'\n\nfrom ale... | python | edit | 1 | 1 | apache-2.0 | 979aada6964a5c8ef1f5c787ce84d72420626901 | dropbox/changes,dropbox/changes,wfxiang08/changes,wfxiang08/changes,bowlofstew/changes,bowlofstew/changes,wfxiang08/changes,dropbox/changes,wfxiang08/changes,dropbox/changes,bowlofstew/changes,bowlofstew/changes | migrations/versions/36cbde703cc0_add_build_priority.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# encoding: utf-8\n\n\n### Attribute Wrapper\nclass AttrWrapper(object):\n attrs = []\n\n def __setattr__(self, name, value):\n if name not in self.attrs:\n raise AttributeError(\"'%s' is not supported\" % name)\n ... | python | edit | 1 | 6 | mit | d1e5f55681eda2b2b358013ad5dca3a58619c914 | xgfone/pycom,xgfone/xutils | pycom/objects.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom random import randint\n\ndef sysrand(sides=6, rolls=5):\n\treturn ''.join(map(str, [randint(1, sides) for i in range(rolls)]))\n\ndef randorg(sides=6, rolls=5):\n\traise NotImplemented\n\ndef generate(suggestions=1, words=6, apikey='')... | python | edit | 1 | 6 | mit | c0e00f3caf12ad95bc753e65fc3721623c552aa0 | darthmall/Alfred-Diceware-Workflow | diceware.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.conf.urls import url, include, patterns\n\nurlpatterns = patterns(\n \"registrasion.views\",\n url(r\"^category/([0-9]+)$\", \"product_category\", name=\"product_category\"),\n url(r\"^checkout$\", \"checkout\", name=\"... | python | edit | 1 | 0 | apache-2.0 | 62d5c5b2bf33a228938924a44e229f2f2cb4e02c | chrisjrn/registrasion,chrisjrn/registrasion | registrasion/urls.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport irc.client\nimport sys\nimport os\n\n\nclass IrcClient(object):\n def __init__(self, server, port, channel, bot_name):\n self.server = server\n self.port = port\n self.channel = channel\n self.bot_name ... | python | edit | 1 | 1 | mit | b089522f108c9071013e0cc00813e29bc415595c | mlopes/LogBot | logbot/irc_client.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"The IPython HTML Notebook\"\"\"\n\n# check for tornado 2.1.0\nmsg = \"The IPython Notebook requires tornado >= 2.1.0\"\ntry:\n import tornado\nexcept ImportError:\n raise ImportError(msg)\nelse:\n if tornado.version_info < (2... | python | edit | 1 | 0 | bsd-3-clause | 2959fa0a9f69cbfb7611bbc12488089921d26ab8 | ipython/ipython,ipython/ipython | IPython/frontend/html/notebook/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.conf.urls import patterns, url\nfrom django.http import Http404\nfrom django.template.response import TemplateResponse\nfrom fluent_pages.extensions import page_type_pool\nfrom icekit.page_types.layout_page.admin import LayoutPa... | python | edit | 4 | 3 | mit | d5b439577d6e609ccb736b5d66c19911a95fc460 | ic-labs/django-icekit,ic-labs/django-icekit,ic-labs/django-icekit,ic-labs/django-icekit | icekit/articles/page_type_plugins.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add script for taking most popular nodes and adding them as node links to NOTEWORTHY_LINKS_NODE."
},
{
"role": "assistant",
"content": "\"\"\"\nThis will update node links on NOTEWORTHY_LINKS_NODE.\n\"\"\"\nimport sys\nimport jso... | python | new_file | 2 | 5 | apache-2.0 | 3fdd43166cd9280960afad5cc13f1cd34e0f944d | RomanZWang/osf.io,Johnetordoff/osf.io,chennan47/osf.io,aaxelb/osf.io,acshi/osf.io,mfraezz/osf.io,chennan47/osf.io,hmoco/osf.io,leb2dg/osf.io,CenterForOpenScience/osf.io,doublebits/osf.io,laurenrevere/osf.io,TomHeatwole/osf.io,wearpants/osf.io,samchrisinger/osf.io,amyshi188/osf.io,RomanZWang/osf.io,aaxelb/osf.io,canerug... | scripts/populate-noteworthy-projects.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add helper function to convert money instances to default currency"
},
{
"role": "assistant",
"content": "from __future__ import unicode_literals\n\nfrom djmoney_rates.utils import convert_money\n\nimport moneyed\n\nfrom .setting... | python | new_file | 1 | 3 | bsd-2-clause | bb20e4e0f8527f2a24a4164022028793336ab17c | evonove/django-bazaar,evonove/django-bazaar,meghabhoj/NEWBAZAAR,meghabhoj/NEWBAZAAR,evonove/django-bazaar,meghabhoj/NEWBAZAAR | bazaar/utils.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport webview\nimport threading\n\n\"\"\"\nThis example demonstrates creating an open file dialog.\n\"\"\"\n\ndef open_file_dialog():\n import time\n time.sleep(5)\n print(webview.create_file_dialog(webview.OPEN_DIALOG, allow_mult... | python | edit | 1 | 1 | bsd-3-clause | fb256b042a485aefa2d9e45b39daa551a3f779ff | r0x0r/pywebview,r0x0r/pywebview,shivaprsdv/pywebview,r0x0r/pywebview,shivaprsdv/pywebview,shivaprsdv/pywebview,shivaprsdv/pywebview,r0x0r/pywebview,r0x0r/pywebview | examples/open_file_dialog.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\n\nfrom django.test import TestCase\nfrom django.http import HttpResponse\nfrom django.test import Client\nfrom django.core.urlresolvers import reverse_lazy, reverse\nfrom django.contrib.auth import get_user_model\n\... | python | edit | 4 | 1 | mit | 482b8f7738da51c394969e526b37093d3c52d663 | pythonkr/pyconapac-2016,pythonkr/pyconapac-2016,pythonkr/pyconapac-2016 | pyconkr/tests.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n__author__ = 'zifnab'\n\nimport string\nfrom passlib.hash import sha512_crypt\nimport database\nfrom flask_login import login_user\n\ndef random_string(size=10, chars=string.ascii_letters + string.digits):\n import random\n return ''.... | python | edit | 1 | 3 | mit | ab99a515995e121944e0e7b355e8980984a2fd98 | zifnab06/zifb.in,zifnab06/zifb.in | util.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\n\nimport datetime\nimport json\nimport logging\nimport urllib2\n\n\nclass HarManager(object):\n\n def __init__(self, args):\n self._logger = logging.getLogger('kcaa.proxy_util')\n self.pageref = 1\n ... | python | edit | 1 | 2 | apache-2.0 | d283c4c94d9ba510460c2530d602fe0c1eb14be5 | kcaa/kcaa,kcaa/kcaa,kcaa/kcaa,kcaa/kcaa | server/proxy_util.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom typing import Tuple\n\nfrom linkedin_scraper.parsers.base import BaseParser\n\n\nclass EmploymentParser(BaseParser):\n def __init__(self):\n self.professions_list = self.get_lines_from_datafile(\n 'professions_list... | python | edit | 1 | 4 | mit | 9d10d279a1f7de2a5572229d68a7065fb9353ab9 | nihn/linkedin-scraper,nihn/linkedin-scraper | linkedin_scraper/parsers/employment.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Copyright (C) 2017 Google Inc.\n# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>\n\nfrom ggrc.converters import errors\nfrom integration.ggrc import TestCase\n\n\nclass TestBasicCsvImport(TestCase):\n\n def ... | python | edit | 1 | 1 | apache-2.0 | 6b14c9e5683d41ca9d8b9138c25af7526c83d1e4 | selahssea/ggrc-core,selahssea/ggrc-core,AleksNeStu/ggrc-core,plamut/ggrc-core,selahssea/ggrc-core,plamut/ggrc-core,AleksNeStu/ggrc-core,VinnieJohns/ggrc-core,VinnieJohns/ggrc-core,VinnieJohns/ggrc-core,AleksNeStu/ggrc-core,VinnieJohns/ggrc-core,plamut/ggrc-core,plamut/ggrc-core,AleksNeStu/ggrc-core,selahssea/ggrc-core | test/integration/ggrc/converters/test_import_delete.py | rejected_duplicate | Near-duplicate of sample 3827 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nclass AllHangs(object):\n title = \"All Hangs\"\n\n @staticmethod\n def matches_hang(_):\n return True\n\nclass DevtoolsHangs(object):\n title = \"Devtools Hangs\"\n\n @staticmethod\n def matches_hang(hang):\n ... | python | edit | 2 | 4 | mit | c1a2a1052d215f9971c7bb1e580fd88ab0b395f8 | squarewave/background-hang-reporter-job,squarewave/background-hang-reporter-job | background_hang_reporter_job/tracked.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\n# get-pmstats.py\n# Henry J Schmale\n# November 25, 2017\n# \n# Calculates the additions and deletions per day within a git repository\n# by parsing out the git log. It opens the log itself.\n# Produces output as a CS... | python | edit | 1 | 2 | mit | ddbc9624aacf9e15897bdfb46fc2016888db114b | HSchmale16/UsefulScripts,HSchmale16/UsefulScripts,HSchmale16/UsefulScripts,HSchmale16/UsefulScripts,HSchmale16/UsefulScripts | git/pmstats2/get-pm-stats.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom flask.ext.assets import Bundle\n\napp_css = Bundle(\n 'app.scss',\n 'map.scss',\n filters='scss',\n output='styles/app.css'\n)\n\napp_js = Bundle(\n 'app.js',\n 'descriptor.js',\n 'map.js',\n 'resources.js',\n ... | python | edit | 1 | 0 | mit | c088a28c9f7020cb64c25eb0e83dfdcd286015d3 | hack4impact/maps4all,hack4impact/asylum-connect-catalog,hack4impact/maps4all-jlc-sp2,hack4impact/maps4all,hack4impact/asylum-connect-catalog,hack4impact/asylum-connect-catalog,AsylumConnect/asylum-connect-catalog,hack4impact/maps4all,hack4impact/maps4all-jlc-sp2,hack4impact/maps4all-jlc-sp2,hack4impact/asylum-connect-c... | app/assets.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport os\nimport sys\n\ntry:\n import pkg_resources\n\n d = pkg_resources.get_distribution('metermaid')\n pkg_locations = (\n os.path.join(d.location, 'config'),\n os.path.join(os.path.dirname(d.location), 'config'),... | python | edit | 1 | 3 | apache-2.0 | 650a4733aa6e15b80e2adeec34fc479a3b2885e3 | rca/cmdline | src/cmdline/config.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add basic django config to be able to manipulate form classes"
},
{
"role": "assistant",
"content": "import django\nfrom django.conf import settings\n\nsettings.configure(\n DATABASES={\n 'default': {\n 'ENGI... | python | new_file | 1 | 0 | mit | a7afe12e241ee8f6ca8b85850ff43b777220ec62 | ana-balica/classy-django-forms,ana-balica/classy-django-forms,ana-balica/classy-django-forms | cdf/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Activate virtualenv\nimport settings\nactivate_this = settings.VENV\nexecfile(activate_this, dict(__file__=activate_this))\n\nfrom webhaak import app as application\n\nif __name__ == \"__main__\":\n # application is ran standalone\n ... | python | edit | 2 | 0 | apache-2.0 | 2a7a65afc84556396822933f95aa080a56824aaa | aquatix/webhaak,aquatix/webhaak | wsgi.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\n\nimport jargparse\n\n#################\n### CONSTANTS ###\n#################\nmetadataPrefix = '#'\naccessionKey = '#!genome-build-accession NCBI_Assembly:'\nlocusTagAttributeKey = 'locus_tag'\n\n#################\n#... | python | edit | 1 | 4 | apache-2.0 | 07dc719807a6d890fa33338746caca61704de0a1 | justinccdev/biolta | src/genbank-gff-to-nquads.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom __future__ import absolute_import\n\nimport celery\n\nfrom tornado import ioloop\n\nfrom .connection import ConnectionPool\nfrom .producer import NonBlockingTaskProducer\nfrom .result import AsyncResult\n\nVERSION = (0, 4, 0)\n__versio... | python | edit | 1 | 5 | bsd-3-clause | 6384e6a23f73eddf1099e01ed0d8c067141651a5 | shnjp/tornado-celery,qudos-com/tornado-celery,mher/tornado-celery,sangwonl/tornado-celery | tcelery/__init__.py | rejected_duplicate | Near-duplicate of sample 3834 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport zeit.cms.interfaces\nimport zeit.cms.testing\nimport zeit.content.dynamicfolder.testing\n\n\nclass EditDynamicFolder(zeit.cms.testing.BrowserTestCase):\n\n layer = zeit.content.dynamicfolder.testing.DYNAMIC_LAYER\n\n def test_c... | python | edit | 1 | 1 | bsd-3-clause | b8d73fb12fa91a6f0aa33ed985dd5521843e05b8 | ZeitOnline/zeit.content.dynamicfolder | src/zeit/content/dynamicfolder/browser/tests/test_folder.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport re\n\nfrom django.http import HttpResponse\n\nfrom pdfdocument.document import PDFDocument\n\n\nFILENAME_RE = re.compile(r'[^A-Za-z0-9\\-\\.]+')\n\ndef pdf_response(filename, as_attachment=True, **kwargs):\n response = HttpRespons... | python | edit | 1 | 2 | bsd-3-clause | af85d44d9a6f7cf65fe504816bcf4a10ba603d51 | matthiask/pdfdocument,dongguangming/pdfdocument | pdfdocument/utils.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom .model import Model\nfrom ... import describe\n\n\ndef _run_child_hooks(model, X, y):\n for layer in model._layers:\n for hook in layer.on_data_hooks:\n hook(layer, X, y)\n X = layer(X[:1000])\n\n\n@describe... | python | edit | 1 | 4 | mit | 1a1a45fe5175d002c239610be487607dbb7cdde1 | spacy-io/thinc,explosion/thinc,spacy-io/thinc,explosion/thinc,spacy-io/thinc,explosion/thinc,explosion/thinc | thinc/neural/_classes/feed_forward.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\n\nimport logging\nimport storj\n\nfrom .utilities.account_manager import AccountManager\n\n\nclass StorjEngine:\n\n __logger = logging.getLogger('%s.StorjEngine' % __name__)\n\n def __init__(self):\n se... | python | edit | 1 | 2 | mit | 865ed33da572f2f364dcd89774eac60738bb446c | lakewik/storj-gui-client | UI/engine.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\nfrom rest_framework import viewsets\nfrom rest_framework.decorators import list_route\nfrom rest_framework.response import Response\n\nfrom lims.permissions.permissions import IsInAdminGroupOrRO\nfrom lims.shared.mixins import AuditTrailV... | python | edit | 1 | 1 | mit | eb25c6900b307792821f7db6bcfa92cc62a80298 | GETLIMS/LIMS-Backend,GETLIMS/LIMS-Backend | lims/pricebook/views.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python3\n\nfrom romi import Romi\nromi = Romi()\nfrom time import sleep\n# from math import pi\n\n\nwhile True:\n battery_millivolts = romi.read_battery_millivolts()\n v_x, v_theta, x, y, theta = romi.read_odometry()\n ... | python | edit | 5 | 0 | mit | c862a4c40f17040017e9bb6f67f5b9fa293c23e5 | waddletown/sw | mcb_interface/driver.py | rejected_lint | Too many lint violations: 5 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n__author__ = 'mjwtom'\n\nimport sqlite3\nimport unittest\n\n\nclass fp_index:\n def __init__(self, name):\n if name.endswith('.db'):\n self.name = name\n else:\n self.name = name + '.db'\n self.... | python | edit | 3 | 2 | apache-2.0 | b2df5972bcc9f3367c3832719d1590410317bbba | mjwtom/swift,mjwtom/swift | swift/obj/dedupe/fp_index.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom http_client import HttpClient\n\nclass Bot():\n \"\"\"\n @brief Facebook messenger bot\n \"\"\"\n\n def __init__(self, token):\n self.api_token = token\n self.client = HttpClient(token)\n\n def send_message... | python | edit | 1 | 2 | mit | 5fc80b347191761d848f6bf736358ec1ec351f33 | ben-cunningham/pybot,ben-cunningham/python-messenger-bot | fbmsgbot/bot.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom humbledb import Mongo, Document\n\n\nclass User(Document):\n username = ''\n password = ''\n email = ''\n config_database = 'mirrit'\n config_collection = 'users'\n\n @property\n def id(self):\n return unico... | python | edit | 3 | 2 | bsd-3-clause | bdee8b95429a6ac96cb0577e7eddbd25b764ebfc | 1stvamp/mirrit | mirrit/web/models.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add some functions for down sampling and normalization"
},
{
"role": "assistant",
"content": "\"\"\" Contains functions for preprocessing audio signals. \"\"\"\n\nimport numpy as np\nimport pandas as pd\n\n\ndef down_mix(x):\n ... | python | new_file | 3 | 2 | mit | a08dea560931c42d04c8bee8c56c1cb548730f21 | mcraig2/synesthesia | synesthesia/preprocess.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom thinglang.compiler.buffer import CompilationBuffer\nfrom thinglang.compiler.opcodes import OpcodeJump, OpcodePopLocal\nfrom thinglang.lexer.blocks.exceptions import LexicalHandle\nfrom thinglang.lexer.values.identifier import Identifie... | python | edit | 1 | 2 | mit | 836e946e5c6bfb6b097622193a4239c7eba1ca9a | ytanay/thinglang,ytanay/thinglang,ytanay/thinglang,ytanay/thinglang | thinglang/parser/blocks/handle_block.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add app for lists, with deliberately failing unit test"
},
{
"role": "assistant",
"content": "from django.test import TestCase\n\nclass SmokeTest(TestCase):\n\n def test_bad_maths(self):\n self.assertEqual(1 + 1, 3)\n"
... | python | new_file | 1 | 1 | mit | a32831dbf6b46b33691a76e43012e9fbbbc80e17 | jrwiegand/tdd-project,jrwiegand/tdd-project,jrwiegand/tdd-project | superlists/lists/tests.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.shortcuts import (\n get_object_or_404, render)\nfrom django.views.decorators.http import \\\n require_http_methods\n\nfrom .models import ExampleModel\n\n\n@require_http_methods(['GET', 'HEAD'])\ndef model_detail(request,... | python | edit | 1 | 1 | bsd-2-clause | 5f888f5ee388efa046bc9e0de0622e5c8b66d712 | jambonrose/djangocon2015-views,jambonrose/djangocon2015-views | src/viewsapp/views.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nclass TaxNotKnown(Exception):\n \"\"\"\n Exception for when a tax-inclusive price is requested but we don't know\n what the tax applicable is (yet).\n \"\"\"\n\n\nclass Price(object):\n \"\"\"\n Simple price class that enc... | python | edit | 1 | 3 | bsd-3-clause | 41cf41f501b715902cf180b5a2f62ce16a816f30 | saadatqadri/django-oscar,WillisXChen/django-oscar,adamend/django-oscar,sasha0/django-oscar,faratro/django-oscar,bnprk/django-oscar,jinnykoo/christmas,jinnykoo/wuyisj.com,WillisXChen/django-oscar,WadeYuChen/django-oscar,taedori81/django-oscar,taedori81/django-oscar,bschuon/django-oscar,WadeYuChen/django-oscar,WillisXChe... | oscar/core/prices.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom .fixtures import elasticsearch\n\n\ndef test_base_os(host):\n assert host.system_info.distribution == 'centos'\n assert host.system_info.release == '7'\n\n\ndef test_java_home_env_var(host):\n java_path_cmdline = '$JAVA_HOME/b... | python | edit | 3 | 1 | apache-2.0 | f76bba08c1a8cfd3c821f641adb2b10e3cfa47b9 | jarpy/elasticsearch-docker,jarpy/elasticsearch-docker | tests/test_base_os.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom datetime import date\nimport re\n\nfrom django.db.models import Max, Min\nfrom django.http import HttpResponse\n\nfrom pdfdocument.document import PDFDocument\n\n\ndef worklog_period(obj):\n activity_period = obj.worklogentries.aggr... | python | edit | 1 | 7 | bsd-3-clause | 0f7ba6290696e1ce75e42327fdfc4f9eae8614c3 | matthiask/pdfdocument,dongguangming/pdfdocument | pdfdocument/utils.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\n\nimport unittest\nimport os\nfrom mathdeck import loadproblem\n\n\nclass TestMathdeckLoadProblem(unittest.TestCase):\n\n def test_loadproblem_has_answers_attribute(self):\n file_name = 'has_answers_attrib... | python | edit | 1 | 1 | apache-2.0 | edfd2edc5496cb412477b7409f43aa53acf7dea9 | patrickspencer/mathdeck,patrickspencer/mathdeck | tests/test_loadproblem.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# coding=utf-8\n\"\"\"\nProvides crossplatform checking of current power source, battery warning level and battery time remaining estimate.\nAllows you to add observer for power notifications if platform supports it.\n\nUsage:\n from pow... | python | edit | 4 | 0 | mit | 44110a305b5a23609c5f6366da9d746244807dbb | Kentzo/Power | power/__init__.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# pyinfra\n# File: pyinfra/api/__init__.py\n# Desc: import some stuff\n\nfrom .config import Config # noqa: F401\nfrom .deploy import deploy # noqa: F401\nfrom .exceptions import ( # noqa: F401\n DeployError,\n InventoryError,\n ... | python | edit | 1 | 0 | mit | 562a0868b3648e3ba40c29289ba7f4ebd4c75800 | Fizzadar/pyinfra,Fizzadar/pyinfra | pyinfra/api/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.forms import Form, CharField, ValidationError\nfrom django.contrib.auth.models import User\n\n\nclass UserChangeForm(Form):\n username = CharField(max_length=30, label='New username')\n\n def clean(self):\n cleaned_... | python | edit | 1 | 2 | apache-2.0 | adcba0285ef700738a63986c7657bd9e5ac85d85 | stianjensen/wikipendium.no,stianjensen/wikipendium.no,stianjensen/wikipendium.no | wikipendium/user/forms.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Django test settings for nodeconductor project.\nfrom nodeconductor.server.doc_settings import *\n\nINSTALLED_APPS += (\n 'nodeconductor.quotas.tests',\n 'nodeconductor.structure.tests',\n)\n\nROOT_URLCONF = 'nodeconductor.structure... | python | edit | 4 | 0 | mit | 1bbf986cbde2d0ec8add3ac845cb10fcd061e46d | opennode/nodeconductor,opennode/nodeconductor,opennode/nodeconductor | nodeconductor/server/test_settings.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Write python code for the following: Add the test of `logging_dict_config`."
},
{
"role": "assistant",
"content": "# encoding: utf-8\n\nimport unittest\nfrom pycom.logging_dict_config import get_config\n\n\nclass LoggingTests(unittest.TestCase):\n\n def test_get_... | python | new_file | 1 | 1 | mit | eebb025f4466a5c26bc99f9a1f24a5f14ca14387 | xgfone/xutils,xgfone/pycom | pycom/tests/test_logging_dict_config.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/python2.2\n# Copyright (c) 2006-2008 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\nimport md5\n\n\"\"\"64-bit fingerprint sup... | python | edit | 8 | 2 | bsd-3-clause | 6854f128461c5e94e90e12183ab91c4cc4a8724b | hgl888/chromium-crosswalk,zcbenz/cefode-chromium,axinging/chromium-crosswalk,Fireblend/chromium-crosswalk,bright-sparks/chromium-spacewalk,fujunwei/chromium-crosswalk,timopulkkinen/BubbleFish,mogoweb/chromium-crosswalk,keishi/chromium,nacl-webkit/chrome_deps,dednal/chromium.src,ondra-novak/chromium.src,robclark/chromiu... | tools/grit/grit/extern/FP.py | rejected_lint | Too many lint violations: 8 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\n\n# Copyright (c) 2012 Google Inc. 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\n\"\"\"\nVerifies that the 'Profile' attribute in VCLin... | python | edit | 1 | 1 | bsd-3-clause | be1199ac1f6c086c17c4c39d54ca1e160d0508cf | csulmone/gyp,csulmone/gyp,csulmone/gyp,csulmone/gyp | test/win/gyptest-link-pdb.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport os\n\nfrom jupyterhub.auth import LocalAuthenticator\nfrom jupyterhub.spawner import LocalProcessSpawner\nfrom tornado import gen\n\nclass FakeUserAuth(LocalAuthenticator):\n \"\"\"Authenticate fake users\"\"\"\n\n @gen.corouti... | python | edit | 1 | 2 | bsd-3-clause | 945baec1540ff72b85b3d0563511d93cb33d660e | jhamrick/nbgrader,jupyter/nbgrader,EdwardJKim/nbgrader,jupyter/nbgrader,jhamrick/nbgrader,jupyter/nbgrader,ellisonbg/nbgrader,ellisonbg/nbgrader,EdwardJKim/nbgrader,ellisonbg/nbgrader,EdwardJKim/nbgrader,ellisonbg/nbgrader,jhamrick/nbgrader,jupyter/nbgrader,EdwardJKim/nbgrader,jhamrick/nbgrader,jupyter/nbgrader | nbgrader/tests/formgrader/fakeuser.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport unittest\nfrom flask import json\nfrom api import db\nfrom api.BucketListAPI import app\nfrom instance.config import application_config\n\n\nclass AuthenticationTestCase(unittest.TestCase):\n def setUp(self):\n app.config.f... | python | edit | 1 | 1 | mit | ddabef55b9dde75af422d4dedb2d5578d7019905 | patlub/BucketListAPI,patlub/BucketListAPI | tests/test_authentication.py | rejected_duplicate | Near-duplicate of sample 2122 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\nfrom __future__ import unicode_literals\nfrom django.utils.translation import ugettext_lazy as _\nfrom django.db import models\n\n\nclass Sura(models.Model):\n \"\"\"\n Model to hold the Quran Chapters \"Sura\... | python | edit | 1 | 1 | mit | 663a61362c30b737f2532de42b5b680795ccf608 | EmadMokhtar/tafseer_api | quran_text/models.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport json\n\nfrom django.shortcuts import render\nfrom django.views.generic import View\nfrom models import Institute, ProjectDetail\nfrom forms import SelectInstituteForm, SelectOrgLevelForm\n\ndef home(request):\n return render(reque... | python | edit | 5 | 7 | mit | 503f92796b9368a78f39c41fb6bb596f32728b8d | Code4SA/herana,Code4SA/herana,Code4SA/herana,Code4SA/herana | herana/views.py | rejected_lint | Too many lint violations: 5 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.apps import AppConfig\nfrom django.utils.translation import ugettext_lazy as _\n\nclass DjangaeConfig(AppConfig):\n name = 'djangae'\n verbose_name = _(\"Djangae\")\n\n def ready(self):\n from .patches.contenttyp... | python | edit | 1 | 1 | bsd-3-clause | 419d2ca4d53e33c58d556b45bcc6910bd28ef91a | kirberich/djangae,asendecka/djangae,asendecka/djangae,SiPiggles/djangae,wangjun/djangae,potatolondon/djangae,kirberich/djangae,SiPiggles/djangae,SiPiggles/djangae,leekchan/djangae,armirusco/djangae,chargrizzle/djangae,trik/djangae,grzes/djangae,armirusco/djangae,jscissr/djangae,trik/djangae,jscissr/djangae,wangjun/djan... | djangae/apps.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Copyright (c) 2013 Leif Johnson <<EMAIL>>\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 the Software without res... | python | edit | 1 | 1 | mit | 2db81321de1c506d6b61d8851de9ad4794deba3e | EmbodiedCognition/pagoda,EmbodiedCognition/pagoda | lmj/sim/base.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/ms/dist/python/PROJ/core/2.5.4-0/bin/python\n\"\"\"Test module for rebuilding the database.\"\"\"\n\nimport os\nimport __init__\n\nimport aquilon.aqdb.depends\nimport nose\nimport unittest\n\nfrom subprocess import Popen, PIPE\n\nclass T... | python | edit | 5 | 2 | apache-2.0 | d81a68a46fbdc98f803c94a2123b48cca6f5da31 | guillaume-philippon/aquilon,quattor/aquilon,quattor/aquilon,stdweird/aquilon,stdweird/aquilon,guillaume-philippon/aquilon,quattor/aquilon,stdweird/aquilon,guillaume-philippon/aquilon | tests/aqdb/test_rebuild.py | rejected_lint | Too many lint violations: 5 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\nimport threading\nimport os\nimport shutil\nfrom PIL import Image, ImageDraw2, ImageDraw, ImageFont\nimport random\n\ncount = range(0, 200)\npath = './generatedNumberImages'\ntext = '0123456789X'\n\ndef start():\n ... | python | edit | 3 | 3 | apache-2.0 | 26eaaffb872d7046be9417ae53302e59dbc7b808 | KevinGong2013/ChineseIDCardOCR,KevinGong2013/ChineseIDCardOCR,KevinGong2013/ChineseIDCardOCR | TrainingDataGenerator/Scripts/generateNumberImage.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Production settings for us_ignite\nimport os\n\nfrom us_ignite.settings import *\n\n# Sensitive values are saved as env variables:\nenv = os.getenv\nPROJECT_ROOT = os.path.dirname(os.path.realpath(__file__))\n# settings is one directory u... | python | edit | 2 | 0 | bsd-3-clause | a0fbf7c19aeebbf1451beab74904ec872c01c9b4 | us-ignite/us_ignite,us-ignite/us_ignite,us-ignite/us_ignite,us-ignite/us_ignite,us-ignite/us_ignite | us_ignite/settings/production.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom io import FileIO\nfrom six import next\nfrom pkg_resources import resource_filename, working_set\nfrom wex.readable import EXT_WEXIN\nfrom wex.output import EXT_WEXOUT\nfrom wex import pytestplugin\n\ndef pytest_funcarg__parent(request... | python | edit | 1 | 1 | bsd-3-clause | 367d8415773a44356ce604ecfc839117798f7d3a | gilessbrown/wextracto,eBay/wextracto,eBay/wextracto,gilessbrown/wextracto | tests/test_pytestplugin.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom unittest import TestCase\n\nfrom asserts import assert_equal\n\nfrom htmlgen import Image\n\nfrom test_htmlgen.util import parse_short_tag\n\n\nclass ImageTest(TestCase):\n\n def test_attributes(self):\n image = Image(\"my-im... | python | edit | 1 | 1 | mit | f4c989567fa77002541c5e5199f2fc3f8e53d6da | srittau/python-htmlgen | test_htmlgen/image.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom PyQt5.QtWidgets import QMainWindow\n\n\n_main_window_geometry = {\n \"initial_height\": 800,\n \"initial_width\": 1000,\n \"min_height\": 400,\n \"min_width\": 500,\n}\n\n\nclass MainWindow(QMainWindow):\n\n def __init__... | python | edit | 1 | 1 | bsd-3-clause | df58b36b6f62c39030d6ff28c6fb67c11f112df0 | NSLS-II-HXN/PyXRF,NSLS-II/PyXRF,NSLS-II-HXN/PyXRF | pyxrf/gui_module/main_window.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Copyright 2017 Google Inc. 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#\n# ... | python | edit | 1 | 0 | apache-2.0 | cb321e7cd20123209fbaca610b9511a166cb5c62 | DataBiosphere/dsub,DataBiosphere/dsub | dsub/_dsub_version.py | rejected_duplicate | Near-duplicate of sample 2591 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"Device call classes.\n\nThese classes implement any response cleaning and validation needed. If a\ncall class isn't defined for a given method then one is created using\nubersmith.calls.BaseCall.\n\n\"\"\"\n\nfrom ubersmith.calls imp... | python | edit | 2 | 0 | mit | 41236c2be66b6f790308cba321cb482807814323 | jasonkeene/python-ubersmith,jasonkeene/python-ubersmith,hivelocity/python-ubersmith,hivelocity/python-ubersmith | ubersmith/calls/device.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\nfrom openerp import fields, models\n\nclass Session(models.Model):\n _name = 'openacademy.session'\n \n name = fields.Char(required=True)\n start_date = fields.Date()\n duration = fields.Float(digits=... | python | edit | 1 | 0 | apache-2.0 | 3005b947312c0219c6754e662496c876e46aafc4 | luisll-vauxoo/openacademy | model/openacademy_session.py | rejected_duplicate | Near-duplicate of sample 178 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# encoding: utf-8\n\n\"\"\"\n.. codeauthor:: Tsuyoshi Hombashi <<EMAIL>>\n\"\"\"\n\nfrom __future__ import absolute_import\nimport abc\n\nimport six\n\nfrom ._function import is_nan\nfrom ._typecode import Typecode\n\n\n@six.add_metaclass(a... | python | edit | 4 | 1 | mit | e2b691810f9d9a33f054bf245f1429d6999338a6 | thombashi/DataProperty | dataproperty/_interface.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom crispy_forms.helper import FormHelper\nfrom crispy_forms.layout import Layout, Submit\nfrom django import forms\n\nfrom accounts.models import Account, Team\nfrom lib.data_cleaning import clean_slug, SlugType\nfrom lib.forms import Mod... | python | edit | 1 | 1 | apache-2.0 | 786ebc992ac09cd4b25e90ee2a243447e39c237f | stencila/hub,stencila/hub,stencila/hub,stencila/hub,stencila/hub | director/accounts/forms.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport re\nfrom django import template\nfrom django.conf import settings\n\nnumeric_test = re.compile(\"^\\d+$\")\nregister = template.Library()\n\ndef getattribute(value, arg):\n \"\"\"Gets an attribute of an object dynamically from a s... | python | edit | 1 | 7 | apache-2.0 | 61a6d057302767aa49633d6d010f7da583035533 | SchoolIdolTomodachi/SchoolIdolAPI,laurenor/SchoolIdolAPI,dburr/SchoolIdolAPI,laurenor/SchoolIdolAPI,rdsathene/SchoolIdolAPI,SchoolIdolTomodachi/SchoolIdolAPI,SchoolIdolTomodachi/SchoolIdolAPI,rdsathene/SchoolIdolAPI,rdsathene/SchoolIdolAPI,dburr/SchoolIdolAPI,dburr/SchoolIdolAPI,laurenor/SchoolIdolAPI | web/templatetags/getattribute.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\nfrom django.utils import timezone\n\n\ndef duration_string(duration, precision='s'):\n \"\"\"Format hours, minutes and seconds as a human-friendly string (e.g. \"2\n hours, 25 minutes, 31 seconds\") with preci... | python | edit | 1 | 9 | bsd-2-clause | 4f84482803049b40d7b7da26d9d624a6a63b4820 | cdubz/babybuddy,cdubz/babybuddy,cdubz/babybuddy | core/utils.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nIRRELEVANT = object()\n\n\nclass ChangeWatcher(object):\n\n def __init__(self, thing, *args, **kwargs):\n self.thing = thing\n self.args = args\n self.kwargs = kwargs\n self.expected_before = kwargs.pop('befor... | python | edit | 1 | 2 | mit | 8e2b9e1c80e3a91df7e2cce775c19208aa9d4839 | gterzian/exam,Fluxx/exam,Fluxx/exam,gterzian/exam | exam/asserts.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom solvent import config\nfrom solvent import run\nfrom solvent import requirementlabel\nimport logging\nimport os\n\n\nclass Bring:\n def __init__(self, repositoryBasename, product, hash, destination):\n self._repositoryBasenam... | python | edit | 1 | 3 | apache-2.0 | 520487df7b9612e18dc06764ba8632b0ef28aad2 | Stratoscale/solvent,Stratoscale/solvent | solvent/bring.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom typing import TypeVar, List\n\nclass Mammal:\n pass\n\nclass Cat(Mammal):\n pass\n\nT = TypeVar('T')\n\ndef count_mammals(seq : List[Mammal]) -> int:\n return len(seq)\n\nlst = [1, 2, 3]\nmlst = [Mammal(), Mammal()]\nclst = [C... | python | edit | 1 | 1 | unlicense | 1be7ac84b951a1e5803bd46de931235e44e40d9a | eliben/code-for-blog,eliben/code-for-blog,eliben/code-for-blog,eliben/code-for-blog,eliben/code-for-blog,eliben/code-for-blog,eliben/code-for-blog,eliben/code-for-blog,eliben/code-for-blog,eliben/code-for-blog,eliben/code-for-blog | 2018/covar/covar-typecheck.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport datetime\nfrom decimal import Decimal\n\nfrom mock import Mock\n\nimport ubersmith.order\n\n# TODO: setup/teardown module with default request handler\n# TODO: mock out requests library vs mocking out request handler\n\n\ndef test_or... | python | edit | 1 | 1 | mit | a23edc2bb3caf15160d9b0d311a40cfb7f75131c | jasonkeene/python-ubersmith,hivelocity/python-ubersmith,hivelocity/python-ubersmith,jasonkeene/python-ubersmith | tests/test_system.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\nclass Idea(models.Model):\n name = models.CharField(max_length=200)\n description = models.TextField()\n votes = models.IntegerField(default=0)\n\n def _... | python | edit | 1 | 1 | mit | 7405bda939632a5f8cac93413b4e99939ef716c2 | neosergio/vote_hackatrix_backend | ideas/models.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#-*- encoding: utf-8 -*-\n\nimport base\n\ndef handle_date(template):\n year = None\n if len(template.params) >= 3:\n try:\n year = int(unicode(template.params[2]))\n except ValueError:\n pass\n ... | python | edit | 7 | 7 | mit | 7f79645182de6fed4d7f09302cbc31351defe467 | guilherme-pg/citationhunt,guilherme-pg/citationhunt,eggpi/citationhunt,guilherme-pg/citationhunt,eggpi/citationhunt,guilherme-pg/citationhunt,eggpi/citationhunt,eggpi/citationhunt | snippet_parser/fr.py | rejected_lint | Too many lint violations: 7 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.conf import settings\nfrom django.conf.urls import patterns, include, url\nfrom django.contrib import admin\nfrom django.http import HttpResponse\nfrom django.conf.urls.static import static\nfrom django.contrib.staticfiles impor... | python | edit | 3 | 2 | mit | cea212a73e76c1b1e5b4795687e5b2a394614227 | mikkokeskinen/tunnistamo,mikkokeskinen/tunnistamo | hkisaml/urls.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"\nContributed by Michael Mericikel.\n\"\"\"\n\nfrom pyramid.decorator import reify\nimport pyramid.url as url\n\nclass URLGenerator(object):\n def __init__(self, context, request):\n self.context = context\n self.requ... | python | edit | 1 | 1 | mit | 24d67552f1ae16179fb1aa21a06c191c6d596fb1 | hlwsmith/akhet,hlwsmith/akhet,Pylons/akhet,hlwsmith/akhet,Pylons/akhet | akhet/urlgenerator.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\n\"\"\"Family module for Wikimedia Commons.\"\"\"\n#\n# (C) Pywikibot team, 2005-2017\n#\n# Distributed under the terms of the MIT license.\n#\nfrom __future__ import absolute_import, unicode_literals\n\n__version__ ... | python | edit | 1 | 1 | mit | 53bb27bd88cb59424e231e7cadbbabcc91cc44e2 | magul/pywikibot-core,PersianWikipedia/pywikibot-core,wikimedia/pywikibot-core,wikimedia/pywikibot-core,magul/pywikibot-core | pywikibot/families/commons_family.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport xkcdpass.xkcd_password as xp\nimport random\n\n\ndef random_capitalisation(s, chance):\n new_str = []\n for i, c in enumerate(s):\n new_str.append(c.upper() if random.random() < chance else c)\n return \"\".join(new_s... | python | edit | 1 | 3 | bsd-3-clause | 31f6cc777054f4b48a37bb93453bcf405a9101a3 | amiryal/XKCD-password-generator,amiryal/XKCD-password-generator | examples/example_import.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# pylint: disable=no-self-use,too-many-arguments\nfrom azure.mgmt.network.models import Subnet, SecurityRule\nfrom ._factory import _network_client_factory\n\ndef create_update_subnet(resource_group_name, subnet_name, virtual_network_name, ... | python | edit | 1 | 1 | mit | d7bec88009b73a57124dbfacc91446927328abf9 | QingChenmsft/azure-cli,samedder/azure-cli,BurtBiel/azure-cli,QingChenmsft/azure-cli,yugangw-msft/azure-cli,yugangw-msft/azure-cli,yugangw-msft/azure-cli,samedder/azure-cli,samedder/azure-cli,QingChenmsft/azure-cli,QingChenmsft/azure-cli,yugangw-msft/azure-cli,yugangw-msft/azure-cli,samedder/azure-cli,yugangw-msft/azure... | src/command_modules/azure-cli-network/azure/cli/command_modules/network/custom.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\n\"\"\"Config-like for paver tool.\"\"\"\nfrom paver.easy import task, sh, path # noqa\n\n# pylint: disable=invalid-name\ncli_command_name = 'serverauditor'\n\n\n@task\ndef lint():\n \"\"\"Check code style and co... | python | edit | 1 | 3 | bsd-3-clause | 18a03c7bdb433e9f75fd93a39735ccb935e0072c | EvgeneOskin/termius-cli,EvgeneOskin/termius-cli,Crystalnix/serverauditor-sshconfig,Crystalnix/serverauditor-sshconfig,EvgeneOskin/serverauditor-sshconfig | pavement.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"Tests of tools for setting up interactive IPython sessions. \"\"\"\n\nfrom sympy.interactive.session import init_ipython_session, enable_automatic_symbols\n\nfrom sympy.core import Symbol\nfrom sympy.external import import_module\nfro... | python | edit | 3 | 1 | bsd-3-clause | 116e9107f8ef9d4e074f17a4445f7b3ecceb7ab1 | atreyv/sympy,wyom/sympy,Curious72/sympy,jerli/sympy,yashsharan/sympy,dqnykamp/sympy,debugger22/sympy,iamutkarshtiwari/sympy,cswiercz/sympy,AkademieOlympia/sympy,drufat/sympy,kaichogami/sympy,postvakje/sympy,ahhda/sympy,srjoglekar246/sympy,abhiii5459/sympy,cswiercz/sympy,meghana1995/sympy,Titan-C/sympy,ga7g08/sympy,pand... | sympy/interactive/tests/test_ipython.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.contrib import admin\n\nfrom .models import Playbook, Registry, Repository\n\nadmin.site.register(Playbook)\nadmin.site.register(Registry)\nadmin.site.register(Repository)\nadmin.site.site_header = 'Ansible Admin'\n\n```\n\nAppl... | python | edit | 1 | 0 | bsd-3-clause | 3e1f5adf1402d6e9ddd4ef6a08f4a667be950e1d | lozadaOmr/ansible-admin,lozadaOmr/ansible-admin,lozadaOmr/ansible-admin | src/ansible/admin.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\n\nimport unittest\nfrom flask import Flask\nfrom flask.ext.knot import Knot, get_container\n\n\ndef create_app():\n app = Flask(__name__)\n app.config['TESTING'] = True\n return app\n\n\nclass TestKnot(unit... | python | edit | 1 | 1 | mit | a5ce8febd35795a06288291ae67df1a92b4ba664 | jaapverloop/flask-knot | test_knot.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\n\nimport ed25519\nimport hmac\nfrom sqrl.utils import baseconv\n\n\nclass Crypt:\n \"\"\"\n Crypt\n - Creating site specific key pair\n - Signing SRQL response\n - Providing public key\n \"\"\"\n\n ... | python | edit | 1 | 1 | mit | 17fbd2f3fa24da128cb5cabef4a8c94b59b50b0c | vegarwe/sqrl,vegarwe/sqrl,vegarwe/sqrl,vegarwe/sqrl | sqrl/client/crypt.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport os, errno\n# Create build folder if it doesn't exist\ntry:\n os.makedirs('build')\nexcept OSError as e:\n if e.errno != errno.EEXIST:\n raise\n\ntemplate = open('./5xx.template.html', 'r')\ntemplateString = template.read... | python | edit | 1 | 1 | mit | 1ea51baec10ebc76bfb2be88270df2050a29fbb5 | thegazelle-ad/gazelle-server,thegazelle-ad/gazelle-server,thegazelle-ad/gazelle-front-end,thegazelle-ad/gazelle-server,thegazelle-ad/gazelle-server,thegazelle-ad/gazelle-server,thegazelle-ad/gazelle-front-end | http-error-static-pages/5xx-static-html-generator.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.conf.urls import patterns, include, url\nfrom django.contrib import admin\n\nurlpatterns = patterns('',\n url(r'^djadmin/', include(admin.site.urls)),\n)\n\n```\n\nApply this change: Add root URL (to serve public wishlist)"
... | python | edit | 1 | 0 | mit | c3479ba8d8486ae9a274367b4601e9e4b6699a1a | cgarvey/django-mywishlist,cgarvey/django-mywishlist | prj/urls.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport os\nfrom flask import Flask, abort, request\nfrom flask.ext import restful\nfrom vaux.storage import LibreDB\nfrom datetime import datetime\nfrom werkzeug import secure_filename\nfrom cors import crossdomain\n\napp = Flask(__name__)\... | python | edit | 7 | 0 | mit | 5c7c1155a6bfe0e1dda8def877bcef9d8c528ee3 | VauxIo/core | vaux/api/__init__.py | rejected_lint | Too many lint violations: 7 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.conf.urls import url\nfrom core import views\n\nurlpatterns = [\n\turl(r'^sensors/$', views.SensorList.as_view()),\n\turl(r'^sensors/(?P<pk>[0-9]+)/$', views.SensorDetail.as_view()),\n\n\turl(r'^stations/$', views.StationList.as... | python | edit | 1 | 0 | apache-2.0 | 465fd8892c177925d8da3080d08676daad866195 | qubs/climate-data-api,qubs/data-centre,qubs/climate-data-api,qubs/data-centre | core/urls.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django import http\nfrom mailgun import utils\n\nimport models as unsubscribe_model\n\ndef unsubscribe_webhook(request):\n verified = utils.verify_webhook(\n request.POST.get('token'), \n request.POST.get('timestamp'),... | python | edit | 1 | 4 | mit | c7ef5d2c049beba4bd1b12ec2e62a61446746a8a | p2pu/mechanical-mooc,p2pu/mechanical-mooc,p2pu/mechanical-mooc,p2pu/mechanical-mooc | unsubscribe/views.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport inspect\n\nfrom cinspect import getsource, getfile\n\nimport IPython.core.oinspect as OI\nfrom IPython.utils.py3compat import cast_unicode\n\nold_find_file = OI.find_file\nold_getsource = inspect.getsource\n\ninspect.getsource = gets... | python | edit | 1 | 3 | bsd-3-clause | 8255fd2fdee3a7d6b96859eb7b8d1297431c730b | punchagan/cinspect,punchagan/cinspect | utils/00-cinspect.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom datetime import date, timedelta\n\ndef iso_to_gregorian(year, week, weekday):\n jan_8 = date(year, 1, 8).isocalendar()\n offset = (week - jan_8[1]) * 7 + (weekday - jan_8[2])\n return date(year, 1, 8) + timedelta(days=offset)\... | python | edit | 1 | 4 | apache-2.0 | 41c7d60556dff4be1c5f39cf694470d3af4869f0 | jwg4/calexicon,jwg4/qual | qual/iso.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\n# encoding: utf-8\nimport sys\nimport re\nimport argparse\nimport fileinput\n\nfrom argparse import RawDescriptionHelpFormatter\n\nfrom patterns import pre_patterns\n\n\ndef prepare(infile, outfile=sys.stdout):\n \... | python | edit | 1 | 5 | mit | 848384b0283538556a231a32e4128d52ba9e1407 | abcdw/direlog,abcdw/direlog | direlog.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom kat.harness import Query\nfrom abstract_tests import AmbassadorTest, ServiceType, HTTP\n\n\nclass LuaTest(AmbassadorTest):\n target: ServiceType\n\n def init(self):\n self.target = HTTP()\n\n def manifests(self) -> str:... | python | edit | 1 | 2 | apache-2.0 | 0d37a94593a7749dca4b2553334f1b67c946d3f8 | datawire/ambassador,datawire/ambassador,datawire/ambassador,datawire/ambassador,datawire/ambassador | ambassador/tests/t_lua_scripts.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom flask import flash\nfrom flask_wtf import FlaskForm\nfrom wtforms import StringField, PasswordField\nfrom wtforms.validators import DataRequired, Email, Length\n\n\ndef flash_errors(form):\n \"\"\" Universal interface to handle form... | python | edit | 3 | 3 | mit | 0948eced6cd551df7f136614b136378e9864b4eb | openedoo/module_employee,openedoo/module_employee,openedoo/module_employee | forms.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom fabric.api import *\nfrom fabric.colors import *\n\nenv.colorize_errors = True\nenv.hosts = ['sanaprotocolbuilder.me']\nenv.user = 'root'\nenv.virtualenv = 'source /usr/local/bin/virtualenvwrapper.sh'\nenv.pro... | python | edit | 28 | 1 | bsd-3-clause | 969334fec0822a30d1e5f10a458f79556053836a | SanaMobile/sana.protocol_builder,SanaMobile/sana.protocol_builder,SanaMobile/sana.protocol_builder,SanaMobile/sana.protocol_builder,SanaMobile/sana.protocol_builder | fabfile.py | rejected_lint | Too many lint violations: 28 | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.